/**
 * ═══════════════════════════════════════════════════════════════
 * listings.css — Tab 4: Product Research styles
 * ═══════════════════════════════════════════════════════════════
 *
 * SCOPE:
 *   All styles prefixed with .le- (Listings Engine)
 *   All styles prefixed with .re- (Research Engine — stubs)
 *   Never affects Tab 1, 2 or existing classes.
 *
 * DESIGN TOKENS USED (from index.html :root):
 *   --bg, --surface, --surface-2, --border
 *   --accent, --accent-dim, --success, --warning, --danger
 *   --text-1, --text-2, --text-3
 *   --radius-sm, --radius-md, --radius-lg
 *   --shadow, --font-display, --font-body
 *
 * SECTIONS:
 *   1. Filter Bar
 *   2. Results Summary
 *   3. Table
 *   4. Listing Row
 *   5. Pagination
 *   6. Detail View
 *   7. Leaderboard
 *   8. Loading & Error States
 *   9. Research Engine stubs (re-)
 *   10. Responsive
 * ═══════════════════════════════════════════════════════════════
 */


/* ═══════════════════════════════════════════════════════════
   1. FILTER BAR
   Horizontal row of filter controls above each sub-tab table.
   .le-filter-bar     — outer flex container
   .le-filter-group   — label + input/select pair
   .le-filter-label   — small label above each control
   .le-select         — styled <select> dropdown
   .le-input          — styled <input type="number">
   .le-btn-apply      — apply filters button
═══════════════════════════════════════════════════════════ */
.le-filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 20px 24px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.le-filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 120px;
}

.le-filter-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.le-select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 7px 10px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
  min-width: 120px;
}

.le-select:focus,
.le-select:hover {
  border-color: var(--accent);
}

.le-input {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 7px 10px;
  outline: none;
  transition: border-color 0.2s;
  width: 100px;
}

.le-input:focus {
  border-color: var(--accent);
}

/* Apply / filter button */
.le-btn-apply {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
  white-space: nowrap;
  align-self: flex-end;
}

.le-btn-apply:hover  { opacity: 0.85; }
.le-btn-apply:active { transform: scale(0.97); }

/* Advanced filter toggle button */
.le-btn-adv-toggle {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
  align-self: flex-end;
  transition: border-color 0.2s, color 0.2s;
}
.le-btn-adv-toggle:hover,
.le-btn-adv-toggle.active {
  border-color: var(--accent);
  color: var(--accent);
}

/* Clear button */
.le-btn-clear {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-3);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
  align-self: flex-end;
  transition: border-color 0.2s, color 0.2s;
}
.le-btn-clear:hover { color: var(--danger); border-color: var(--danger); }

/* Advanced filter section */
.le-adv-section {
  width: 100%;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Each advanced filter row */
.le-adv-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.le-adv-sep {
  color: var(--text-3);
  font-size: 13px;
  flex-shrink: 0;
}

/* Remove filter row button */
.le-btn-remove-filter {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-3);
  cursor: pointer;
  font-size: 12px;
  padding: 4px 8px;
  flex-shrink: 0;
  transition: border-color 0.2s, color 0.2s;
}
.le-btn-remove-filter:hover { border-color: var(--danger); color: var(--danger); }

/* Add filter button */
.le-btn-add-filter {
  background: none;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-3);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
  align-self: flex-start;
  transition: border-color 0.2s, color 0.2s;
}
.le-btn-add-filter:hover { border-color: var(--accent); color: var(--accent); }

/* Sortable column header */
.le-th-sort { cursor: pointer; user-select: none; }
.le-th-sort:hover { color: var(--accent); }
.le-th-active { color: var(--accent) !important; }
/* ═══════════════════════════════════════════════════════════
   2. RESULTS SUMMARY
   Small line above the table: "1,234 listings found"
═══════════════════════════════════════════════════════════ */
.le-results-summary {
  padding: 10px 24px;
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--font-display);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}


/* ═══════════════════════════════════════════════════════════
   3. TABLE
   Full-width data table used in Top, New, Converting tabs.
   .le-table-wrap — horizontal scroll wrapper (mobile safe)
   .le-table      — the <table> element itself
   .le-empty      — colspan cell shown when no results
═══════════════════════════════════════════════════════════ */
.le-table-wrap {
  overflow-x: auto;
  background: var(--surface);
  padding: 0 24px 24px;
}

.le-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 800px; /* forces scroll on narrow screens */
}

.le-table thead tr {
  border-bottom: 1px solid var(--border);
}

.le-table th {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap;
}

.le-table td {
  padding: 10px 12px;
  color: var(--text-2);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

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

/* Empty state cell */
.le-empty {
  text-align: center;
  color: var(--text-3);
  padding: 40px 12px !important;
  font-style: italic;
}


/* ═══════════════════════════════════════════════════════════
   4. LISTING ROW
   Individual row elements inside .le-table tbody.
   .le-row           — the <tr> itself
   .le-rank          — rank number column (#1, #2...)
   .le-listing-cell  — thumbnail + title column
   .le-listing-info  — flex wrapper for thumb + title
   .le-thumb         — listing image thumbnail
   .le-thumb-placeholder — fallback when no image
   .le-title         — listing title text
   .le-highlight     — accent-colored value (sales, conv rate)
   .le-price         — price cell
   .le-shop-link     — clickable shop name → Shop DNA
   .le-btn-detail    — 🔬 detail button
   .le-actions       — action buttons cell
═══════════════════════════════════════════════════════════ */

/* Row hover state */
.le-row {
  transition: background 0.15s;
  cursor: pointer;
}
.le-row:hover {
  background: var(--surface-2);
}

/* Rank number */
.le-rank {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-3);
  font-size: 12px;
  width: 32px;
  text-align: center;
}

/* Thumbnail + title flex wrapper */
.le-listing-cell {
  min-width: 240px;
  max-width: 320px;
}

.le-listing-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Listing image thumbnail */
.le-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-2);
}

/* Fallback placeholder when no image */
.le-thumb-placeholder {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

/* Large thumb for detail view */
.le-thumb-lg {
  width: 200px;
  height: 200px;
  font-size: 48px;
  border-radius: var(--radius-md);
}

/* Listing title — truncate long titles */
.le-title {
  color: var(--text-1);
  font-size: 13px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Accent colored cells — sales, conversion rate */
.le-highlight {
  color: var(--accent);
  font-weight: 600;
  font-family: var(--font-display);
}

/* Price cell */
.le-price {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--text-1);
  white-space: nowrap;
}

/* Date cell */
.le-date {
  white-space: nowrap;
  color: var(--text-3);
  font-size: 12px;
}

/* Clickable shop name */
.le-shop-link {
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
  text-decoration: none;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.le-shop-link:hover { opacity: 0.75; text-decoration: underline; }

/* Detail button 🔬 */
.le-btn-detail {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
  transition: border-color 0.2s, color 0.2s;
}
.le-btn-detail:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Actions column */
.le-actions {
  width: 40px;
  text-align: center;
}


/* ═══════════════════════════════════════════════════════════
   5. PAGINATION
   Row of page buttons below each table.
   .le-pagination — flex container
   .le-page-btn   — individual page button
   .le-page-btn.active — current page (accent background)
═══════════════════════════════════════════════════════════ */
.le-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 20px 24px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.le-page-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
}

.le-page-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.le-page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  cursor: default;
}


/* ═══════════════════════════════════════════════════════════
   6. DETAIL VIEW
   Full listing DNA page shown in the Detail sub-tab.
   .le-detail-back      — back button row
   .le-btn-back         — ← Back button
   .le-detail-hero      — image + meta flex row
   .le-detail-image     — left image column
   .le-detail-meta      — right meta column
   .le-detail-title     — listing title (large)
   .le-detail-price     — price (large)
   .le-detail-metrics   — row of metric cards
   .le-metric-card      — individual metric (value + label)
   .le-metric-val       — the number
   .le-metric-label     — the label below
   .le-detail-section   — titled section block
   .le-detail-section-title — section heading
   .le-detail-empty     — shown when no listing selected
   .le-history-table    — monthly history table
   .le-tags-wrap        — flex wrap of tag pills
   .le-tag              — individual tag pill
   .le-kw-link          — "Research in Keyword tab" link
   .le-detail-shop      — shop name + DNA button row
   .le-btn-shop-dna     — → View Shop DNA button
═══════════════════════════════════════════════════════════ */

/* Back button row */
.le-detail-back {
  padding: 16px 24px 0;
  background: var(--surface);
}

.le-btn-back {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.le-btn-back:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Hero section — image + meta side by side */
.le-detail-hero {
  display: flex;
  gap: 28px;
  padding: 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.le-detail-image {
  flex-shrink: 0;
}

.le-detail-image img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.le-detail-meta {
  flex: 1;
  min-width: 260px;
}

.le-detail-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.4;
  margin-bottom: 8px;
}

.le-detail-price {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--success);
  margin-bottom: 20px;
}

/* Metric cards row */
.le-detail-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.le-metric-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  min-width: 90px;
  text-align: center;
}

.le-metric-val {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.2;
}

.le-metric-label {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Section blocks below hero */
.le-detail-section {
  padding: 20px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.le-detail-section-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Empty detail state */
.le-detail-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  gap: 12px;
  color: var(--text-3);
}

.le-detail-empty-icon {
  font-size: 40px;
  opacity: 0.4;
}

.le-detail-empty-text {
  font-size: 14px;
  text-align: center;
  max-width: 360px;
  line-height: 1.6;
}

/* History table — reuses .le-table but narrower */
.le-history-table {
  min-width: unset;
  max-width: 400px;
}

/* Tag pills */
.le-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.le-tag {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-2);
  font-size: 12px;
  padding: 4px 12px;
  cursor: default;
  transition: border-color 0.2s, color 0.2s;
}

.le-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Keyword tab link hint */
.le-kw-link-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-3);
  text-transform: none;
  letter-spacing: 0;
}

.le-kw-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.le-kw-link:hover { text-decoration: underline; }

/* Shop row in detail */
.le-detail-shop {
  display: flex;
  align-items: center;
  gap: 16px;
}

.le-shop-name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-1);
}

/* → View Shop DNA button */
.le-btn-shop-dna {
  background: none;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.le-btn-shop-dna:hover {
  background: var(--accent);
  color: #fff;
}


/* ═══════════════════════════════════════════════════════════
   7. LEADERBOARD
   Custom card list used in the Leaderboard sub-tab.
   .le-leaderboard-wrap — outer container
   .le-lb-row           — single leaderboard entry card
   .le-lb-top3          — gold/silver/bronze highlight
   .le-lb-rank          — rank medal or number
   .le-lb-thumb         — small listing image
   .le-lb-info          — title + shop name
   .le-lb-title         — listing title
   .le-lb-shop          — shop name below title
   .le-lb-stats         — stat values row
   .le-lb-stat          — individual stat (value + label)
   .le-lb-stat-val      — the number
   .le-lb-stat-label    — the label
═══════════════════════════════════════════════════════════ */
.le-leaderboard-wrap {
  padding: 16px 24px 24px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.le-lb-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  transition: border-color 0.2s, background 0.15s;
  cursor: pointer;
}

.le-lb-row:hover {
  border-color: var(--accent);
  background: var(--surface);
}

/* Top 3 rows get accent border */
.le-lb-top3 {
  border-color: var(--accent-dim);
  background: rgba(79, 142, 247, 0.04);
}

/* Rank medal */
.le-lb-rank {
  font-size: 20px;
  width: 32px;
  text-align: center;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-3);
}

/* Leaderboard thumbnail */
.le-lb-thumb {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface);
}

/* Info block — title + shop */
.le-lb-info {
  flex: 1;
  min-width: 0;
}

.le-lb-title {
  font-size: 13px;
  color: var(--text-1);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.le-lb-shop {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
}

/* Stats block */
.le-lb-stats {
  display: flex;
  gap: 20px;
  flex-shrink: 0;
}

.le-lb-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.le-lb-stat-val {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-1);
}

.le-lb-stat-label {
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}


/* ═══════════════════════════════════════════════════════════
   8. LOADING & ERROR STATES
   Shown while API fetches are in progress or on failure.
   .le-loading      — centered loading spinner + text
   .le-spinner      — animated CSS spinner ring
   .le-loading-text — message below spinner
   .le-error        — centered error icon + message + retry
   .le-error-icon   — ⚠️ icon
   .le-error-text   — error description
   .le-btn-retry    — retry button
═══════════════════════════════════════════════════════════ */

/* Loading state */
.le-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  gap: 16px;
}

/* Spinning ring animation */
.le-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: le-spin 0.7s linear infinite;
}

@keyframes le-spin {
  to { transform: rotate(360deg); }
}

.le-loading-text {
  font-size: 13px;
  color: var(--text-3);
}

/* Error state */
.le-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  gap: 12px;
}

.le-error-icon {
  font-size: 36px;
  opacity: 0.6;
}

.le-error-text {
  font-size: 13px;
  color: var(--text-3);
  text-align: center;
  max-width: 300px;
}

.le-btn-retry {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  padding: 7px 16px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  margin-top: 4px;
}
.le-btn-retry:hover {
  border-color: var(--accent);
  color: var(--accent);
}


/* ═══════════════════════════════════════════════════════════
   9. RESEARCH ENGINE STUBS (re-)
   "Coming soon" placeholder shown for Tab 3 sub-tabs
   that are not yet built (Phase 2).
   .re-coming-soon  — centered placeholder card
   .re-coming-icon  — large emoji icon
   .re-coming-title — sub-tab name
   .re-coming-text  — description of what's coming
═══════════════════════════════════════════════════════════ */
.re-coming-soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  gap: 14px;
  text-align: center;
}

.re-coming-icon {
  font-size: 48px;
  opacity: 0.35;
}

.re-coming-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-2);
}

.re-coming-text {
  font-size: 13px;
  color: var(--text-3);
  max-width: 380px;
  line-height: 1.7;
}


/* ═══════════════════════════════════════════════════════════
   10. RESPONSIVE
   Mobile adjustments for screens under 768px.
   - Filter bar stacks vertically
   - Table scrolls horizontally (already handled by le-table-wrap)
   - Leaderboard stats collapse
   - Detail hero stacks vertically
═══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Filter bar stacks on mobile */
  .le-filter-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    gap: 10px;
  }

  .le-filter-group {
    width: 100%;
  }

  .le-select,
  .le-input {
    width: 100%;
  }

  .le-btn-apply {
    width: 100%;
    text-align: center;
  }

  /* Detail hero stacks on mobile */
  .le-detail-hero {
    flex-direction: column;
    padding: 16px;
  }

  .le-detail-image img {
    width: 100%;
    height: 200px;
  }

  /* Leaderboard hides stats on very small screens */
  .le-lb-stats {
    display: none;
  }

  /* Metric cards wrap tighter */
  .le-metric-card {
    min-width: 80px;
    padding: 8px 10px;
  }

  .le-metric-val {
    font-size: 14px;
  }

  /* Leaderboard row padding reduced */
  .le-lb-row {
    padding: 10px 12px;
    gap: 10px;
  }

  /* Summary text padding */
  .le-results-summary {
    padding: 8px 16px;
  }

  /* Table wrap padding */
  .le-table-wrap {
    padding: 0 16px 16px;
  }

  /* Pagination smaller */
  .le-page-btn {
    padding: 5px 9px;
    font-size: 11px;
  }
}



/* ═══════════════════════════════════════════════════════════
   RESEARCH ENGINE — Tab 3 Shops styles (re- prefix)
   Mirrors le- pattern but scoped to research engine elements.
═══════════════════════════════════════════════════════════ */

/* Filter bar */
.re-filter-bar {
  display: flex; align-items: flex-end; gap: 12px;
  flex-wrap: wrap; padding: 20px 24px 16px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.re-filter-group { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.re-filter-label {
  font-family: var(--font-display); font-size: 11px; font-weight: 600;
  color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em;
}
.re-select {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-1);
  font-family: var(--font-body); font-size: 13px; padding: 7px 10px;
  cursor: pointer; outline: none; transition: border-color 0.2s;
}
.re-select:focus, .re-select:hover { border-color: var(--accent); }
.re-input {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-1);
  font-family: var(--font-body); font-size: 13px;
  padding: 7px 10px; outline: none; width: 100px;
  transition: border-color 0.2s;
}
.re-input:focus { border-color: var(--accent); }
.re-btn-apply {
  background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius-sm); font-family: var(--font-display);
  font-size: 13px; font-weight: 600; padding: 8px 18px;
  cursor: pointer; transition: opacity 0.2s; white-space: nowrap;
}
.re-btn-apply:hover { opacity: 0.85; }

/* Results summary */
.re-results-summary {
  padding: 10px 24px; font-size: 12px; color: var(--text-3);
  font-family: var(--font-display); border-bottom: 1px solid var(--border);
  background: var(--surface);
}

/* Shop cards list */
.re-shops-list {
  padding: 16px 24px; background: var(--surface);
  display: flex; flex-direction: column; gap: 8px;
}

.re-shop-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px 16px;
  cursor: pointer; transition: border-color 0.2s, background 0.15s;
}
.re-shop-card:hover { border-color: var(--accent); background: var(--surface); }

.re-shop-rank {
  font-family: var(--font-display); font-weight: 700;
  color: var(--text-3); font-size: 13px; width: 32px;
  text-align: center; flex-shrink: 0;
}

.re-shop-info { flex: 1; min-width: 0; }
.re-shop-name {
  font-family: var(--font-display); font-size: 15px;
  font-weight: 600; color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.re-shop-tier { font-size: 11px; color: var(--text-3); margin-top: 3px; }

.re-shop-stats { display: flex; gap: 20px; flex-shrink: 0; }
.re-shop-stat { display: flex; flex-direction: column; align-items: flex-end; }
.re-shop-stat-val {
  font-family: var(--font-display); font-size: 14px;
  font-weight: 700; color: var(--text-1);
}
.re-shop-stat-label { font-size: 10px; color: var(--text-3); text-transform: uppercase; }

.re-btn-dna {
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-2);
  font-family: var(--font-display); font-size: 12px; font-weight: 600;
  padding: 6px 12px; cursor: pointer; flex-shrink: 0;
  transition: border-color 0.2s, color 0.2s;
}
.re-btn-dna:hover { border-color: var(--accent); color: var(--accent); }

/* Pagination */
.re-pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 20px 24px; background: var(--surface);
  border-top: 1px solid var(--border); flex-wrap: wrap;
}
.re-page-btn {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-2);
  font-family: var(--font-display); font-size: 12px; font-weight: 600;
  padding: 6px 12px; cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.re-page-btn:hover { border-color: var(--accent); color: var(--accent); }
.re-page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* Empty state */
.re-empty {
  text-align: center; color: var(--text-3);
  padding: 40px 12px; font-style: italic; font-size: 13px;
}

/* DNA view */
.re-dna-back { padding: 16px 24px 0; background: var(--surface); }
.re-btn-back {
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-2);
  font-family: var(--font-display); font-size: 12px; font-weight: 600;
  padding: 6px 14px; cursor: pointer; transition: border-color 0.2s, color 0.2s;
}
.re-btn-back:hover { border-color: var(--accent); color: var(--accent); }

.re-dna-hero {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 24px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.re-dna-shop-icon { font-size: 36px; }
.re-dna-title {
  font-family: var(--font-display); font-size: 20px;
  font-weight: 700; color: var(--text-1);
}
.re-dna-sub { font-size: 12px; color: var(--text-3); margin-top: 4px; }

.re-dna-metrics {
  display: flex; flex-wrap: wrap; gap: 12px;
  padding: 20px 24px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.re-metric-card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 16px;
  min-width: 90px; text-align: center;
}
.re-metric-val {
  font-family: var(--font-display); font-size: 16px;
  font-weight: 700; color: var(--text-1);
}
.re-metric-label { font-size: 11px; color: var(--text-3); margin-top: 3px; text-transform: uppercase; }

.re-dna-section { padding: 20px 24px; background: var(--surface); border-bottom: 1px solid var(--border); }
.re-dna-section-title {
  font-family: var(--font-display); font-size: 13px; font-weight: 700;
  color: var(--text-2); text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 14px; display: flex; align-items: center; gap: 12px;
}
.re-dna-section-hint { font-size: 11px; font-weight: 400; color: var(--text-3); text-transform: none; }
.re-listings-link { color: var(--accent); text-decoration: none; font-weight: 600; }
.re-listings-link:hover { text-decoration: underline; }

/* Table */
.re-table-wrap { overflow-x: auto; }
.re-table {
  width: 100%; border-collapse: collapse; font-size: 13px; min-width: 600px;
}
.re-table th {
  font-family: var(--font-display); font-size: 11px; font-weight: 600;
  color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em;
  padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border);
}
.re-table td { padding: 10px 12px; color: var(--text-2); border-bottom: 1px solid var(--border); vertical-align: middle; }
.re-table tbody tr:last-child td { border-bottom: none; }
.re-table tbody tr:hover { background: var(--surface-2); }

/* Listing cells in DNA table */
.re-listing-cell { min-width: 200px; max-width: 300px; }
.re-listing-info { display: flex; align-items: center; gap: 10px; }
.re-thumb { width: 36px; height: 36px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; }
.re-thumb-placeholder {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: var(--surface-2); display: flex; align-items: center;
  justify-content: center; font-size: 16px; flex-shrink: 0;
}
.re-listing-title {
  font-size: 12px; color: var(--text-1); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.re-rank { font-family: var(--font-display); font-weight: 700; color: var(--text-3); font-size: 12px; width: 28px; }

/* Color helpers */
.re-accent   { color: var(--accent); font-weight: 600; }
.re-positive { color: var(--success); font-weight: 600; }
.re-negative { color: var(--danger);  font-weight: 600; }



/* ═══════════════════════════════════════════════════════════
   DISCOVER SUB-TAB STYLES
═══════════════════════════════════════════════════════════ */

/* Stats banner — horizontal row of key metrics */
.re-stats-banner {
  display: flex; flex-wrap: wrap; gap: 0;
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 0;
}
.re-stat-pill {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 16px 24px; flex: 1;
  border-right: 1px solid var(--border); min-width: 120px;
  text-align: center;
}
.re-stat-pill:last-child { border-right: none; }
.re-stat-pill-val {
  font-family: var(--font-display); font-size: 20px;
  font-weight: 700; color: var(--text-1); line-height: 1.2;
}
.re-stat-pill-label {
  font-size: 11px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.04em; margin-top: 4px;
}

/* Discover sections */
.re-discover-section {
  padding: 24px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.re-discover-section-title {
  font-family: var(--font-display); font-size: 14px; font-weight: 700;
  color: var(--text-1); margin-bottom: 16px;
}

/* Category temperature grid */
.re-category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.re-category-card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px;
  cursor: pointer; transition: border-color 0.2s, transform 0.15s;
}
.re-category-card:hover { transform: translateY(-2px); }

/* Temperature color variants */
.re-temp-hot      { border-left: 3px solid #ff6b35; }
.re-temp-growing  { border-left: 3px solid var(--success); }
.re-temp-stable   { border-left: 3px solid var(--accent); }
.re-temp-declining{ border-left: 3px solid var(--text-3); }

.re-category-temp {
  display: flex; align-items: center; gap: 6px; margin-bottom: 8px;
}
.re-temp-label {
  font-family: var(--font-display); font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3);
}
.re-category-name {
  font-family: var(--font-display); font-size: 14px; font-weight: 600;
  color: var(--text-1); margin-bottom: 12px; line-height: 1.3;
}
.re-category-stats {
  display: flex; gap: 12px; flex-wrap: wrap;
}
.re-category-stat { display: flex; flex-direction: column; }
.re-category-stat-val {
  font-family: var(--font-display); font-size: 13px; font-weight: 700;
  color: var(--text-1);
}
.re-category-stat-label { font-size: 10px; color: var(--text-3); text-transform: uppercase; }

/* Trending list */
.re-trending-list {
  display: flex; flex-direction: column; gap: 8px;
}
.re-trending-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px;
  cursor: pointer; transition: border-color 0.2s;
}
.re-trending-item:hover { border-color: var(--accent); }
.re-trending-rank {
  font-family: var(--font-display); font-weight: 700;
  color: var(--text-3); font-size: 13px; width: 28px;
}
.re-trending-name {
  flex: 1; font-size: 13px; font-weight: 500; color: var(--text-1);
}
.re-trending-count { font-size: 12px; color: var(--text-3); }

/* Success stories grid */
.re-stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.re-story-card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px;
  cursor: pointer; transition: border-color 0.2s, transform 0.15s;
  display: flex; flex-direction: column; gap: 10px;
}
.re-story-card:hover {
  border-color: var(--accent); transform: translateY(-2px);
}
.re-story-badge {
  display: inline-block; background: var(--accent-dim);
  color: var(--accent); border-radius: 20px;
  font-size: 11px; font-weight: 700; padding: 2px 10px;
  font-family: var(--font-display); width: fit-content;
}
.re-story-name {
  font-family: var(--font-display); font-size: 14px;
  font-weight: 600; color: var(--text-1); line-height: 1.3;
}
.re-story-stats { display: flex; gap: 12px; }
.re-story-stat { display: flex; flex-direction: column; }
.re-story-stat-val {
  font-family: var(--font-display); font-size: 14px; font-weight: 700;
}
.re-story-stat-label { font-size: 10px; color: var(--text-3); text-transform: uppercase; }
.re-story-dna-btn {
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-2);
  font-family: var(--font-display); font-size: 11px; font-weight: 600;
  padding: 5px 10px; cursor: pointer; margin-top: auto;
  transition: border-color 0.2s, color 0.2s; text-align: center;
}
.re-story-dna-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Responsive */
@media (max-width: 768px) {
  .re-stats-banner { flex-direction: column; }
  .re-stat-pill { border-right: none; border-bottom: 1px solid var(--border); }
  .re-category-grid { grid-template-columns: 1fr 1fr; }
  .re-stories-grid  { grid-template-columns: 1fr 1fr; }
  .re-shop-stats    { display: none; }
}


/* ═══════════════════════════════════════════════════════════
   MARKETS SUB-TAB STYLES
═══════════════════════════════════════════════════════════ */

/* Category browser grid */
.re-markets-grid {
  padding: 16px 24px 24px;
  background: var(--surface);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.re-market-card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px;
  cursor: pointer; transition: border-color 0.2s, transform 0.15s;
  display: flex; flex-direction: column; gap: 10px;
}
.re-market-card:hover {
  border-color: var(--accent); transform: translateY(-2px);
}

.re-market-rank {
  font-family: var(--font-display); font-size: 11px;
  font-weight: 700; color: var(--text-3);
}

.re-market-name {
  font-family: var(--font-display); font-size: 14px;
  font-weight: 600; color: var(--text-1); line-height: 1.3;
}

.re-market-stats {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.re-market-stat { display: flex; flex-direction: column; }
.re-market-stat-val {
  font-family: var(--font-display); font-size: 13px;
  font-weight: 700; color: var(--text-1);
}
.re-market-stat-label {
  font-size: 10px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.04em;
}

.re-btn-niche {
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-2);
  font-family: var(--font-display); font-size: 11px; font-weight: 600;
  padding: 5px 10px; cursor: pointer; margin-top: auto;
  transition: border-color 0.2s, color 0.2s; text-align: center;
}
.re-btn-niche:hover { border-color: var(--accent); color: var(--accent); }

/* Niche report */
.re-niche-hero {
  padding: 20px 24px; background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.re-niche-title {
  font-family: var(--font-display); font-size: 22px;
  font-weight: 700; color: var(--text-1);
}

/* Price distribution */
.re-price-dist {
  display: flex; flex-direction: column; gap: 12px;
}
.re-price-bucket { display: flex; flex-direction: column; gap: 4px; }
.re-price-label {
  font-family: var(--font-display); font-size: 12px;
  font-weight: 600; color: var(--text-2);
}
.re-price-bar-wrap {
  background: var(--surface-2); border-radius: 4px;
  height: 8px; overflow: hidden;
}
.re-price-bar {
  height: 100%; background: var(--accent);
  border-radius: 4px; transition: width 0.4s ease;
  min-width: 2px;
}
.re-price-stats { font-size: 12px; color: var(--text-3); }

/* Tags */
.re-tags-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.re-tag-pill {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 20px; color: var(--text-2); font-size: 12px;
  padding: 4px 12px; display: flex; align-items: center; gap: 6px;
  transition: border-color 0.2s, color 0.2s; cursor: default;
}
.re-tag-pill:hover { border-color: var(--accent); color: var(--accent); }
.re-tag-count {
  background: var(--border); border-radius: 10px;
  font-size: 10px; font-weight: 700; padding: 1px 6px;
  color: var(--text-3);
}

/* Shop link in tables */
.re-shop-link-small {
  color: var(--accent); cursor: pointer; font-size: 12px;
  transition: opacity 0.2s;
}
.re-shop-link-small:hover { opacity: 0.75; text-decoration: underline; }

/* Responsive */
@media (max-width: 768px) {
  .re-markets-grid { grid-template-columns: 1fr; padding: 12px 16px; }
  .re-market-stats { grid-template-columns: 1fr 1fr; }
}



/* ═══════════════════════════════════════════════════════════
   OPPORTUNITIES SUB-TAB STYLES
═══════════════════════════════════════════════════════════ */

/* Hidden gems grid */
.re-gems-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.re-gem-card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  cursor: pointer; transition: border-color 0.2s, transform 0.15s;
  border-left: 3px solid var(--border);
}
.re-gem-card:hover { transform: translateY(-2px); }

/* Score color variants */
.re-score-hot  { border-left-color: #ff6b35; }
.re-score-good { border-left-color: var(--success); }
.re-score-ok   { border-left-color: var(--accent); }

.re-gem-rank {
  font-family: var(--font-display); font-size: 11px;
  font-weight: 700; color: var(--text-3);
}

.re-gem-score-wrap { display: flex; align-items: baseline; gap: 4px; }
.re-gem-score {
  font-family: var(--font-display); font-size: 28px;
  font-weight: 700; color: var(--accent);
}
.re-gem-score-label {
  font-size: 11px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.04em;
}

.re-gem-name {
  font-family: var(--font-display); font-size: 14px;
  font-weight: 600; color: var(--text-1); line-height: 1.3;
}
.re-gem-stats { font-size: 12px; color: var(--text-3); line-height: 1.6; }

/* Competition list */
.re-competition-list {
  display: flex; flex-direction: column; gap: 8px;
}
.re-comp-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 16px;
  cursor: pointer; transition: border-color 0.2s;
}
.re-comp-row:hover { border-color: var(--accent); }

.re-comp-rank {
  font-family: var(--font-display); font-weight: 700;
  color: var(--text-3); font-size: 13px; width: 28px; flex-shrink: 0;
}
.re-comp-info { flex: 1; min-width: 0; }
.re-comp-name {
  font-size: 13px; font-weight: 500; color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.re-comp-stats { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* Competition level badges */
.re-comp-level {
  font-family: var(--font-display); font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: 20px; flex-shrink: 0;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.re-comp-easy  { background: rgba(34,197,94,0.15);  color: var(--success); }
.re-comp-medium{ background: rgba(79,142,247,0.15); color: var(--accent); }
.re-comp-hard  { background: rgba(251,191,36,0.15); color: #fbbf24; }
.re-comp-vhard { background: rgba(239,68,68,0.15);  color: var(--danger); }

/* Revenue calculator */
.re-calculator { padding: 4px 0; }
.re-calc-inputs {
  display: flex; flex-wrap: wrap; align-items: flex-end;
  gap: 12px; margin-bottom: 20px;
}

.re-calc-results { margin-top: 8px; }
.re-calc-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px; margin-bottom: 14px;
}
.re-calc-result-card {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px; text-align: center;
}
.re-calc-result-val {
  font-family: var(--font-display); font-size: 20px;
  font-weight: 700; color: var(--text-1); margin-bottom: 4px;
}
.re-calc-result-label {
  font-size: 11px; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.re-calc-note {
  font-size: 12px; color: var(--text-3);
  line-height: 1.6; padding: 10px 0;
  border-top: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 768px) {
  .re-gems-grid { grid-template-columns: 1fr; }
  .re-comp-stats { display: none; }
  .re-calc-result-grid { grid-template-columns: 1fr 1fr; }
}



/* ═══════════════════════════════════════════════════════════
   TAGS ENGINE STYLES — te- prefix
   All Tag Intelligence UI components.
   Used by: tags_engine.js in Tab 3 Tags sub-tab
            and injected sections in other sub-tabs.
═══════════════════════════════════════════════════════════ */

/* Section wrapper */
.te-section {
  padding: 0 0 24px;
}

.te-inject-section {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.te-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 20px 24px 12px;
}

.te-inject-section .te-section-header {
  padding: 0 0 12px;
}

.te-section-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-1);
}

.te-section-meta {
  font-size: 12px;
  color: var(--text-3);
}

/* Filter row inside section header */
.te-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3);
}

.te-filter-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Tag cloud */
.te-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 24px 16px;
}

.te-cloud-tag {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-2);
  padding: 5px 14px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, transform 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  line-height: 1;
}

.te-cloud-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.te-cloud-count {
  background: var(--border);
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  color: var(--text-3);
}

/* Co-occurrence panel */
.te-cooccur-panel {
  margin: 0 24px 16px;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 14px 18px;
}

.te-cooccur-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.te-cooccur-title {
  font-size: 13px;
  color: var(--text-2);
}

.te-cooccur-title strong {
  color: var(--accent);
}

.te-cooccur-close {
  background: none;
  border: none;
  color: var(--text-3);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  transition: color 0.2s;
}

.te-cooccur-close:hover { color: var(--text-1); }

.te-cooccur-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Tag link button in table */
.te-tag-link {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 13px;
  font-family: var(--font-body);
  padding: 0;
  text-align: left;
  transition: opacity 0.2s;
}

.te-tag-link:hover { opacity: 0.75; text-decoration: underline; }

/* Competition badges */
.te-comp-badge {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-align: center;
  display: inline-block;
}

.te-comp-low     { background: rgba(45,202,114,0.15); color: var(--success); }
.te-comp-medium  { background: rgba(79,142,247,0.15); color: var(--accent); }
.te-comp-high    { background: rgba(251,191,36,0.15); color: #fbbf24; }
.te-comp-vhigh   { background: rgba(247,79,79,0.15);  color: var(--danger); }
.te-comp-unknown { background: var(--surface-2); color: var(--text-3); }

/* Tags wrap (used in Rising and co-occurrence) */
.te-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 0 8px;
}

/* Inline loading / empty / error */
.te-loading-inline,
.te-empty-inline {
  font-size: 13px;
  color: var(--text-3);
  padding: 8px 0;
}

/* Strategy grid */
.te-strategy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  padding: 4px 0 16px;
}

.te-tier-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.te-tier-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.te-tier-hint {
  font-size: 11px;
  color: var(--text-3);
  line-height: 1.5;
}

.te-tier-tags {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.te-strategy-tag {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.te-strat-pill {
  display: inline-block;
  border: 1px solid;
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 13px;
  font-weight: 500;
  width: fit-content;
}

.te-strat-meta {
  font-size: 11px;
  color: var(--text-3);
  padding-left: 4px;
}

.te-strategy-note {
  font-size: 12px;
  color: var(--text-3);
  padding: 8px 0 4px;
  border-top: 1px solid var(--border);
}

/* Responsive */
@media (max-width: 768px) {
  .te-strategy-grid { grid-template-columns: 1fr; }
  .te-tag-cloud { padding: 4px 16px 12px; }
  .te-section-header { padding: 16px 16px 10px; }
  .te-inject-section { padding: 16px; }
}


/* ── Compact filter bar ─────────────────────────────────── */
.le-filter-bar-compact {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 14px;
}

.le-fg-compact {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.le-fg-compact .le-filter-label {
  font-size: 10px;
  white-space: nowrap;
}

.le-compact-cat  { width: 110px; }
.le-compact-field{ width: 100px; }
.le-compact-op   { width: 76px;  }
.le-compact-inp  { width: 72px;  }

.le-hidden { display: none !important; }

@media (max-width: 768px) {
  .le-filter-bar-compact { gap: 6px; padding: 8px 10px; }
  .le-compact-cat  { width: 100%; }
  .le-compact-inp  { width: 80px; }
  .le-compact-field{ width: 90px; }
  .le-compact-op   { width: 68px; }
}

/* ── Custom category dropdown ───────────────────────────── */
.le-cat-wrap {
  position: relative;
}

.le-cat-trigger {
  width: 150px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-family: var(--font-display);
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: border-color 0.2s;
}
.le-cat-trigger:hover { border-color: var(--accent); }

.le-cat-arrow {
  font-size: 10px;
  color: var(--text-3);
  flex-shrink: 0;
}

.le-cat-panel {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  width: 220px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  z-index: 999;
  flex-direction: column;
}
.le-cat-panel.le-cat-open { display: flex; }

.le-cat-search {
  width: 100%;
  padding: 8px 10px;
  background: var(--surface-1);
  border: none;
  border-bottom: 1px solid var(--border);
  color: var(--text-1);
  font-size: 13px;
  outline: none;
  box-sizing: border-box;
}
.le-cat-search::placeholder { color: var(--text-3); }

.le-cat-list {
  max-height: 280px;
  overflow-y: auto;
  padding: 4px 0;
}

.le-cat-option {
  padding: 7px 12px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.le-cat-option:hover  { background: var(--surface-3); color: var(--text-1); }
.le-cat-active {
  background: var(--accent-muted, rgba(99,102,241,0.15));
  color: var(--accent);
  font-weight: 600;
}

/* Scrollbar inside list */
.le-cat-list::-webkit-scrollbar       { width: 4px; }
.le-cat-list::-webkit-scrollbar-track { background: transparent; }
.le-cat-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

@media (max-width: 768px) {
  .le-cat-trigger { width: 100%; }
  .le-cat-panel   { width: 100%; }
}
