/* ═══════════════════════════════════════════════════
   Poker Creators Directory — Styles
   ═══════════════════════════════════════════════════ */

/* ── Reset & Base ────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0d0f12;
  --bg-card: #161a1f;
  --bg-hover: #1f252c;
  --border: #262d35;
  --text: #e1e6eb;
  --text-muted: #88939e;
  --text-dim: #5c6772;
  --accent: #e8493c;
  --accent-hover: #f05a4d;
  --green: #3fb98b;
  --yellow: #e8b84c;
  --blue: #4a8fe0;
  --purple: #9b59b6;
  --pink: #e04a8f;
  --orange: #e07a2f;

  --radius: 8px;
  --radius-sm: 4px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Cascadia Code", monospace;
}

html {
  font-size: 15px;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ── Header ─────────────────────────────────────── */
.header {
  background: linear-gradient(135deg, #161a1f 0%, #1a1f26 50%, #0f1216 100%);
  border-bottom: 1px solid var(--border);
  padding: 32px 0 20px;
}

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

.logo {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 4px;
}
.badge-beta {
  background: var(--yellow);
  color: #1a1a1a;
}

.subtitle {
  color: var(--text-muted);
  margin-top: 6px;
  font-size: 0.9rem;
}

.meta-bar {
  display: flex;
  gap: 20px;
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.header-feedback {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.header-feedback a {
  color: var(--accent);
  text-decoration: none;
}
.header-feedback a:hover {
  text-decoration: underline;
}

/* ── Controls ───────────────────────────────────── */
.controls {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.controls-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.search-wrapper {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.search-input {
  width: 100%;
  padding: 10px 14px 10px 42px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 73, 60, 0.15);
}
.search-input::placeholder {
  color: var(--text-dim);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  pointer-events: none;
}

.controls-actions {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.filter-group label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 600;
}
.filter-group select {
  padding: 9px 30px 9px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2388939e' d='M3 5l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.filter-group select:focus {
  outline: none;
  border-color: var(--accent);
}

.btn {
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.btn-outline:hover {
  border-color: var(--text-muted);
  color: var(--text);
  background: var(--bg-hover);
}

/* ── Tag Filters ────────────────────────────────── */
.filter-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.tag {
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s;
}
.tag:hover {
  border-color: var(--text-dim);
  color: var(--text);
}
.tag-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.tag-active:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* ── Filter Row (checkboxes, columns panel) ───── */
.filter-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 10px;
  position: relative;
}

.filter-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  font-weight: 600;
  margin-right: 4px;
  line-height: 24px;
}

.platform-checkboxes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
}

.chk {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
  line-height: 24px;
}
.chk:hover {
  color: var(--text);
}
.chk input[type="checkbox"] {
  appearance: none;
  width: 15px;
  height: 15px;
  border: 1.5px solid var(--border);
  border-radius: 3px;
  background: var(--bg);
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
}
.chk input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
.chk input[type="checkbox"]:checked::after {
  content: "✓";
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.chk input[type="checkbox"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.columns-wrapper {
  position: relative;
  display: inline-block;
}

.columns-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 12px;
  padding: 8px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 20;
  margin-top: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}
.columns-panel.hidden {
  display: none;
}

.panel-sep {
  margin-left: 8px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
}

.download-wrapper {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 20;
  margin-top: 6px;
  min-width: 200px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  overflow: hidden;
}
.dropdown-menu.hidden {
  display: none;
}
.dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  color: var(--text);
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.dropdown-item:hover {
  background: var(--bg-hover);
}
.dropdown-item:first-child {
  border-bottom: 1px solid var(--border);
}

.caret {
  font-size: 0.65rem;
  margin-left: 4px;
}

/* ── Column visibility ────────────────────────── */
.col-hidden {
  display: none !important;
}

/* ── Results Count ──────────────────────────────── */
.results-count {
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 12px;
}

/* ── Table ──────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.creators-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.creators-table th {
  text-align: left;
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
  user-select: none;
  cursor: pointer;
  position: sticky;
  top: 0;
}

.creators-table th:hover {
  color: var(--text);
}

.sort-indicator {
  color: var(--accent);
  font-weight: 700;
}

.creators-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.creators-table tbody tr {
  transition: background 0.1s;
}

.creators-table tbody tr:hover {
  background: var(--bg-hover);
}

.creators-table tbody tr:last-child td {
  border-bottom: none;
}

/* ── Creator Name Column ────────────────────────── */
.creator-name {
  display: flex;
  flex-direction: column;
}
.creator-name strong {
  font-size: 0.9rem;
  font-weight: 600;
}
.creator-name a {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-decoration: none;
}
.creator-name a:hover {
  color: var(--blue);
  text-decoration: underline;
}

/* ── Tags in table ──────────────────────────────── */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tag-pill {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.tag-vlog        { background: rgba(232, 73, 60, 0.15); color: #f06b60; }
.tag-cash-game   { background: rgba(59, 185, 139, 0.15); color: #5cd6a3; }
.tag-tournament  { background: rgba(74, 143, 224, 0.15); color: #7ab4f0; }
.tag-coaching    { background: rgba(232, 184, 76, 0.15); color: #f0cc5c; }
.tag-streamer    { background: rgba(155, 89, 182, 0.15); color: #c084d8; }
.tag-high-stakes { background: rgba(224, 74, 143, 0.15); color: #e87ab0; }
.tag-low-stakes  { background: rgba(63, 185, 139, 0.15); color: #7be0b0; }
.tag-florida     { background: rgba(232, 122, 47, 0.15); color: #f09a5c; }
.tag-educational { background: rgba(59, 185, 139, 0.15); color: #5cd6a3; }
.tag-entertainment { background: rgba(232, 122, 47, 0.15); color: #f09a5c; }
.tag-live-reporting { background: rgba(74, 143, 224, 0.15); color: #7ab4f0; }
.tag-default     { background: rgba(255,255,255,0.05); color: var(--text-muted); }

/* ── Platform Columns ───────────────────────────── */
.platform-cell {
  text-align: center;
}

.col-platform {
  min-width: 90px;
  text-align: center;
}

.platform-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 0.7rem;
  transition: transform 0.15s;
}
.platform-icon-small {
  font-size: 0.65rem;
  margin-right: 4px;
  opacity: 0.6;
}

.followers-count {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.no-followers {
  color: var(--text-dim);
  font-size: 0.75rem;
}

.last-active-cell {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.last-active-cell .recent {
  color: var(--green);
}
.last-active-cell .stale {
  color: var(--text-dim);
}

/* ── Empty / Loading States ─────────────────────── */
.loading, .empty {
  text-align: center;
  padding: 60px 20px !important;
  color: var(--text-dim);
  font-size: 0.9rem;
}

.empty strong {
  display: block;
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* ── Total Followers sortability ────────────────── */
.col-total, .col-name {
  min-width: 100px;
}

/* ── Footer ─────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 32px 0;
  color: var(--text-dim);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 32px;
}

.version-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  opacity: 0.5;
}

/* ── Creator Detail Drawer ──────────────────────── */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 480px;
  max-width: 100vw;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  z-index: 100;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.4);
}
.drawer.open {
  transform: translateX(0);
}

.drawer-inner {
  position: relative;
  min-height: 100%;
}

.drawer-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background 0.15s, color 0.15s;
}
.drawer-close:hover {
  background: var(--bg-hover);
  color: var(--text);
}

/* Drawer Header */
.drawer-hero {
  position: relative;
  padding: 40px 32px 24px;
  background: linear-gradient(180deg, rgba(232, 73, 60, 0.08) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.drawer-avatar {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 3px solid var(--border);
  object-fit: cover;
  margin-bottom: 12px;
  background: var(--bg);
}
.drawer-avatar-placeholder {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  border: 3px solid var(--border);
  margin: 0 auto 12px;
  background: linear-gradient(135deg, var(--accent), var(--orange));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
}

.drawer-name {
  font-size: 1.3rem;
  font-weight: 700;
}

.drawer-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 8px;
}

/* Drawer Body */
.drawer-body {
  padding: 24px 32px 40px;
}

.drawer-section {
  margin-bottom: 24px;
}
.drawer-section:last-child {
  margin-bottom: 0;
}

.drawer-section-title {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 8px;
}

.drawer-bio {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Stats Row */
.drawer-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.drawer-stat {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}
.drawer-stat-value {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.drawer-stat-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Sponsor Pills */
.drawer-sponsors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.drawer-sponsor {
  padding: 4px 12px;
  background: rgba(232, 184, 76, 0.1);
  border: 1px solid rgba(232, 184, 76, 0.2);
  border-radius: 20px;
  font-size: 0.78rem;
  color: var(--yellow);
}
.drawer-no-sponsors {
  color: var(--text-dim);
  font-size: 0.82rem;
  font-style: italic;
}

/* Platform List in Drawer */
.drawer-platforms {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-platform {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: border-color 0.15s;
}
.drawer-platform:hover {
  border-color: var(--text-dim);
}

.drawer-platform-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.dp-youtube { background: rgba(255, 0, 0, 0.15); color: #ff4444; }
.dp-twitch  { background: rgba(145, 70, 255, 0.15); color: #a970ff; }
.dp-twitter { background: rgba(29, 161, 242, 0.15); color: #1da1f2; }
.dp-instagram { background: rgba(228, 64, 95, 0.15); color: #e4405f; }
.dp-facebook { background: rgba(24, 119, 242, 0.15); color: #1877f2; }
.dp-tiktok  { background: rgba(255, 255, 255, 0.08); color: var(--text-muted); }
.dp-kick    { background: rgba(83, 205, 97, 0.15); color: #53cd61; }

.drawer-platform-info {
  flex: 1;
  min-width: 0;
}
.drawer-platform-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}
.drawer-platform-handle {
  font-size: 0.75rem;
  color: var(--text-dim);
}
.drawer-platform-meta {
  text-align: right;
  flex-shrink: 0;
}
.drawer-platform-followers {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.drawer-platform-last {
  display: block;
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* Clickable rows */
.creators-table tbody tr {
  cursor: pointer;
}
.creators-table tbody tr.selected {
  background: rgba(232, 73, 60, 0.08);
  border-left: 3px solid var(--accent);
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 900px) {
  .controls-row {
    flex-direction: column;
    align-items: stretch;
  }
  .search-wrapper {
    min-width: unset;
  }
  .controls-actions {
    justify-content: stretch;
  }
  .controls-actions .filter-group {
    flex: 1;
  }
  .controls-actions select {
    width: 100%;
  }
  .creators-table {
    font-size: 0.82rem;
  }
  .creators-table th,
  .creators-table td {
    padding: 10px 10px;
  }
  .col-platform span.platform-icon {
    display: none;
  }
  .platform-checkboxes {
    gap: 2px 8px;
  }
  .columns-panel {
    left: auto;
    right: 0;
  }
}

@media (max-width: 600px) {
  .creators-table .col-tags,
  .creators-table .col-last {
    display: none;
  }

  /* Drawer full-width on mobile */
  .drawer {
    width: 100vw;
  }
  .drawer-hero {
    padding: 32px 20px 20px;
  }
  .drawer-body {
    padding: 20px;
  }
  .drawer-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .drawer-stat {
    padding: 10px 6px;
  }
  .drawer-stat-value {
    font-size: 0.95rem;
  }

  /* Columns panel full-width on mobile */
  .columns-panel {
    left: 0;
    right: 0;
    width: 100%;
  }
}

/* ═══════════════════════════════════════════════════
   Payment & Credits UI — added v0.1.0
   ═══════════════════════════════════════════════════ */

/* ── Header Actions ─────────────────────────────── */
.header-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.header-top-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-top-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

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

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}

/* ── Credit Badge ───────────────────────────────── */
.credit-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(59, 185, 139, 0.12);
  border: 1px solid rgba(59, 185, 139, 0.25);
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--green);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition: background 0.15s;
}
.credit-badge:hover {
  background: rgba(59, 185, 139, 0.2);
}
.credit-badge.hidden {
  display: none;
}

/* ── Payment Success Banner ─────────────────────── */
.payment-banner {
  background: rgba(59, 185, 139, 0.12);
  border-bottom: 1px solid rgba(59, 185, 139, 0.25);
  padding: 12px 0;
  font-size: 0.88rem;
  color: var(--green);
}
.payment-banner .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.payment-banner.hidden {
  display: none;
}
.banner-close {
  background: none;
  border: none;
  color: var(--green);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.7;
}
.banner-close:hover {
  opacity: 1;
}

/* ── Modal Overlay ──────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.hidden {
  display: none;
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.modal-sm {
  max-width: 440px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 0;
}
.modal-header h2,
.modal-header h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.modal-close:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.modal-body {
  padding: 20px 24px 24px;
}

/* ── Plan Cards ─────────────────────────────────── */
.plan-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.plan-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  position: relative;
}
.plan-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(232, 73, 60, 0.2);
}
.plan-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(232, 73, 60, 0.3);
}
.plan-card.free {
  border-color: var(--text-dim);
}

.plan-card-name {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.plan-card-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}
.plan-card-price span {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
}
.plan-card-credits {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.plan-card-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.plan-card .popular-badge {
  position: absolute;
  top: -8px;
  right: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 4px;
}

.plan-placeholder {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-dim);
  padding: 20px;
}

/* ── Checkout Form ──────────────────────────────── */
.checkout-form {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.checkout-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.checkout-row {
  display: flex;
  gap: 8px;
}
.checkout-row .input {
  flex: 1;
}
.checkout-note {
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--text-dim);
}

.input {
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
}
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 73, 60, 0.15);
}
.input::placeholder {
  color: var(--text-dim);
}

.checkout-loading {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── API Key Modal ──────────────────────────────── */
#apikey-modal .input {
  width: 100%;
  margin: 12px 0;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}
.apikey-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.apikey-status {
  margin-top: 10px;
  font-size: 0.82rem;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}
.apikey-status.success {
  background: rgba(59, 185, 139, 0.1);
  color: var(--green);
  border: 1px solid rgba(59, 185, 139, 0.2);
}
.apikey-status.error {
  background: rgba(232, 73, 60, 0.1);
  color: var(--accent);
  border: 1px solid rgba(232, 73, 60, 0.2);
}
.apikey-status.hidden {
  display: none;
}

/* ── Paywall overlay on table ───────────────────── */
.paywall-overlay {
  position: relative;
}
.paywall-overlay::after {
  content: "Subscribe to export & full search";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  text-align: center;
  background: linear-gradient(transparent, var(--bg) 60%);
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}