/* ===== RESET & TOKENS ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #07070a;
  --bg-panel: #0d0d14;
  --bg-card: #111119;
  --bg-card-hover: #16161f;
  --bg-elevated: #1a1a24;
  --bg-surface: #0a0a10;
  --border: #1e1e2e;
  --border-subtle: #161622;
  --border-active: #00e5bf;
  --text: #e8e8ee;
  --text-secondary: #a0a0b0;
  --text-muted: #6a6a7e;
  --text-faint: #3d3d52;

  /* Compare identity — teal/cyan */
  --accent: #00e5bf;
  --accent-dim: #00b896;
  --accent-glow: rgba(0, 229, 191, 0.15);
  --accent-ghost: rgba(0, 229, 191, 0.06);

  /* Semantic */
  --green: #22d46a;
  --green-ghost: rgba(34, 212, 106, 0.1);
  --red: #dc5050;
  --red-ghost: rgba(220, 80, 80, 0.1);
  --gold: #e8b84b;
  --gold-ghost: rgba(232, 184, 75, 0.1);
  --gold-deep: #c9961e;
  --blue: #4a8aff;
  --blue-ghost: rgba(74, 138, 255, 0.1);
  --purple: #a374ff;
  --purple-ghost: rgba(163, 116, 255, 0.1);

  --radius: 8px;
  --radius-sm: 5px;
  --radius-lg: 12px;
  --transition: 150ms cubic-bezier(0.16, 1, 0.3, 1);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'SF Mono', monospace;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

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

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: #fff; }

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

/* ===== HEADER ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(7, 7, 10, 0.88);
  backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid var(--border-subtle);
  padding: 10px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.02em;
}
.logo-accent { color: var(--accent); }
.logo-sub {
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 2px;
}

.header-actions { display: flex; align-items: center; gap: 16px; }
.header-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}
.header-link:hover { color: var(--accent); border-color: var(--accent); }

/* ===== HERO ===== */
.hero {
  padding: 40px 0 24px;
  text-align: center;
  background: linear-gradient(180deg, rgba(0, 229, 191, 0.03) 0%, transparent 100%);
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.035em;
  color: var(--text);
  margin-bottom: 10px;
}

.hero-accent {
  background: linear-gradient(135deg, var(--accent), #00f5d4);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.6;
}

.hero-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  margin-top: 20px;
}

.hero-stat { text-align: center; }
.hero-stat-value {
  display: block;
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.hero-stat-label {
  font-size: 10px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.hero-stat-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
}

/* ===== FEATURED FIRM ===== */
.featured-section {
  padding: 0 0 20px;
}

.featured-card {
  background: linear-gradient(135deg, rgba(232, 184, 75, 0.06) 0%, rgba(232, 184, 75, 0.02) 100%);
  border: 1px solid rgba(232, 184, 75, 0.2);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  position: relative;
  cursor: pointer;
  transition: all var(--transition);
  overflow: hidden;
}
.featured-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--gold), #f0d060, var(--gold));
}
.featured-card:hover {
  border-color: rgba(232, 184, 75, 0.35);
  background: linear-gradient(135deg, rgba(232, 184, 75, 0.08) 0%, rgba(232, 184, 75, 0.03) 100%);
}

.featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
  margin-bottom: 12px;
}

.featured-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.featured-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.featured-logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  background: rgba(232, 184, 75, 0.12);
  border: 1px solid rgba(232, 184, 75, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 800;
  font-size: 16px;
  color: var(--gold);
  flex-shrink: 0;
}

.featured-info { min-width: 0; }
.featured-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}
.featured-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.featured-rating { color: var(--gold); font-weight: 600; }
.featured-reviews { color: var(--text-faint); font-size: 10px; }
.featured-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 420px;
}

.featured-right {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}

.featured-stats-row {
  display: flex;
  gap: 16px;
}
.featured-stat { text-align: center; }
.featured-stat-val {
  display: block;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
}
.featured-stat-lbl {
  display: block;
  font-size: 9px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.featured-cta-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.featured-code {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  background: rgba(232, 184, 75, 0.12);
  border: 1px solid rgba(232, 184, 75, 0.25);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}
.featured-code:hover { background: rgba(232, 184, 75, 0.2); }

.featured-details-btn {
  font-size: 12px;
  font-weight: 700;
  color: var(--bg);
  background: linear-gradient(135deg, var(--gold), #f0d060);
  border: none;
  padding: 7px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}
.featured-details-btn:hover { filter: brightness(1.1); }

/* ===== TABS ===== */
.tabs-section {
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg);
}

.tabs-bar {
  display: flex;
  gap: 0;
}

.tab {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  position: relative;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ===== FILTERS ===== */
.filters-section {
  padding: 14px 0;
  position: sticky;
  top: 49px;
  z-index: 90;
  background: rgba(7, 7, 10, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.filters-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-group {
  position: relative;
}

.search-group {
  flex: 1;
  min-width: 180px;
  max-width: 260px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
}

.filter-input {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 10px 7px 32px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: var(--font);
  transition: border-color var(--transition);
  width: 100%;
}

.filter-select {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 7px 28px 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: var(--font);
  transition: border-color var(--transition);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236a6a7e' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  cursor: pointer;
  white-space: nowrap;
}

.filter-input:focus, .filter-select:focus {
  outline: none;
  border-color: var(--accent);
}

.filter-select:not([value="all"]) { color: var(--text); }

.filter-reset {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.filter-reset:hover { color: var(--accent); border-color: var(--accent); }

.filter-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  min-height: 22px;
}

.active-filters { display: flex; gap: 5px; flex-wrap: wrap; }

.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-ghost);
  border: 1px solid rgba(0, 229, 191, 0.12);
  padding: 2px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--transition);
}
.filter-tag:hover { background: var(--accent-glow); }
.filter-tag .tag-x { font-size: 12px; opacity: 0.6; }

.results-count {
  font-size: 11px;
  color: var(--text-faint);
  font-family: var(--mono);
}

/* ===== VIEW TOGGLE ===== */
.view-toggle {
  display: flex;
  gap: 2px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px;
  margin-bottom: 16px;
  width: fit-content;
}

.view-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 3px;
  cursor: pointer;
  transition: all var(--transition);
}
.view-btn:hover { color: var(--text); }
.view-btn.active { background: var(--bg-elevated); color: var(--accent); }

/* ===== TABLE VIEW — COMPACT ===== */
.firms-table-wrap { padding-bottom: 40px; }

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.firms-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  table-layout: auto;
}

.firms-table th {
  background: var(--bg-panel);
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 10px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 2;
}

/* Column widths for compact fit */
.th-rank { width: 36px; }
.th-name { width: 200px; }
.th-score { width: 60px; }
.th-split { width: 56px; }
.th-price { width: 62px; }
.th-drawdown { width: 68px; }
.th-days { width: 48px; }
.th-rating { width: 100px; }
.th-code { width: 80px; }
.th-action { width: 64px; }

.firms-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
}

.firms-table tbody tr {
  transition: background var(--transition);
  cursor: pointer;
}
.firms-table tbody tr:hover { background: var(--bg-card-hover); }
.firms-table tbody tr.top-pick { background: rgba(0, 229, 191, 0.03); }
.firms-table tbody tr.top-pick:hover { background: rgba(0, 229, 191, 0.06); }
.firms-table tbody tr.featured-row { background: rgba(232, 184, 75, 0.04); }
.firms-table tbody tr.featured-row:hover { background: rgba(232, 184, 75, 0.07); }

.table-firm {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-firm-initial {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--accent-ghost);
  border: 1px solid rgba(0, 229, 191, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 10px;
  color: var(--accent);
  flex-shrink: 0;
}
.table-firm-initial.featured-initial {
  background: rgba(232, 184, 75, 0.12);
  border-color: rgba(232, 184, 75, 0.25);
  color: var(--gold);
}

.table-firm-info { min-width: 0; }
.table-firm-name {
  font-weight: 700;
  color: var(--text);
  font-size: 12px;
  display: block;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
}
.table-firm-origin {
  font-size: 10px;
  color: var(--text-faint);
  display: block;
}

.table-score {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.score-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.table-split {
  font-family: var(--mono);
  color: var(--green);
  font-weight: 600;
  font-size: 12px;
}
.table-price {
  font-family: var(--mono);
  font-weight: 600;
}
.price-current { color: var(--accent); font-size: 12px; }
.price-original {
  color: var(--text-faint);
  text-decoration: line-through;
  font-size: 10px;
  margin-left: 3px;
}

.table-drawdown {
  font-size: 11px;
}
.dd-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 3px;
  letter-spacing: 0.02em;
}
.dd-eod { background: var(--green-ghost); color: var(--green); }
.dd-static { background: var(--blue-ghost); color: var(--blue); }
.dd-trailing { background: var(--gold-ghost); color: var(--gold); }
.dd-mixed { background: var(--purple-ghost); color: var(--purple); }

.table-days {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.table-rating {
  font-size: 11px;
  white-space: nowrap;
}
.rating-inline {
  display: flex;
  align-items: center;
  gap: 3px;
}
.rating-star { color: var(--gold); font-size: 10px; }
.rating-num { font-weight: 600; font-size: 11px; }
.rating-count {
  font-size: 9px;
  color: var(--text-faint);
}

.table-code {
  display: flex;
  gap: 3px;
}
.promo-code {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 600;
  background: var(--accent-ghost);
  color: var(--accent);
  padding: 2px 5px;
  border-radius: 3px;
  border: 1px solid rgba(0, 229, 191, 0.12);
  cursor: pointer;
  transition: all var(--transition);
}
.promo-code:hover { background: var(--accent-glow); }
.promo-code.gold-code {
  background: rgba(232, 184, 75, 0.1);
  color: var(--gold);
  border-color: rgba(232, 184, 75, 0.2);
}
.promo-code.gold-code:hover { background: rgba(232, 184, 75, 0.2); }

.table-action-btn {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-ghost);
  border: 1px solid rgba(0, 229, 191, 0.15);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-family: var(--font);
}
.table-action-btn:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
}

.featured-star {
  color: var(--gold);
  font-size: 9px;
  margin-left: 3px;
}

/* ===== GRID VIEW ===== */
.firms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  padding-bottom: 40px;
}

.firm-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
}
.firm-card:hover {
  border-color: rgba(0, 229, 191, 0.2);
  background: var(--bg-card-hover);
}
.firm-card.top-pick {
  border-color: rgba(0, 229, 191, 0.15);
}
.firm-card.featured-card-grid {
  border-color: rgba(232, 184, 75, 0.2);
  background: rgba(232, 184, 75, 0.03);
}
.firm-card.featured-card-grid:hover {
  border-color: rgba(232, 184, 75, 0.35);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.card-info { flex: 1; min-width: 0; }
.card-rank {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-faint);
  font-weight: 600;
}
.card-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin-top: 1px;
}
.card-meta {
  font-size: 10px;
  color: var(--text-faint);
  margin-top: 2px;
}

.card-score-ring {
  width: 44px;
  height: 44px;
  position: relative;
  flex-shrink: 0;
}
.card-score-ring svg {
  width: 44px;
  height: 44px;
  transform: rotate(-90deg);
}
.score-ring-bg { fill: none; stroke: var(--border); stroke-width: 3; }
.score-ring-fill { fill: none; stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset 0.6s ease; }
.score-ring-value {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
}

.card-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.card-stat-value {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  display: block;
}
.card-stat-label {
  font-size: 9px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
  display: block;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.platform-chip {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--bg-elevated);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.card-promo-code {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  background: var(--accent-ghost);
  color: var(--accent);
  padding: 3px 8px;
  border-radius: 3px;
}

.card-visit {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
}

.top-badge {
  position: absolute;
  top: 0;
  right: 14px;
  background: var(--accent);
  color: var(--bg);
  font-size: 9px;
  font-weight: 800;
  padding: 3px 8px 4px;
  border-radius: 0 0 4px 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.featured-badge-grid {
  background: var(--gold);
}

/* ===== COMPARE TAB ===== */
.tab-content { display: none; padding: 24px 0; }
.tab-content.active { display: block; }

.compare-header {
  text-align: center;
  margin-bottom: 28px;
}
.compare-header h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.compare-header p {
  font-size: 13px;
  color: var(--text-muted);
}

.compare-selectors {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.compare-slot { flex: 0 1 240px; }
.compare-select {
  width: 100%;
  background: var(--bg-panel);
  border: 2px solid var(--border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--font);
  font-weight: 600;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236a6a7e' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  transition: border-color var(--transition);
}
.compare-select:focus { outline: none; border-color: var(--accent); }

.compare-vs {
  font-family: var(--mono);
  font-weight: 800;
  font-size: 14px;
  color: var(--text-faint);
  padding: 0 4px;
}

.add-firm-btn {
  background: none;
  border: 2px dashed var(--border);
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}
.add-firm-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.compare-result { margin-bottom: 40px; }

.compare-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 12px;
}

.compare-table th {
  background: var(--bg-panel);
  padding: 14px 16px;
  text-align: center;
  border-bottom: 2px solid var(--border);
  border-right: 1px solid var(--border-subtle);
}
.compare-table th:first-child { text-align: left; }
.compare-table th:last-child { border-right: none; }

.compare-firm-name {
  display: block;
  font-weight: 800;
  font-size: 14px;
  color: var(--text);
  letter-spacing: -0.01em;
}
.compare-firm-origin {
  display: block;
  font-size: 10px;
  color: var(--text-faint);
  font-weight: 400;
  margin-top: 2px;
}

.compare-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
}
.compare-table td:last-child { border-right: none; }
.compare-table td:first-child {
  background: var(--bg-panel);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  white-space: nowrap;
}
.compare-table td:not(:first-child) {
  text-align: center;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}

.compare-table .c-best {
  background: rgba(0, 229, 191, 0.04);
  color: var(--accent);
}

/* ===== BEST FOR TAB ===== */
.best-header {
  text-align: center;
  margin-bottom: 28px;
}
.best-header h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.best-header p {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 550px;
  margin: 0 auto;
}

.best-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 14px;
  padding-bottom: 40px;
}

.best-category {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.best-cat-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 10px;
}
.best-cat-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.best-cat-icon svg {
  width: 18px;
  height: 18px;
}
.best-cat-title {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.best-cat-desc {
  font-size: 11px;
  color: var(--text-muted);
}

.best-cat-list { padding: 6px 0; }
.best-cat-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  cursor: pointer;
  transition: background var(--transition);
}
.best-cat-item:hover { background: var(--bg-card-hover); }
.best-cat-rank {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-faint);
  min-width: 20px;
}
.best-cat-name {
  font-weight: 600;
  font-size: 12px;
  flex: 1;
}
.best-cat-value {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
}

.best-cat-reasoning {
  font-size: 10px;
  color: var(--text-muted);
  padding: 0 16px 8px;
  line-height: 1.5;
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
  margin-top: 2px;
}
.best-cat-reasoning strong {
  color: var(--text-secondary);
}

.best-cat-methodology {
  font-size: 10px;
  color: var(--text-faint);
  padding: 8px 16px;
  border-top: 1px solid var(--border-subtle);
  font-style: italic;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
  overflow-y: auto;
}
.modal-overlay.active { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 780px;
  width: 100%;
  position: relative;
  padding: 28px;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  transition: color var(--transition);
  line-height: 1;
}
.modal-close:hover { color: var(--text); }

.modal-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
}

.modal-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.modal-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.modal-score-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--accent-ghost);
  border: 1px solid rgba(0, 229, 191, 0.15);
  border-radius: var(--radius);
  padding: 10px 16px;
}
.modal-score-num {
  font-family: var(--mono);
  font-size: 24px;
  font-weight: 800;
}
.modal-score-label {
  font-size: 9px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.modal-stat {
  background: var(--bg-panel);
  border-radius: var(--radius-sm);
  padding: 12px;
  border: 1px solid var(--border-subtle);
}
.modal-stat-value {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}
.modal-stat-label {
  font-size: 10px;
  color: var(--text-faint);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.modal-section { margin-bottom: 18px; }
.modal-section h3 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.plan-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.plan-table th {
  background: var(--bg-panel);
  color: var(--text-faint);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 7px 8px;
  text-align: left;
}
.plan-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--border-subtle);
  font-family: var(--mono);
  font-size: 11px;
}
.plan-table .price-orig {
  text-decoration: line-through;
  color: var(--text-faint);
  margin-right: 4px;
  font-size: 10px;
}
.plan-table .price-disc { color: var(--green); font-weight: 600; }

.modal-features {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.feature-tag {
  font-size: 10px;
  font-weight: 500;
  color: var(--text);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

.modal-promo-box {
  background: var(--accent-ghost);
  border: 1px solid rgba(0, 229, 191, 0.15);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 18px;
}
.modal-promo-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.modal-promo-codes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.modal-code {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(0, 229, 191, 0.1);
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
}
.modal-code:hover { border-color: var(--accent); }

.modal-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  font-size: 13px;
  padding: 10px 24px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  font-family: var(--font);
}
.modal-cta:hover { background: #00f5d4; color: var(--bg); }

/* ===== FOOTER & METHODOLOGY ===== */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 24px 0 20px;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.methodology-section {
  width: 100%;
  max-width: 900px;
}

.methodology-toggle {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: center;
  transition: all var(--transition);
}
.methodology-toggle:hover { color: var(--accent); border-color: var(--accent); }
.methodology-toggle .chevron-icon { transition: transform 0.2s ease; }
.methodology-toggle.open .chevron-icon { transform: rotate(180deg); }

.methodology-content {
  display: none;
  padding: 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
}
.methodology-content.open { display: block; }

.methodology-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.methodology-block h4 {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}
.methodology-block p {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.6;
}
.methodology-block p strong {
  color: var(--text-secondary);
}

.footer-legal {
  font-size: 10px;
  color: var(--text-faint);
  max-width: 500px;
  text-align: center;
}
.footer-links {
  font-size: 11px;
  color: var(--text-muted);
}
.footer-links a {
  color: var(--text-muted);
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--accent); }
.footer-sep { margin: 0 6px; opacity: 0.3; }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .hero { padding: 28px 0 16px; }
  .hero h1 { font-size: 1.6rem; }
  .hero-stats { gap: 16px; }
  .hero-stat-value { font-size: 16px; }

  .featured-inner { flex-direction: column; align-items: stretch; }
  .featured-right { align-items: stretch; }
  .featured-stats-row { justify-content: space-between; }
  .featured-cta-row { justify-content: space-between; }

  .filters-bar { gap: 6px; }
  .filter-group { flex: 1; min-width: 0; }
  .search-group { min-width: 100%; max-width: none; }
  .filter-select, .filter-input { font-size: 11px; padding: 6px 8px; }
  .filter-select { padding-right: 24px; }

  .firms-grid { grid-template-columns: 1fr; }
  .card-stats { grid-template-columns: repeat(2, 1fr); }

  .compare-selectors { flex-direction: column; }
  .compare-slot { flex: 1; width: 100%; }
  .compare-vs { display: none; }

  .best-categories { grid-template-columns: 1fr; }

  .modal { padding: 20px; }
  .modal-grid { grid-template-columns: repeat(2, 1fr); }
  .modal-top { flex-direction: column; gap: 12px; }

  .tabs-bar { overflow-x: auto; }

  .methodology-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .filter-group { min-width: calc(50% - 3px); }
  .hero-sub { font-size: 12px; }
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.firm-card, .best-category {
  animation: fadeIn 0.25s ease backwards;
}
.firm-card:nth-child(2), .best-category:nth-child(2) { animation-delay: 0.03s; }
.firm-card:nth-child(3), .best-category:nth-child(3) { animation-delay: 0.06s; }
.firm-card:nth-child(4), .best-category:nth-child(4) { animation-delay: 0.08s; }
.firm-card:nth-child(5) { animation-delay: 0.1s; }
.firm-card:nth-child(6) { animation-delay: 0.12s; }

.firms-table tbody tr {
  animation: fadeIn 0.2s ease backwards;
}

.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.no-results svg { opacity: 0.2; margin-bottom: 12px; }
.no-results p { font-size: 13px; }

/* ===== MARKET SWITCHER ===== */
.market-section {
  padding: 18px 0 0;
  text-align: center;
}
.market-switcher {
  display: inline-flex;
  gap: 2px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 3px;
}
.market-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition);
}
.market-btn:hover { color: var(--text); }
.market-btn.active {
  background: var(--accent);
  color: var(--bg);
}
.market-btn svg { flex-shrink: 0; }

/* ===== LOGO IMAGES ===== */
.firm-logo,
.table-logo {
  border-radius: var(--radius-sm);
  object-fit: contain;
  background: var(--bg-elevated);
  flex-shrink: 0;
}
.firm-logo { border: 1px solid var(--border); }
.table-logo { border: 1px solid var(--border-subtle); }
.firm-logo-ph,
.table-logo-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--accent-ghost);
  border: 1px solid rgba(0, 229, 191, 0.12);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 10px;
  color: var(--accent);
  flex-shrink: 0;
}

/* ===== CODE BADGE (clickable) ===== */
.code-badge {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-ghost);
  border: 1px solid rgba(0, 229, 191, 0.15);
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.02em;
}
.code-badge:hover {
  background: var(--accent-glow);
  border-color: var(--accent);
}
.code-badge-lg {
  font-size: 13px;
  padding: 6px 14px;
}

/* ===== VISIT LINK (table & cards) ===== */
.visit-link {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
.visit-link:hover { color: #fff; }

/* ===== TABLE CELL OVERRIDES (new markup) ===== */
.table-firm-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.table-firm-cell .table-firm-name {
  font-weight: 700;
  color: var(--text);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== FIRM CARD (grid — new markup) ===== */
.firm-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.firm-card-header .firm-name {
  flex: 1;
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.firm-card-header .firm-rating {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  white-space: nowrap;
}
.firm-card-body {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.firm-card-body .firm-stat-label {
  font-size: 9px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
  margin-bottom: 2px;
}
.firm-card-body .firm-stat-value {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.firm-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

/* ===== MODAL (new markup) ===== */
.modal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.modal-header h2.modal-firm-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  flex: 1;
}
.modal-header .modal-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.modal-header .modal-meta a { color: var(--accent); font-size: 11px; }
.modal-score {
  text-align: center;
  flex-shrink: 0;
  background: var(--accent-ghost);
  border: 1px solid rgba(0, 229, 191, 0.15);
  border-radius: var(--radius);
  padding: 10px 16px;
}
.modal-score-val {
  display: block;
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 800;
}
.modal-score-lbl {
  display: block;
  font-size: 9px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
}

.modal-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.modal-stats .modal-stat {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
}
.modal-stats .modal-stat-val {
  display: block;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}
.modal-stats .modal-stat-lbl {
  display: block;
  font-size: 10px;
  color: var(--text-faint);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.modal-details {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px 16px;
  margin-bottom: 20px;
}
.modal-detail {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.modal-detail strong {
  color: var(--text-faint);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 1px;
}

.modal-plans {
  margin-bottom: 20px;
}
.modal-plans h4 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin-bottom: 10px;
}
.modal-plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.modal-plan {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.modal-plan-name {
  font-weight: 700;
  font-size: 12px;
  color: var(--text);
  margin-bottom: 3px;
}
.modal-plan-info {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--text-muted);
}

.modal-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}
.modal-visit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  font-size: 13px;
  padding: 8px 22px;
  border-radius: var(--radius);
  border: none;
  text-decoration: none;
  transition: all var(--transition);
  font-family: var(--font);
}
.modal-visit-btn:hover { background: #00f5d4; color: var(--bg); }

/* ===== COMPARE GRID (new markup) ===== */
.compare-grid {
  display: grid;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.compare-cell {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-subtle);
  border-right: 1px solid var(--border-subtle);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.compare-cell:last-child { border-right: none; }
.compare-cell.compare-label {
  background: var(--bg-panel);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  justify-content: flex-start;
}
.compare-cell.compare-firm-header {
  background: var(--bg-panel);
  font-family: var(--font);
  font-weight: 800;
  font-size: 13px;
  gap: 8px;
  border-bottom: 2px solid var(--border);
  color: var(--text);
}
.compare-cell.compare-best {
  background: rgba(0, 229, 191, 0.06);
  color: var(--accent);
}
.compare-empty {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ===== BEST FOR CARDS (new markup) ===== */
.best-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  animation: fadeIn 0.25s ease backwards;
}
.best-card-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.best-icon { font-size: 18px; }
.best-card-body {
  padding: 14px 16px;
}
.best-winner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.best-winner-name {
  flex: 1;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.best-winner-score {
  font-family: var(--mono);
  font-weight: 800;
  font-size: 16px;
}
.best-reason {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}
.best-runners {
  padding: 10px 16px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.best-runners-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 4px;
}
.best-runner {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ===== RESPONSIVE (new components) ===== */
@media (max-width: 768px) {
  .market-btn { font-size: 12px; padding: 6px 14px; }
  .modal-header { flex-direction: column; align-items: flex-start; }
  .modal-details { grid-template-columns: 1fr; }
  .modal-plans-grid { grid-template-columns: 1fr; }
  .compare-grid { font-size: 11px; }
  .firm-card-body { grid-template-columns: repeat(2, 1fr); }
}
