/* ══════════════════════════════════════════════════════════════════════
   Top Dog Law — Dark Authority Design System
   Bloomberg Terminal meets Financial Times. Premium legal intelligence.
   ══════════════════════════════════════════════════════════════════════ */


/* ── 0. Self-Hosted Fonts ───────────────────────────────────────────── */

@font-face {
  font-family: 'DM Serif Display';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/dm-serif-display-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('/static/fonts/outfit-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/outfit-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/static/fonts/outfit-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/static/fonts/outfit-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/outfit-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/jetbrains-mono-400.woff2') format('woff2');
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/jetbrains-mono-700.woff2') format('woff2');
}

/* ── 1. Variables ────────────────────────────────────────────────────── */

:root {
  --bg: #f5f4f1;
  --bg-white: #ffffff;
  --bg-subtle: #eeeee9;
  --border: #d8d6d0;
  --border-hover: #b8b6b0;
  --text: #111827;
  --text-secondary: #4b5563;
  --text-muted: #9ca3af;
  --navy: #0f1a2e;
  --navy-mid: #1e3a5f;
  --navy-light: #2d5a8e;
  --gold: #c4963a;
  --gold-bg: rgba(196, 150, 58, 0.07);
  --gold-glow: rgba(196, 150, 58, 0.12);
  --green: #15803d;
  --green-bg: rgba(21, 128, 61, 0.06);
  --green-border: rgba(21, 128, 61, 0.18);
  --red: #b91c1c;
  --orange: #b45309;
  --blue: #1d4ed8;
  --blue-bg: rgba(29, 78, 216, 0.05);
  --purple: #6d28d9;
  --purple-bg: rgba(109, 40, 217, 0.05);
  --cream: #f8f6f0;
  --radius: 8px;
  --radius-sm: 5px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 1px 8px rgba(0,0,0,0.06), 0 0 1px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.1), 0 0 1px rgba(0,0,0,0.06);
  --shadow-xl: 0 12px 40px rgba(0,0,0,0.12);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}


/* ── 2. Reset & Base ─────────────────────────────────────────────────── */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

a {
  color: var(--navy-mid);
  text-decoration: none;
  transition: color 0.15s;
}
a:hover { color: var(--navy); }

h1, h2, h3, h4 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-weight: 400;
  line-height: 1.15;
  color: var(--navy);
}


/* ── 3. Keyframes ────────────────────────────────────────────────────── */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}


/* ── 4. Accent Bar ───────────────────────────────────────────────────── */

.accent-bar {
  height: 3px;
  background: linear-gradient(90deg,
    var(--navy) 0%,
    var(--navy-mid) 20%,
    var(--gold) 50%,
    var(--navy-mid) 80%,
    var(--navy) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 3s var(--ease-out) both;
}


/* ── 5. Navigation ───────────────────────────────────────────────────── */

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 2rem;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 100;
}

.nav-logo {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.2rem;
  color: var(--navy);
  letter-spacing: -0.02em;
  transition: color 0.15s;
}
.nav-logo:hover { color: var(--gold); }

.nav-links {
  display: flex;
  gap: 1.75rem;
  list-style: none;
}

.nav-links a {
  position: relative;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.2rem 0;
  transition: color 0.15s;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease-out);
}

.nav-links a:hover { color: var(--navy); }
.nav-links a:hover::after,
.nav-links a.active::after { transform: scaleX(1); }
.nav-links a.active { color: var(--navy); font-weight: 600; }

/* ── Mobile Nav Toggle ──── */

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 4px;
  -webkit-tap-highlight-color: transparent;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--navy);
  border-radius: 1px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

.nav.nav-open .nav-toggle span:nth-child(1) {
  transform: rotate(45deg) translate(4px, 4.5px);
}
.nav.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav.nav-open .nav-toggle span:nth-child(3) {
  transform: rotate(-45deg) translate(4px, -4.5px);
}

/* ── Nav Search ──── */

.nav-search { position: relative; }

.nav-search input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.8rem;
  padding: 0.35rem 0.65rem 0.35rem 1.8rem;
  width: 200px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s, width 0.25s var(--ease-out), box-shadow 0.15s;
}

.nav-search input:focus {
  border-color: var(--gold);
  width: 280px;
  background: var(--bg-white);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.nav-search .search-icon {
  position: absolute;
  left: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-style: normal;
  pointer-events: none;
}


/* ── 6. Search Autocomplete ──────────────────────────────────────────── */

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 4px;
  max-height: 280px;
  overflow-y: auto;
  display: none;
  box-shadow: var(--shadow-xl);
  z-index: 200;
}

.search-results.active { display: block; animation: scaleIn 0.15s var(--ease-out); }

.search-result-item {
  padding: 0.5rem 0.7rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: background 0.1s;
  border-bottom: 1px solid var(--bg-subtle);
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--bg-subtle); }

.search-result-name { font-size: 0.8rem; font-weight: 600; color: var(--text); }
.search-result-domain { font-family: 'JetBrains Mono', monospace; font-size: 0.68rem; color: var(--text-muted); }
.search-result-score { font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; font-weight: 700; }


/* ── 6b. Breadcrumbs ────────────────────────────────────────────────── */

.breadcrumb {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.55rem 1.5rem 0;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  font-size: 0.72rem;
}

.breadcrumb li {
  display: flex;
  align-items: center;
  color: var(--text-muted);
}

.breadcrumb li + li::before {
  content: '/';
  margin: 0 0.4rem;
  color: var(--border);
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.breadcrumb a:hover {
  color: var(--navy);
}

.breadcrumb [aria-current="page"] {
  color: var(--text-secondary);
  font-weight: 500;
}


/* ── 7. Container ────────────────────────────────────────────────────── */

.container { max-width: 1120px; margin: 0 auto; padding: 0 1.5rem; }


/* ── 8. Hero (Dark Treatment) ────────────────────────────────────────── */

.hero {
  position: relative;
  text-align: center;
  padding: 3.5rem 1.5rem 2.5rem;
  background: linear-gradient(175deg, #060e1a 0%, var(--navy) 45%, #142438 100%);
  overflow: hidden;
  border-bottom: none;
}

/* Warm gold glow from above */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% -15%, rgba(196, 150, 58, 0.1) 0%, transparent 55%);
  pointer-events: none;
}

/* Subtle grid texture */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

/* Content above overlays */
.hero > * { position: relative; z-index: 1; }

.hero h1 {
  font-size: 2.8rem;
  letter-spacing: -0.025em;
  color: var(--cream);
  margin-bottom: 0.4rem;
  animation: fadeUp 0.6s var(--ease-out) both;
}

.hero h1 em {
  font-style: normal;
  border-bottom: 3px solid var(--gold);
  padding-bottom: 2px;
}

.hero .subtitle {
  font-size: 0.95rem;
  color: rgba(248, 246, 240, 0.55);
  max-width: 500px;
  margin: 0 auto 1.5rem;
  line-height: 1.55;
  animation: fadeUp 0.6s var(--ease-out) 0.06s both;
}

/* ── Hero Search ──── */

.hero-search {
  position: relative;
  max-width: 460px;
  margin: 0 auto 1.5rem;
  animation: fadeUp 0.5s var(--ease-out) 0.12s both;
}

.hero-search input {
  width: 100%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius);
  color: var(--cream);
  font-family: inherit;
  font-size: 16px;
  padding: 0.7rem 1rem 0.7rem 2.4rem;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hero-search input::placeholder { color: rgba(255,255,255,0.3); }

.hero-search input:focus {
  background: rgba(255,255,255,0.1);
  border-color: rgba(196, 150, 58, 0.5);
  box-shadow: 0 0 0 3px rgba(196, 150, 58, 0.1), 0 2px 12px rgba(0,0,0,0.2);
}

.hero-search .search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.35);
  font-size: 0.9rem;
  font-style: normal;
  pointer-events: none;
}

/* Autocomplete in dark hero context */
.hero .search-results {
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  border-color: rgba(255,255,255,0.08);
}


/* ── 9. Stats Banner ─────────────────────────────────────────────────── */

.stats-banner {
  display: flex;
  justify-content: center;
  gap: 3rem;
  padding: 0.5rem 0;
}

/* Dark hero context */
.hero .stats-banner {
  border-top: 1px solid rgba(255,255,255,0.07);
  margin-top: 0.25rem;
  padding-top: 1.25rem;
}

.stat-item { text-align: center; }

.stat-value {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.7rem;
  color: var(--navy);
  line-height: 1.2;
}

.stat-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 500;
}

/* Stats in dark hero */
.hero .stat-value { color: var(--cream); }
.hero .stat-label { color: rgba(248, 246, 240, 0.35); }

/* Staggered entrance */
.hero .stat-item { animation: fadeUp 0.5s var(--ease-out) both; }
.hero .stat-item:nth-child(1) { animation-delay: 0.2s; }
.hero .stat-item:nth-child(2) { animation-delay: 0.27s; }
.hero .stat-item:nth-child(3) { animation-delay: 0.34s; }
.hero .stat-item:nth-child(4) { animation-delay: 0.41s; }


/* ── 10. Section Headers ─────────────────────────────────────────────── */

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.55rem;
  border-bottom: 2px solid var(--navy);
}

.section-header h2 { font-size: 1.3rem; }

.section-header h2::after {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--gold);
  border-radius: 50%;
  vertical-align: middle;
  margin-left: 0.45rem;
  margin-bottom: 0.1em;
}

.section-header .count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}


/* ── 11. Rankings Table ──────────────────────────────────────────────── */

.rankings-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.rankings-table th {
  text-align: left;
  padding: 0.45rem 0.65rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}

.rankings-table td {
  padding: 0.45rem 0.65rem;
  border-bottom: 1px solid var(--bg-subtle);
  vertical-align: middle;
  font-size: 0.82rem;
}

.rankings-table tbody tr {
  transition: background 0.12s;
}

.rankings-table tbody tr:hover {
  background: rgba(15, 26, 46, 0.02);
}

/* Gold left-border accent on hover */
.rankings-table tbody tr:hover td:first-child {
  box-shadow: inset 3px 0 0 var(--gold);
}

.rankings-table .rank-cell {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
  width: 36px;
  text-align: center;
}

.rankings-table .name-cell {
  max-width: 260px;
}

.rankings-table .name-cell a { display: block; }

.rankings-table .name-cell .firm-name {
  font-weight: 600;
  color: var(--navy);
  display: block;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rankings-table .name-cell .firm-domain {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.rankings-table .score-cell { width: 44px; }

.rankings-table .num-cell {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: right;
}

.rankings-table .grade-cell {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  font-size: 0.8rem;
}


/* ── 11b. Table Scroll Wrapper ──────────────────────────────────────── */

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}


/* ── 12. State Grid ──────────────────────────────────────────────────── */

.state-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 3rem;
}

.state-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.7rem;
  background: var(--bg-white);
  transition: background 0.12s, box-shadow 0.12s;
}

.state-card:hover {
  background: var(--bg-subtle);
}

.state-card:hover .state-name { color: var(--navy); }

.state-card .state-name {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text);
  transition: color 0.12s;
}

.state-card .firm-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-muted);
}



/* ── 13. Rankings Page ───────────────────────────────────────────────── */

.rankings-header { padding: 1.75rem 0 0.75rem; }
.rankings-header h1 { font-size: 1.9rem; margin-bottom: 0.2rem; }
.rankings-header .meta { color: var(--text-secondary); font-size: 0.82rem; }


/* ── 14. Pagination ──────────────────────────────────────────────────── */

.pagination {
  display: flex;
  justify-content: center;
  gap: 0.3rem;
  margin: 1.5rem 0 2.5rem;
}

.pagination a, .pagination span {
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all 0.15s;
}

.pagination a:hover {
  border-color: var(--navy);
  color: var(--navy);
  background: rgba(15, 26, 46, 0.03);
}

.pagination .active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
  font-weight: 700;
}


/* ── 15. Card System ─────────────────────────────────────────────────── */

.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 0.95rem;
  color: var(--navy);
}

.card-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Staggered card entrance in grids */
.dash-grid .card { animation: fadeUp 0.45s var(--ease-out) both; }
.dash-grid .card:nth-child(1)  { animation-delay: 0s; }
.dash-grid .card:nth-child(2)  { animation-delay: 0.04s; }
.dash-grid .card:nth-child(3)  { animation-delay: 0.08s; }
.dash-grid .card:nth-child(4)  { animation-delay: 0.12s; }
.dash-grid .card:nth-child(5)  { animation-delay: 0.16s; }
.dash-grid .card:nth-child(6)  { animation-delay: 0.2s; }
.dash-grid .card:nth-child(7)  { animation-delay: 0.24s; }
.dash-grid .card:nth-child(8)  { animation-delay: 0.28s; }
.dash-grid .card:nth-child(9)  { animation-delay: 0.32s; }
.dash-grid .card:nth-child(10) { animation-delay: 0.36s; }
.dash-grid .card:nth-child(11) { animation-delay: 0.4s; }


.firm-prose {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.7;
  max-width: 820px;
  margin: -0.5rem 0 1.5rem;
}

/* ── 16. Dashboard Grid ──────────────────────────────────────────────── */

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.dash-grid .card-span-2 { grid-column: span 2; }
.dash-grid .card-full { grid-column: 1 / -1; }


/* ── 17. Firm Dashboard Hero ─────────────────────────────────────────── */

.firm-hero {
  padding: 1.5rem 0;
  display: grid;
  grid-template-columns: 140px 1fr auto;
  gap: 1.5rem;
  align-items: start;
  border-bottom: 2px solid var(--navy);
  margin-bottom: 1rem;
}

.firm-hero .score-section { text-align: center; }

.firm-hero .score-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.firm-hero .firm-identity h1 {
  font-size: 1.7rem;
  margin-bottom: 0.15rem;
  letter-spacing: -0.01em;
}

.firm-hero .firm-desc {
  color: var(--text-secondary);
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
  max-width: 520px;
  line-height: 1.5;
}

.firm-hero .firm-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.firm-hero .meta-item {
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

.firm-hero .meta-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-right: 0.15rem;
}

.practice-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.4rem;
}

.practice-tag {
  font-size: 0.65rem;
  padding: 0.12rem 0.45rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-secondary);
  transition: background 0.1s;
}

.practice-tag:hover { background: var(--border); }

.claim-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  font-size: 0.78rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.claim-btn:hover {
  background: var(--navy-mid);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 26, 46, 0.25);
}


/* ── 18. Tech Stack Matrix ───────────────────────────────────────────── */

.tech-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 0.5rem;
}

.tech-cat-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.65rem;
  border-left: 3px solid var(--border);
  transition: border-color 0.15s, transform 0.15s;
}

.tech-cat-card:hover { transform: translateY(-1px); }

.tech-cat-card.cat-analytics { border-left-color: var(--blue); }
.tech-cat-card.cat-advertising { border-left-color: var(--gold); }
.tech-cat-card.cat-chat_widget,
.tech-cat-card.cat-intake_software { border-left-color: var(--green); }
.tech-cat-card.cat-crm,
.tech-cat-card.cat-case_management { border-left-color: var(--purple); }
.tech-cat-card.cat-seo,
.tech-cat-card.cat-tracking,
.tech-cat-card.cat-email_marketing { border-left-color: var(--orange); }
.tech-cat-card.cat-forms,
.tech-cat-card.cat-reviews { border-left-color: #059669; }
.tech-cat-card.cat-hosting,
.tech-cat-card.cat-cms,
.tech-cat-card.cat-cdn { border-left-color: #6b7280; }

.tech-cat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.tech-cat-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.56rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}

.tech-cat-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.58rem;
  color: var(--text-muted);
}

.tech-cat-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.tech-tool {
  font-size: 0.7rem;
  color: var(--text-secondary);
  background: var(--bg-white);
  border: 1px solid var(--border);
  padding: 0.1rem 0.38rem;
  border-radius: 3px;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  transition: background 0.1s;
}

.tech-tool:hover { background: var(--bg-subtle); }


/* ── 19. Radar Chart ─────────────────────────────────────────────────── */

.radar-wrap {
  display: flex;
  justify-content: center;
  padding: 0.3rem 0;
}

.radar-chart { max-width: 100%; height: auto; }


/* ── 20. Funnel Bars ─────────────────────────────────────────────────── */

.funnel-row {
  display: grid;
  grid-template-columns: 80px 1fr 34px;
  gap: 0.5rem;
  align-items: center;
  padding: 0.38rem 0;
}

.funnel-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.funnel-bar-bg {
  height: 20px;
  background: var(--bg-subtle);
  border-radius: 4px;
  overflow: hidden;
}

.funnel-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s var(--ease-out);
  min-width: 2px;
}

.funnel-bar-fill.high   { background: var(--green); }
.funnel-bar-fill.medium { background: var(--gold); }
.funnel-bar-fill.low    { background: var(--orange); }
.funnel-bar-fill.zero   { background: transparent; }

.funnel-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 700;
  text-align: right;
}

.funnel-tools-line {
  padding: 0 0 0.25rem 86px;
  font-size: 0.65rem;
  color: var(--text-muted);
  line-height: 1.3;
}


/* ── 21. Signal Tags ─────────────────────────────────────────────────── */

.signal-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.5rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--bg-subtle);
}

.signal-tag {
  padding: 0.15rem 0.5rem;
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  border-radius: 3px;
  font-size: 0.65rem;
  color: var(--green);
  font-weight: 500;
  transition: background 0.12s;
}

.signal-tag:hover {
  background: rgba(21, 128, 61, 0.12);
}


/* ── 22. Competitor Table ────────────────────────────────────────────── */

.comp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.comp-table th {
  text-align: left;
  padding: 0.3rem 0.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.56rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
  font-weight: 600;
}

.comp-table td {
  padding: 0.35rem 0.5rem;
  border-bottom: 1px solid var(--bg-subtle);
  transition: background 0.1s;
}

.comp-table tbody tr:hover td { background: rgba(15, 26, 46, 0.02); }

.comp-table .firm-link { font-weight: 600; color: var(--navy); }
.comp-table .score-col { font-family: 'JetBrains Mono', monospace; font-weight: 700; }

.comp-table .you-row { background: var(--gold-bg); }
.comp-table .you-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.52rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
}


/* ── 23. Attorney Table ──────────────────────────────────────────────── */

.attorney-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.attorney-table th {
  text-align: left;
  padding: 0.3rem 0.4rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.56rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
  font-weight: 600;
}

.attorney-table td {
  padding: 0.28rem 0.4rem;
  border-bottom: 1px solid var(--bg-subtle);
}

.attorney-table .name { font-weight: 600; color: var(--navy); }
.attorney-table .meta { color: var(--text-muted); font-size: 0.72rem; }


/* ── 24. Offices ─────────────────────────────────────────────────────── */

.office-compact {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.45rem;
}

.office-item {
  padding: 0.45rem 0.6rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--border);
  font-size: 0.78rem;
  transition: transform 0.15s;
}

.office-item:hover { transform: translateY(-1px); }

.office-item.hq {
  border-left-color: var(--gold);
  background: var(--gold-bg);
}

.office-item .badge-hq {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  font-weight: 700;
}

.office-item .location { font-weight: 600; font-size: 0.78rem; color: var(--text); }
.office-item .address { font-size: 0.7rem; color: var(--text-muted); }


/* ── 25. CTA Card ────────────────────────────────────────────────────── */

.cta-card {
  text-align: center;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 2px solid var(--navy);
  background: rgba(15, 26, 46, 0.02);
  border-radius: var(--radius);
  transition: background 0.15s;
}

.cta-card:hover { background: rgba(15, 26, 46, 0.04); }

.cta-card h3 { margin-bottom: 0.3rem; font-size: 1.05rem; }

.cta-card p {
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  font-size: 0.82rem;
}


/* ── 26. Claim Page ──────────────────────────────────────────────────── */

.claim-page { max-width: 480px; margin: 2rem auto; padding: 0 1.5rem; }
.claim-page h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.claim-page .subtitle { color: var(--text-secondary); margin-bottom: 1.5rem; font-size: 0.85rem; }

.form-group { margin-bottom: 0.9rem; }

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
  width: 100%;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  padding: 0.55rem 0.7rem;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
}

.form-group textarea { resize: vertical; min-height: 80px; }
.form-group .required { color: var(--red); }

.submit-btn {
  background: var(--navy);
  color: #fff;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.6rem 1.3rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.submit-btn:hover {
  background: var(--navy-mid);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 26, 46, 0.2);
}

.success-box {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  text-align: center;
  animation: scaleIn 0.3s var(--ease-out);
}

.success-box h2 { color: var(--green); margin-bottom: 0.4rem; }


/* ── 27. Footer (Dark, mirrors hero) ─────────────────────────────────── */

.footer {
  background: var(--navy);
  padding: 1.5rem 2rem;
  text-align: center;
  color: rgba(248, 246, 240, 0.35);
  font-size: 0.7rem;
  margin-top: 3rem;
  border-top: none;
  letter-spacing: 0.01em;
}

.footer a {
  color: rgba(248, 246, 240, 0.55);
  transition: color 0.15s;
}
.footer a:hover { color: var(--gold); }

.footer-links {
  margin-top: 0.5rem;
  display: flex;
  justify-content: center;
  gap: 1.2rem;
}


/* ── 28. Prose & Static Pages ─────────────────────────────────────────── */

.prose-page {
  max-width: 720px;
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.prose-page h1 {
  font-family: var(--font-serif);
  font-size: 1.8rem;
  margin-bottom: 0.25rem;
}

.prose-updated {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-bottom: 2rem;
}

.prose-page h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.prose-page p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.75;
  margin-bottom: 0.75rem;
}

.prose-page ul {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.75;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
}

.prose-page li { margin-bottom: 0.3rem; }


/* ── About Page ───────────────────────────────────────────────────────── */

.about-page {
  max-width: 820px;
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.about-hero h1 {
  font-family: var(--font-serif);
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.about-lead {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.75;
  max-width: 640px;
  margin-bottom: 2.5rem;
}

.about-lead em {
  color: var(--text);
  font-style: italic;
}

.about-section {
  margin-bottom: 2.5rem;
}

.about-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.about-section p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.75;
  margin-bottom: 0.75rem;
}

.about-section a {
  color: var(--accent);
  font-weight: 600;
}

.about-address {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

.team-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.team-card {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.team-avatar {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.05em;
}

.team-info h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.1rem;
}

.team-role {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.team-info p {
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.65;
  margin: 0;
}


/* ── 29. Segment Banner (firm dashboard) ─────────────────────────────── */

.segment-banner {
  border-left: 4px solid var(--gold);
  background: linear-gradient(90deg, var(--gold-bg) 0%, var(--bg-white) 40%);
}

.segment-banner-body {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem 1.25rem;
  align-items: center;
}

.segment-badge {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.segment-name {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.15rem;
  color: var(--navy);
}

.segment-size {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
}

.segment-stats {
  display: flex;
  gap: 1.5rem;
}

.segment-stat { text-align: center; }

.segment-stat-value {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
}

.segment-stat-label {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.segment-desc {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}


/* ── 29. Gap Analysis ────────────────────────────────────────────────── */

.gap-list { display: flex; flex-direction: column; gap: 0.35rem; }

.gap-row {
  display: grid;
  grid-template-columns: 65px 1fr 50px;
  gap: 0.4rem;
  align-items: center;
}

.gap-axis {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.gap-bar-container { position: relative; }

.gap-bar-track {
  height: 14px;
  background: var(--bg-subtle);
  border-radius: 3px;
  position: relative;
  overflow: visible;
}

.gap-bar-firm {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--navy);
  border-radius: 3px;
  opacity: 0.65;
  transition: width 0.5s var(--ease-out);
}

.gap-bar-centroid {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 20px;
  background: var(--gold);
  border-radius: 1px;
}

.gap-status {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.56rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: right;
}

.gap-ahead  { color: var(--green); }
.gap-on-par { color: var(--text-muted); }
.gap-behind { color: var(--red); }

.gap-legend {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--bg-subtle);
}

.gap-legend-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.6rem;
  color: var(--text-muted);
}

.gap-legend-bar {
  display: inline-block;
  width: 14px;
  height: 8px;
  background: var(--navy);
  border-radius: 2px;
  opacity: 0.65;
}

.gap-legend-line {
  display: inline-block;
  width: 14px;
  height: 2px;
  background: var(--gold);
}


/* ── 30. Recommendations ─────────────────────────────────────────────── */

.rec-list { display: flex; flex-direction: column; gap: 0.5rem; }

.rec-item {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--bg-subtle);
  transition: background 0.12s;
}

.rec-item:last-child { border-bottom: none; }

.rec-tech {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--navy);
  margin-bottom: 0.15rem;
}

.rec-meta {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}

.rec-pct {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--green);
}

.rec-segment { font-weight: 500; color: var(--text-secondary); }

.rec-bar-bg {
  height: 6px;
  background: var(--bg-subtle);
  border-radius: 3px;
  overflow: hidden;
}

.rec-bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: 3px;
  opacity: 0.55;
  transition: width 0.5s var(--ease-out);
}


/* ── 31. Analytics Page ──────────────────────────────────────────────── */

.analytics-header {
  padding: 1.75rem 0 0.85rem;
}

.analytics-header h1 {
  font-size: 1.9rem;
  margin-bottom: 0.25rem;
}

.analytics-header .subtitle {
  color: var(--text-secondary);
  font-size: 0.88rem;
}


/* ── 32. Segment Bars (analytics + tech pages) ───────────────────────── */

.segment-bars { display: flex; flex-direction: column; gap: 0.25rem; }

.segment-bar-row {
  display: grid;
  grid-template-columns: 160px 1fr 90px;
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem 0.3rem;
  border-radius: var(--radius-sm);
  transition: background 0.12s;
  text-decoration: none;
  color: inherit;
}

.segment-bar-row:hover { background: var(--bg-subtle); }

.segment-bar-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.segment-bar-track {
  height: 18px;
  background: var(--bg-subtle);
  border-radius: 4px;
  overflow: hidden;
}

.segment-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.6s var(--ease-out);
}

.segment-bar-stats {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

.segment-bar-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.segment-bar-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--navy);
  min-width: 32px;
  text-align: right;
}


/* ── 33. SI Distribution ─────────────────────────────────────────────── */

.si-dist { display: flex; flex-direction: column; gap: 0.35rem; }

.si-tier-row {
  display: grid;
  grid-template-columns: 72px 1fr 65px;
  gap: 0.4rem;
  align-items: center;
}

.si-tier-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.si-tier-bar-bg {
  height: 18px;
  background: var(--bg-subtle);
  border-radius: 4px;
  overflow: hidden;
}

.si-tier-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s var(--ease-out);
}

.tier-elite     { background: var(--green); }
.tier-advanced  { background: var(--navy-mid); }
.tier-developing { background: var(--gold); }
.tier-basic     { background: var(--orange); }
.tier-minimal   { background: #c9c9c9; }

.si-tier-stats {
  display: flex;
  gap: 0.35rem;
  justify-content: flex-end;
}

.si-tier-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text);
  min-width: 30px;
  text-align: right;
}

.si-tier-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  color: var(--text-muted);
  min-width: 35px;
  text-align: right;
}


/* ── 34. Funnel Distribution ─────────────────────────────────────────── */

.funnel-dist { display: flex; flex-direction: column; gap: 0.35rem; }

.funnel-dist-row {
  display: grid;
  grid-template-columns: 72px 1fr 40px;
  gap: 0.4rem;
  align-items: center;
}

.funnel-dist-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.funnel-dist-bar-bg {
  height: 16px;
  background: var(--bg-subtle);
  border-radius: 4px;
  overflow: hidden;
}

.funnel-dist-bar-fill {
  height: 100%;
  background: var(--navy-mid);
  border-radius: 4px;
  transition: width 0.5s var(--ease-out);
}

.funnel-dist-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}


/* ── 35. Elite Comparison ────────────────────────────────────────────── */

.elite-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.elite-item {
  padding: 0.6rem 0.7rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: transform 0.15s, box-shadow 0.15s;
}

.elite-item:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.elite-tech {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--navy);
  margin-bottom: 0.35rem;
}

.elite-bars { display: flex; flex-direction: column; gap: 0.2rem; }

.elite-bar-pair {
  display: grid;
  grid-template-columns: 30px 1fr 32px;
  gap: 0.3rem;
  align-items: center;
}

.elite-bar-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.55rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.elite-bar-bg {
  height: 10px;
  background: var(--bg-subtle);
  border-radius: 3px;
  overflow: hidden;
}

.elite-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s var(--ease-out);
}

.elite-bar-fill.elite { background: var(--green); }
.elite-bar-fill.all { background: #c9c9c9; }

.elite-bar-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: right;
}

.elite-lift {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--green);
  margin-top: 0.25rem;
}


/* ── 36. Segments Grid ───────────────────────────────────────────────── */

.segments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.segment-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), border-color 0.2s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.segment-card:hover {
  transform: translateY(-3px);
  border-color: var(--gold);
  box-shadow: var(--shadow-lg);
}

.segment-card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
}

.segment-card-name {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.02rem;
  color: var(--navy);
}

.segment-card-si {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
}

.segment-card-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.7rem;
  flex: 1;
}

.segment-card-stats {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 0.7rem;
}

.segment-card-stat { text-align: center; }

.segment-card-stat-value {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--navy);
}

.segment-card-stat-label {
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.segment-card-funnel {
  display: flex;
  gap: 0.4rem;
  align-items: flex-end;
  height: 44px;
  padding-top: 0.4rem;
  border-top: 1px solid var(--bg-subtle);
}

.segment-funnel-pip {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.segment-funnel-bar {
  width: 100%;
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  transition: height 0.4s var(--ease-out);
}

.segment-funnel-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.5rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 0.15rem;
}


/* ── 37. Segment Detail ──────────────────────────────────────────────── */

.segment-overview-stats {
  display: flex;
  justify-content: space-around;
  gap: 1rem;
  padding: 0.6rem 0;
}

.segment-overview-stat { text-align: center; }

.segment-overview-value {
  display: block;
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.7rem;
  color: var(--navy);
}

.segment-overview-label {
  font-size: 0.63rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 500;
}


/* ── 38. Upgrade Tips ────────────────────────────────────────────────── */

.upgrade-tips { display: flex; flex-direction: column; gap: 0.35rem; }

.upgrade-tip {
  display: grid;
  grid-template-columns: 72px 1fr 55px;
  gap: 0.5rem;
  align-items: center;
}

.upgrade-axis {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.upgrade-bar-bg {
  height: 14px;
  background: var(--bg-subtle);
  border-radius: 4px;
  overflow: hidden;
}

.upgrade-bar-fill {
  height: 100%;
  background: var(--navy-mid);
  border-radius: 4px;
  transition: width 0.5s var(--ease-out);
}

.upgrade-gap {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--navy-mid);
  text-align: right;
}

.upgrade-note {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--bg-subtle);
}


/* ── 39. Tech Detail ─────────────────────────────────────────────────── */

.si-lift-pos { color: var(--green); }
.si-lift-neg { color: var(--red); }

.paired-list { display: flex; flex-direction: column; gap: 0.15rem; }

.paired-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--bg-subtle);
  font-size: 0.78rem;
  transition: background 0.1s;
}

.paired-item:last-child { border-bottom: none; }
.paired-item:hover { background: rgba(15, 26, 46, 0.015); }

.paired-name {
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
}
.paired-name:hover { text-decoration: underline; }

.paired-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
}


/* ── 39b. Technology Index Page ─────────────────────────────────────── */

.tech-index-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.tech-search-wrap {
  position: relative;
  max-width: 400px;
}

.tech-search-wrap .search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

.tech-search-wrap input {
  width: 100%;
  padding: 0.55rem 0.75rem 0.55rem 2.1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-white);
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

.tech-search-wrap input:focus {
  border-color: var(--navy);
}

.tech-filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.filter-pill {
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--bg-white);
  font-family: 'Outfit', sans-serif;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.filter-pill:hover {
  border-color: var(--navy);
  color: var(--navy);
}

.filter-pill.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

.tech-index-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-family: 'JetBrains Mono', monospace;
}

.tech-index-table .practice-tag {
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
}

.tech-adopt-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 90px;
  justify-content: flex-end;
}

.tech-adopt-bar span {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 600;
  min-width: 36px;
  text-align: right;
}

.tech-adopt-fill {
  height: 4px;
  border-radius: 2px;
  background: var(--navy);
  flex: 1;
  max-width: 50px;
  opacity: 0.4;
}


/* ── 40. Search Results Page ─────────────────────────────────────────── */

.search-page-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.search-sidebar {
  position: sticky;
  top: 1rem;
  align-self: start;
}

.search-form {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.search-form select {
  width: 100%;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  padding: 0.4rem 0.5rem;
  outline: none;
  transition: border-color 0.15s;
}

.search-form select:focus {
  border-color: var(--gold);
}

.range-inputs {
  display: flex;
  gap: 0.3rem;
  align-items: center;
}

.range-inputs input {
  width: 50%;
  font-size: 0.82rem;
  padding: 0.35rem 0.5rem;
}

.range-sep {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.search-results-header {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.search-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}


/* ── 41. Responsive ──────────────────────────────────────────────────── */

@media (max-width: 1024px) {
  .dash-grid { grid-template-columns: 1fr 1fr; }
  .dash-grid .card-span-2 { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  /* Nav */
  .nav { flex-wrap: wrap; padding: 0.5rem 1rem; }
  .nav-toggle { display: flex; order: -1; }
  .nav-logo { order: 0; flex: 1; text-align: center; }
  .nav-search { order: 1; width: 100%; margin-top: 0.5rem; }
  .nav-search input { width: 100%; }
  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0;
    order: 3;
    padding: 0.5rem 0;
    border-top: 1px solid var(--border);
    margin-top: 0.5rem;
  }
  .nav.nav-open .nav-links { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a {
    display: block;
    padding: 0.65rem 0;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--bg-subtle);
  }
  .nav-links a::after { display: none; }

  /* Container */
  .container { padding: 0 1rem; }

  /* Hero */
  .hero { padding: 2rem 1rem 1.5rem; }
  .hero h1 { font-size: 1.8rem; }
  .hero .subtitle { font-size: 0.88rem; margin-bottom: 1.25rem; }

  /* Stats banner — 2x2 grid on mobile */
  .stats-banner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1.5rem;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
  }
  .hero .stats-banner {
    gap: 0.75rem 1.5rem;
  }

  /* Section headers */
  .section-header { margin: 1.5rem 0 0.65rem; }
  .section-header h2 { font-size: 1.15rem; }

  /* Rankings table */
  .rankings-table th:nth-child(n+5),
  .rankings-table td:nth-child(n+5) { display: none; }
  .rankings-table th { padding: 0.4rem 0.45rem; font-size: 0.55rem; }
  .rankings-table td { padding: 0.4rem 0.45rem; font-size: 0.78rem; }
  .rankings-table .name-cell { max-width: 180px; }
  .rankings-table .name-cell .firm-name { font-size: 0.78rem; }

  /* State grid — taller tap targets */
  .state-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .state-card { padding: 0.65rem 0.7rem; min-height: 44px; }

  /* Dashboard */
  .dash-grid { grid-template-columns: 1fr; }
  .dash-grid .card-span-2 { grid-column: 1; }

  /* Firm hero */
  .firm-hero { grid-template-columns: 1fr; text-align: center; }
  .firm-hero .firm-meta { justify-content: center; }
  .firm-hero .practice-tags { justify-content: center; }

  /* Team cards */
  .team-card { flex-direction: column; text-align: center; }
  .team-avatar { margin: 0 auto; }

  /* Search */
  .search-page-layout { grid-template-columns: 1fr; }
  .search-sidebar { position: static; }

  /* Segments */
  .segment-banner-body { grid-template-columns: 1fr; text-align: center; }
  .segment-stats { justify-content: center; }
  .segment-overview-stats { flex-wrap: wrap; }
  .segments-grid { grid-template-columns: 1fr; }
  .elite-grid { grid-template-columns: 1fr; }
  .segment-bar-row { grid-template-columns: 120px 1fr 70px; }
}

@media (max-width: 480px) {
  /* Hero */
  .hero { padding: 1.5rem 0.75rem 1.25rem; }
  .hero h1 { font-size: 1.4rem; }
  .hero .subtitle { font-size: 0.82rem; margin-bottom: 1rem; }
  .hero-search input { font-size: 0.88rem; padding: 0.6rem 0.85rem 0.6rem 2.2rem; }

  /* Stats banner — tighter 2x2 */
  .stats-banner { gap: 0.5rem 1rem; max-width: 280px; }
  .stat-value { font-size: 1.25rem; }
  .hero .stat-value { font-size: 1.25rem; }
  .stat-label { font-size: 0.6rem; }

  /* Container */
  .container { padding: 0 0.75rem; }

  /* Section headers */
  .section-header h2 { font-size: 1.05rem; }
  .section-header .count { font-size: 0.68rem; }

  /* Rankings table — hide grade on small phones */
  .rankings-table th:nth-child(n+4),
  .rankings-table td:nth-child(n+4) { display: none; }
  .rankings-table th { padding: 0.35rem 0.35rem; }
  .rankings-table td { padding: 0.35rem 0.35rem; }
  .rankings-table .rank-cell { width: 28px; font-size: 0.68rem; }
  .rankings-table .name-cell { max-width: 160px; }
  .rankings-table .name-cell .firm-name { font-size: 0.75rem; }
  .rankings-table .name-cell .firm-domain { font-size: 0.6rem; }
  .rankings-table .score-cell { width: 36px; }

  /* State grid */
  .state-grid { grid-template-columns: 1fr 1fr; }
  .state-card .state-name { font-size: 0.72rem; }
  .state-card .firm-count { font-size: 0.64rem; }

  /* Segments */
  .segment-overview-stats { gap: 0.5rem; }
  .segment-overview-value { font-size: 1.3rem; }
  .segment-bar-row { grid-template-columns: 100px 1fr 60px; }
  .segment-bar-name { font-size: 0.7rem; }
}


/* ── 42. Scroll-triggered animations ─────────────────────────────────── */

.segments-grid .segment-card {
  animation: fadeUp 0.4s var(--ease-out) both;
}
.segments-grid .segment-card:nth-child(1) { animation-delay: 0s; }
.segments-grid .segment-card:nth-child(2) { animation-delay: 0.05s; }
.segments-grid .segment-card:nth-child(3) { animation-delay: 0.1s; }
.segments-grid .segment-card:nth-child(4) { animation-delay: 0.15s; }
.segments-grid .segment-card:nth-child(5) { animation-delay: 0.2s; }
.segments-grid .segment-card:nth-child(6) { animation-delay: 0.25s; }
.segments-grid .segment-card:nth-child(7) { animation-delay: 0.3s; }

.elite-grid .elite-item {
  animation: fadeUp 0.35s var(--ease-out) both;
}
.elite-grid .elite-item:nth-child(1)  { animation-delay: 0s; }
.elite-grid .elite-item:nth-child(2)  { animation-delay: 0.03s; }
.elite-grid .elite-item:nth-child(3)  { animation-delay: 0.06s; }
.elite-grid .elite-item:nth-child(4)  { animation-delay: 0.09s; }
.elite-grid .elite-item:nth-child(5)  { animation-delay: 0.12s; }
.elite-grid .elite-item:nth-child(6)  { animation-delay: 0.15s; }
.elite-grid .elite-item:nth-child(7)  { animation-delay: 0.18s; }
.elite-grid .elite-item:nth-child(8)  { animation-delay: 0.21s; }
.elite-grid .elite-item:nth-child(9)  { animation-delay: 0.24s; }
.elite-grid .elite-item:nth-child(10) { animation-delay: 0.27s; }


/* ── 43. HQ Badge (city pages) ──────────────────────────────────────── */

.hq-badge-cell { width: 30px; text-align: center; }

.hq-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold);
  background: var(--gold-bg);
  border: 1px solid rgba(196, 150, 58, 0.2);
  padding: 0.1rem 0.35rem;
  border-radius: 3px;
}

.rankings-table .hq-row { background: rgba(196, 150, 58, 0.03); }

.city-rank-badge {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--navy-mid);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 0.05rem 0.35rem;
  border-radius: 3px;
  margin-left: 0.4rem;
  vertical-align: middle;
}


/* ── 44. City Tech Grid ────────────────────────────────────────────── */

.city-tech-grid {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 2rem;
}

.city-tech-item {
  display: grid;
  grid-template-columns: 140px 1fr 45px;
  gap: 0.5rem;
  align-items: center;
  padding: 0.35rem 0;
}

.city-tech-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.city-tech-name:hover { text-decoration: underline; }

.city-tech-bar-bg {
  height: 16px;
  background: var(--bg-subtle);
  border-radius: 4px;
  overflow: hidden;
}

.city-tech-bar-fill {
  height: 100%;
  background: var(--navy-mid);
  border-radius: 4px;
  transition: width 0.5s var(--ease-out);
}

.city-tech-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}


/* ── 44. Insight Pages ─────────────────────────────────────────────── */

.insight-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.insight-grid .card-span-2 { grid-column: span 2; }
.insight-grid .card-full { grid-column: 1 / -1; }

.insight-tech-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.insight-tech-row {
  display: grid;
  grid-template-columns: 130px 1fr 90px;
  gap: 0.5rem;
  align-items: center;
  padding: 0.25rem 0;
}

.insight-tech-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.insight-tech-name:hover { text-decoration: underline; }

.insight-tech-bars {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.insight-tech-bar-bg {
  height: 10px;
  background: var(--bg-subtle);
  border-radius: 3px;
  overflow: hidden;
}

.insight-tech-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s var(--ease-out);
}

.insight-tech-bar-fill.cohort { background: var(--navy-mid); }
.insight-tech-bar-fill.overall { background: #b8b6b0; }

.insight-tech-stats {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  justify-content: flex-end;
}

.insight-tech-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text);
}

.insight-tech-diff {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.62rem;
  font-weight: 700;
}

.insight-tech-diff.positive { color: var(--green); }
.insight-tech-diff.negative { color: var(--red); }

.insight-tech-legend {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--bg-subtle);
}

.insight-legend-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.6rem;
  color: var(--text-muted);
}

.insight-legend-bar {
  display: inline-block;
  width: 14px;
  height: 8px;
  border-radius: 2px;
}

.insight-legend-bar.cohort { background: var(--navy-mid); }
.insight-legend-bar.overall { background: #b8b6b0; }

@media (max-width: 768px) {
  .insight-grid { grid-template-columns: 1fr; }
  .insight-grid .card-span-2 { grid-column: 1; }
  .insight-tech-row { grid-template-columns: 100px 1fr 70px; }
  .city-tech-item { grid-template-columns: 120px 1fr 40px; }
}


/* ── 45. Penetration Analysis ────────────────────────────────────────── */

.pen-table-wrap {
  overflow-x: auto;
  margin-bottom: 2rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.pen-table { min-width: 900px; }

.pen-tech-col {
  text-align: center !important;
  font-size: 0.65rem;
  max-width: 70px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0.4rem 0.3rem !important;
}

.pen-heat {
  font-variant-numeric: tabular-nums;
  min-width: 48px;
  transition: background 0.15s;
}

.pen-tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.pen-mini-bar {
  display: grid;
  grid-template-columns: 110px 1fr 36px;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
}

.pen-mini-name {
  font-size: 0.72rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pen-mini-track {
  height: 6px;
  background: var(--card-border);
  border-radius: 3px;
  overflow: hidden;
}

.pen-mini-fill {
  height: 100%;
  background: var(--gold);
  border-radius: 3px;
  min-width: 2px;
}

.pen-mini-pct {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: right;
}


/* ── 46. Print ───────────────────────────────────────────────────────── */

@media print {
  .nav, .accent-bar, .footer, .claim-btn, .cta-card,
  .nav-toggle, .search-sidebar { display: none !important; }
  .hero { background: #fff !important; color: var(--text) !important; }
  .hero h1, .hero .subtitle, .hero .stat-value { color: var(--navy) !important; }
  .hero .stat-label { color: var(--text-muted) !important; }
  .card { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
  body { background: #fff; }
}
