/* AdvisorBook layout + legacy component styles.
   ───────────────────────────────────────────────────────────────
   The information architecture mimics a Facebook-style activity
   feed: a centered column of white cards, a sticky top nav, and
   entity rails on either side.

   This stylesheet is structured by atomic-design level. Design
   tokens (colors, spacing, etc.) and atom-level styles live in
   ./design-system/. The two @imports below pull them in first;
   the rest of this file holds molecule + organism + page styles
   that haven't been migrated to .ab-* class names yet.

   New styles should add their tokens to ./design-system/tokens.css
   and reference --ab-* custom properties (not raw hex / px).
   See docs/design-system.md.
   ─────────────────────────────────────────────────────────────── */

@import url("./design-system/tokens.css");
@import url("./design-system/components.css");

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  font-size: 15px;
  line-height: 1.4;
}

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

.metric,
.kv-row {
  display: inline-flex;
  align-items: baseline;
  column-gap: 4px;
  flex-wrap: wrap;
}

.metric-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.coverage-header .card-body {
  display: grid;
  gap: 16px;
}

.coverage-lede {
  margin: 0;
  color: var(--text-muted);
}

.coverage-stat-grid,
.coverage-metric-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.coverage-stat,
.coverage-metric {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.coverage-stat-label,
.coverage-metric-label,
.coverage-metric-source,
.coverage-metric-resource {
  color: var(--text-muted);
  font-size: 12px;
}

.coverage-stat strong,
.coverage-metric-value {
  overflow-wrap: anywhere;
  font-size: 24px;
  line-height: 1.1;
}

.coverage-metric--limited {
  border-color: var(--warning-border, var(--border));
}

.coverage-metric-limitation {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.coverage-destination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}

.coverage-destination p {
  margin: 0;
  color: var(--text-muted);
}

.coverage-destination a {
  font-weight: 700;
}

.coverage-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.coverage-limitation-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
}

.branches-header .card-body,
.branches-filter-card .card-body,
.branches-results-card .card-body {
  display: grid;
  gap: 14px;
}

.branches-lede,
.branches-muted {
  margin: 0;
  color: var(--text-muted);
}

.branches-filter-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
}

.branches-filter-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.branches-filter-field input,
.branches-filter-field select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  padding: 9px 10px;
}

.branches-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.branches-list {
  display: grid;
  gap: 10px;
}

.branches-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) repeat(3, minmax(110px, 1fr)) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.branches-row-main,
.branches-row-field,
.branches-summary-grid,
.branches-legend {
  min-width: 0;
}

.branches-row-main {
  display: grid;
  gap: 5px;
}

.branches-row-title {
  font-weight: 800;
  color: var(--text);
  overflow-wrap: anywhere;
}

.branches-row-subtitle,
.branches-row-label,
.branches-metric-label,
.branches-active-filter,
.branches-legend-row {
  color: var(--text-muted);
  font-size: 12px;
}

.branches-row-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.branches-row-context {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.branches-row-source-context {
  color: var(--text);
}

.branches-row-field {
  display: grid;
  gap: 3px;
}

.branches-row-value {
  overflow-wrap: anywhere;
  font-weight: 700;
}

.branches-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.branches-row-action {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  padding: 7px 9px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.branches-row-action:hover {
  background: var(--border);
  text-decoration: none;
}

.branches-load-more {
  display: flex;
  justify-content: center;
}

.branches-metric,
.branches-summary-grid {
  display: grid;
  gap: 6px;
}

.branches-metric {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.branches-metric-value {
  overflow-wrap: anywhere;
  font-size: 20px;
  line-height: 1.1;
}

.branches-active-filters,
.branches-legend {
  display: grid;
  gap: 8px;
}

.branches-active-filter,
.branches-legend-row {
  margin: 0;
}

@media (max-width: 1100px) {
  .branches-row {
    grid-template-columns: minmax(0, 1fr) minmax(130px, 0.5fr);
  }
  .branches-row-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .branches-row,
  .branches-filter-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.kv-list {
  display: grid;
  gap: 6px;
}

/* ── Top navbar ─────────────────────────────────────────────── */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  box-shadow: var(--shadow);
}
.nav .logo {
  font-weight: 800;
  font-size: 22px;
  color: var(--brand);
  letter-spacing: -0.5px;
}
.nav .logo a {
  color: inherit;
}
.nav .logo a:hover {
  text-decoration: none;
}
.nav .search {
  flex: 1;
  max-width: 320px;
  background: var(--bg);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  color: var(--text-muted);
}
.nav .search input {
  background: transparent;
  border: 0;
  outline: none;
  width: 100%;
  font-size: 14px;
  color: var(--text);
}
.nav-drawer {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-left: auto;
}
.nav .nav-links {
  display: flex;
  gap: 4px;
}
.nav .nav-links a {
  color: var(--text-muted);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 500;
}
.nav .nav-links a:hover {
  background: var(--bg);
  text-decoration: none;
}
.nav .nav-links a.active {
  color: var(--brand);
}

@media (min-width: 901px) and (max-width: 1300px) {
  .nav {
    gap: 10px;
    padding: 8px 12px;
  }
  .nav .logo {
    font-size: 20px;
  }
  .nav .search {
    min-width: 280px;
    max-width: 300px;
    padding: 8px 10px;
  }
  .nav .nav-links a {
    padding: 8px;
  }
}

/* "Me" pill: signed-in name + sign-out button, or "Sign in" link. */
.nav .me-spot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.nav .me-spot .me-user {
  font-weight: 600;
  color: var(--text);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav .me-spot .me-session-note {
  max-width: 240px;
  color: var(--text-muted);
  line-height: 1.2;
}
.nav .me-spot .me-action {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  border: 0;
  cursor: pointer;
}
.nav .me-spot .me-action:hover {
  background: var(--border);
  text-decoration: none;
}
.nav .me-spot .me-loading {
  width: 60px;
  height: 14px;
  background: var(--bg);
  border-radius: 8px;
}

/* Hamburger button + scrim — hidden on desktop, visible on mobile. */
.nav .nav-burger {
  display: none;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-right: -4px;
}
.nav .nav-burger:hover {
  background: var(--bg);
}
.nav .nav-burger span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition:
    transform 0.18s ease,
    opacity 0.18s ease;
}
body.drawer-open .nav .nav-burger span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
body.drawer-open .nav .nav-burger span:nth-child(2) {
  opacity: 0;
}
body.drawer-open .nav .nav-burger span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}
.nav .nav-scrim {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 49;
}
body.drawer-open .nav .nav-scrim {
  display: block;
}

/* Compact breakpoint (≤1300px): the entire .nav-drawer (links + me-spot)
   collapses into a right-side sliding panel. The navbar keeps the
   hamburger + logo row compact and gives search a readable full row. */
@media (max-width: 1300px) {
  .nav {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
  }
  .nav .search {
    flex-basis: 100%;
    min-width: 0;
    max-width: none;
    order: 2;
  }
  .nav .nav-burger {
    display: flex;
  }
  .nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(82vw, 300px);
    background: var(--card);
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.12);
    z-index: 60;
    transform: translateX(100%);
    transition: transform 0.22s ease;
    padding: 64px 16px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    overflow-y: auto;
  }
  .nav-drawer .nav-links {
    flex-direction: column;
    gap: 2px;
  }
  .nav-drawer .nav-links a {
    font-size: 16px;
    padding: 12px 14px;
  }
  .nav-drawer .me-spot {
    align-items: flex-start;
    flex-direction: column;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    justify-content: flex-start;
  }
  .nav-drawer .me-spot .me-session-note {
    max-width: none;
  }
  body.drawer-open .nav-drawer {
    transform: translateX(0);
  }
}

/* ── Three-column layout ────────────────────────────────────── */

.layout {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(0, 590px) minmax(260px, 1fr);
  gap: 16px;
  max-width: 1400px;
  margin: 16px auto;
  padding: 0 16px;
  align-items: start;
}
.layout.rankings-layout {
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(220px, 280px);
}
.layout.rankings-layout--focused {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
}
@media (max-width: 1100px) {
  .layout {
    grid-template-columns: minmax(0, 590px) minmax(220px, 320px);
  }
  .layout.rankings-layout {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  }
  .layout.rankings-layout--focused {
    grid-template-columns: minmax(0, 1fr) minmax(220px, 300px);
  }
  .layout > .left {
    display: none;
  }
}
@media (max-width: 800px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .layout.rankings-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .layout > .right {
    display: none;
  }
}

.layout > .center {
  min-width: 0;
}
.layout > .right,
.layout > .left,
.card,
.card .card-body {
  min-width: 0;
}
.rail {
  position: sticky;
  top: 64px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}
.rail:has(.advisor-evidence-help, .firm-dd-help) {
  overflow: visible;
}

.ab-page-title {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── Cards ──────────────────────────────────────────────────── */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
}
.card:has(.advisor-evidence-help, .firm-dd-help) {
  overflow: visible;
}
.card .card-body {
  padding: 16px;
}
.card .card-section {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}
.card h2.card-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  padding: 16px 16px 0;
}
.card h2.card-title + .card-body {
  padding-top: 10px;
}
.rail .card h2.card-title {
  padding: 12px 14px 0;
}
.rail .card h2.card-title + .card-body {
  padding-top: 8px;
}
.card h3.card-subtitle {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* ── Feed post (article card) ───────────────────────────────── */

.post-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 8px;
}
.post-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.post-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.post-meta .src {
  font-weight: 600;
  font-size: 14px;
}
.post-meta .when {
  font-size: 12px;
  color: var(--text-muted);
}
.post-headline {
  padding: 0 16px 8px;
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
}
.post-headline a {
  color: var(--text);
}
.post-dek {
  padding: 0 16px 12px;
  color: var(--text);
  font-size: 14px;
}
.post-footer {
  display: flex;
  gap: 12px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.post-footer .ext-link {
  margin-left: auto;
}

.article-linkout-card .card-body {
  display: grid;
  gap: 12px;
}

.article-linkout-source {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.5;
}

.article-linkout-button {
  justify-self: start;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 9px 12px;
  text-decoration: none;
}

.article-linkout-button:hover {
  background: var(--brand-dark);
}

/* ── Event cards inside a post ──────────────────────────────── */

.event-card {
  margin: 0 16px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafbfc;
  padding: 12px 14px;
}
.event-card.transition {
  border-left: 3px solid var(--accent-green);
}
.event-card.disclosure {
  border-left: 3px solid var(--accent-red);
}
.event-card .event-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.event-card .firm-arrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}
.event-card .firm-arrow .arrow {
  color: var(--text-muted);
  font-weight: 400;
}
.event-card .stats {
  display: flex;
  gap: 18px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.event-card .stat {
  font-size: 12px;
  color: var(--text-muted);
}
.event-card .stat strong {
  display: block;
  font-size: 16px;
  color: var(--text);
  font-weight: 700;
}
.event-card .deal-strip {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.event-card .allegation {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text);
  font-style: italic;
}
.event-card .sanctions-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.sanction-pill {
  background: #fff0f0;
  border: 1px solid #f4caca;
  color: var(--accent-red);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

/* ── Public regulatory digest ───────────────────────────────── */

.regulatory-digest-card .card-body {
  display: grid;
  gap: 10px;
}

.regulatory-digest-list {
  display: grid;
  gap: 10px;
}

.regulatory-digest-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-red);
  border-radius: 8px;
  background: #fafbfc;
}

.regulatory-digest-rank {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--card);
  color: var(--accent-red);
  font-weight: 800;
  border: 1px solid var(--border);
}

.regulatory-digest-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.regulatory-digest-title,
.regulatory-digest-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.regulatory-digest-title strong,
.regulatory-digest-summary {
  overflow-wrap: anywhere;
}

.regulatory-digest-meta,
.regulatory-digest-summary {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.regulatory-digest-summary {
  color: var(--text);
}

.regulatory-digest-limitations {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 13px;
}

.regulatory-digest-links a {
  font-size: 13px;
  font-weight: 700;
}

/* ── Entity chips (advisors, firms, teams) ──────────────────── */

.chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 16px 12px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  background: var(--chip-bg);
  border: 1px solid transparent;
}
.chip:hover {
  text-decoration: none;
  border-color: var(--border);
}
.chip.firm {
  background: var(--chip-bg-firm);
}
.chip.team {
  background: var(--chip-bg-team);
}
.chip.advisor {
  background: var(--chip-bg-advisor);
}
.chip .chip-kind {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}
.chip .chip-sub {
  font-weight: 400;
  color: var(--text-muted);
}

/* ── Article evidence map ───────────────────────────────────── */

.article-evidence-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.article-evidence-map-group {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
}

.article-evidence-map-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.article-evidence-map-group h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.article-evidence-map-count {
  flex: 0 0 auto;
  min-width: 28px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.article-evidence-map-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.article-evidence-map-row {
  display: grid;
  gap: 2px;
  min-width: 0;
  font-size: 13px;
}

.article-evidence-map-row > a,
.article-evidence-map-row > span:first-child {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 650;
}

.article-evidence-map-detail {
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

/* Even tinier "tag" used in headers / row metadata */
.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--bg);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.tag.danger {
  background: #fbe6e6;
  color: var(--accent-red);
}
.tag.warn {
  background: #fff3df;
  color: var(--accent-amber);
}
.tag.ok {
  background: #e3f3e8;
  color: var(--accent-green);
}

/* ── Research freshness queue rows ──────────────────────────── */

.research-queue-list {
  display: grid;
  gap: 10px;
}

.research-queue-row {
  display: grid;
  grid-template-columns: minmax(14rem, 1.2fr) minmax(12rem, 0.8fr);
  gap: 12px 20px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.research-queue-row:last-child {
  border-bottom: 0;
}

.research-queue-row-identity,
.research-queue-row-field {
  min-width: 0;
}

.research-queue-row-identity {
  display: grid;
  gap: 3px;
}

.research-queue-row-name {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.research-queue-row-name:hover {
  text-decoration: underline;
}

.research-queue-row-firm,
.research-queue-row-crd,
.research-queue-row-label,
.research-queue-row-value {
  display: block;
  overflow-wrap: break-word;
  word-break: normal;
}

.research-queue-row-firm,
.research-queue-row-crd,
.research-queue-row-label {
  color: var(--text-muted);
  font-size: 12px;
}

.research-queue-row-status {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 12rem;
}

.research-queue-row-identity,
.research-queue-row-status,
.research-queue-row-action {
  grid-column: 1 / -1;
}

.research-queue-row-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.research-queue-row-value {
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.research-queue-row-action {
  justify-self: start;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 1100px) {
  .research-queue-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .research-queue-row-identity,
  .research-queue-row-status,
  .research-queue-row-action {
    grid-column: 1 / -1;
  }

  .research-queue-row-action {
    justify-self: start;
  }
}

@media (max-width: 700px) {
  .research-queue-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .research-queue-row-status {
    min-width: 0;
  }
}

/* ── Profile pages ──────────────────────────────────────────── */

.team-mobile-details {
  display: none;
}

.profile-cover {
  background: linear-gradient(135deg, #1877f2 0%, #5e9bf5 100%);
  height: 140px;
  border-radius: 10px 10px 0 0;
}
.profile-head {
  padding: 0 24px 16px;
  margin-top: -42px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.profile-avatar {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  background: var(--card);
  border: 5px solid var(--card);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 36px;
  color: var(--brand);
  flex-shrink: 0;
  overflow: hidden;
}
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.profile-title {
  flex: 1;
  min-width: 220px;
  padding-top: 58px;
  padding-bottom: 8px;
}
.profile-title h1 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
}
.profile-title .subtitle {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 2px;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.profile-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

/* ── Advisor evidence panels ───────────────────────────────── */

.advisor-mobile-evidence {
  display: none;
}
.advisor-evidence {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.advisor-evidence-title,
.firm-dd-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.advisor-evidence-state {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.advisor-evidence-state p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.advisor-evidence-state .tag {
  flex-shrink: 0;
}
.advisor-evidence-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.advisor-evidence-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 8px;
  min-width: 0;
}
.advisor-evidence-metric {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  padding: 9px 10px;
}
.advisor-evidence-metric strong,
.advisor-evidence-metric span {
  display: block;
  overflow-wrap: anywhere;
}
.advisor-evidence-metric strong {
  color: var(--text);
  font-size: 16px;
  line-height: 1.2;
}
.advisor-evidence-metric span {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.3;
}
.advisor-evidence-card--ok {
  border-left: 3px solid var(--accent-green);
}
.advisor-evidence-card--warn {
  border-left: 3px solid var(--accent-amber);
}
.advisor-confidence-bar {
  display: flex;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg);
}
.advisor-confidence-bar__segment {
  min-width: 4px;
}
.advisor-confidence-bar__segment--asserted {
  background: var(--accent-green);
}
.advisor-confidence-bar__segment--inferred {
  background: var(--brand);
}
.advisor-confidence-bar__segment--derived {
  background: var(--accent-amber);
}
.advisor-evidence-help,
.firm-dd-help {
  margin: 0;
  min-width: 0;
  position: relative;
  flex-shrink: 0;
}
.advisor-evidence-help summary,
.firm-dd-help summary {
  display: inline-grid;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}
.advisor-evidence-help[open] summary,
.firm-dd-help[open] summary {
  border-color: var(--brand);
  color: var(--brand);
}
.advisor-evidence-help summary::-webkit-details-marker,
.firm-dd-help summary::-webkit-details-marker {
  display: none;
}
.advisor-evidence-help p,
.firm-dd-help p {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  width: min(280px, calc(100vw - 48px));
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

@media (max-width: 700px) {
  .advisor-evidence-help p,
  .firm-dd-help p {
    position: fixed;
    top: 72px;
    right: 16px;
    left: 16px;
    width: auto;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
  }
}

/* ── Firm due diligence summary ─────────────────────────────── */

.firm-dd {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.firm-dd-summary,
.firm-dd-stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}
.firm-dd-metric {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  padding: 10px 12px;
}
.firm-dd-metric strong {
  display: block;
  font-size: 18px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.firm-dd-metric span,
.firm-dd-metric small {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.firm-dd-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.firm-dd-filter-buttons,
.firm-dd-filter-help {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}
.firm-dd-filter-help {
  align-items: flex-start;
}
.firm-dd-filter.ab-btn,
.firm-dd-filter.ab-btn--primary {
  min-height: 34px;
  max-width: 100%;
  width: auto;
  flex: 0 0 auto;
}
.firm-dd-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.firm-dd-module {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  background: var(--card);
}
.firm-dd-module--loaded {
  border-left: 3px solid var(--accent-green);
}
.firm-dd-module--missing {
  border-left: 3px solid var(--accent-amber);
}
.firm-dd-module[hidden] {
  display: none;
}
.firm-dd-empty {
  min-width: 0;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--bg);
  padding: 14px;
}
.firm-dd-empty[hidden] {
  display: none;
}
.firm-dd-empty strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
}
.firm-dd-empty p {
  margin: 6px 0 12px;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.firm-dd-module-head,
.firm-dd-confidence-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}
.firm-dd-module h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.25;
}
.firm-dd-note,
.firm-dd-missing,
.firm-dd-meta,
.firm-dd-confidence p {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.firm-dd-list {
  display: flex;
  flex-direction: column;
  margin-top: 10px;
  border-top: 1px solid var(--border);
}
.firm-dd-list-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.firm-dd-list-row span,
.firm-dd-list-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}
.firm-dd-list-row strong {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 12px;
  text-align: right;
}
.firm-dd-link-row:hover {
  text-decoration: none;
  background: var(--bg);
}
.firm-dd-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.firm-dd-confidence {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.firm-dd-confidence-modules {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.firm-dd-confidence-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 12px;
  padding: 3px 8px;
}

/* List of advisors / members */
.entity-list {
  display: flex;
  flex-direction: column;
}
.entity-list .row {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  align-items: center;
}
.entity-list .row:first-child {
  border-top: 0;
}
.entity-list .row .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--chip-bg-advisor);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
  overflow: hidden;
}
.entity-list .row .avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.entity-list .row .body {
  flex: 1;
  min-width: 0;
}
.entity-list .row .name {
  font-weight: 600;
}
.entity-list .row .sub {
  color: var(--text-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.entity-list .row .tail {
  color: var(--text-muted);
  font-size: 12px;
  text-align: right;
}

@media (max-width: 800px) {
  .advisor-mobile-evidence {
    display: block;
  }
  .team-mobile-details {
    display: block;
  }
}

@media (max-width: 700px) {
  .profile-cover {
    height: 110px;
  }
  .profile-head {
    padding: 0 16px 16px;
    margin-top: -32px;
    gap: 12px;
  }
  .profile-avatar {
    width: 80px;
    height: 80px;
    font-size: 28px;
    border-width: 4px;
  }
  .profile-title {
    min-width: 0;
    padding-top: 42px;
  }
  .profile-title h1 {
    font-size: 22px;
  }
  .firm-dd-module {
    padding: 12px;
  }
  .firm-dd-list-row {
    flex-direction: column;
    gap: 3px;
  }
  .firm-dd-list-row strong {
    text-align: left;
  }
}

/* ── Paginated list ──────────────────────────────────────────── */

.paginated {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.paginated-status {
  color: var(--text-muted);
  font-size: 13px;
  min-height: 18px;
  padding: 4px 2px;
}
.paginated-load-more {
  align-self: flex-start;
}
.paginated-sentinel {
  height: 1px;
}

/* ── Career timeline (advisor profile) ──────────────────────── */

.timeline {
  padding: 4px 0 0;
}
.timeline .step {
  display: flex;
  gap: 12px;
  padding: 8px 0;
}
.timeline .step .marker {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--brand);
  margin-top: 6px;
  flex-shrink: 0;
  position: relative;
}
.timeline .step:not(:last-child) .marker::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 12px;
  width: 2px;
  height: 100%;
  background: var(--border);
  transform: translateX(-50%);
}
.timeline .step .body {
  flex: 1;
  min-width: 0;
}
.timeline .step .title {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.timeline .step .when {
  color: var(--text-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}
.timeline .step .role {
  color: var(--text-muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.timeline .step .team-continuity-provenance {
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 6px;
}
.timeline .step .team-continuity-provenance summary {
  cursor: pointer;
  font-weight: 700;
}
.timeline .step .team-continuity-provenance ul {
  margin: 6px 0 0;
  padding-left: 18px;
}
.timeline .step .team-continuity-provenance li {
  overflow-wrap: anywhere;
}
.timeline .step .timeline-kind {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  margin-right: 8px;
  text-transform: uppercase;
}
.timeline .step.current .marker {
  background: var(--accent-green);
}
.timeline .step.terminated .marker {
  background: var(--accent-red);
}

/* ── Misc ───────────────────────────────────────────────────── */

.empty {
  color: var(--text-muted);
  font-style: italic;
  padding: 8px 0;
}
.skeleton {
  background: linear-gradient(90deg, #eaecef 0%, #f5f6f7 50%, #eaecef 100%);
  background-size: 200% 100%;
  animation: sk 1.2s infinite;
  border-radius: 8px;
  height: 14px;
  margin: 6px 0;
}
@keyframes sk {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.kvs {
  display: grid;
  grid-template-columns: minmax(110px, max-content) 1fr;
  gap: 4px 14px;
  font-size: 13px;
}
.kvs dt {
  color: var(--text-muted);
}
.kvs dd {
  margin: 0;
  color: var(--text);
}

.snap-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.snap-table th,
.snap-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
.snap-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.snap-table tr:last-child td {
  border-bottom: 0;
}
.snap-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.snap-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
}

/* ── Recruiting market and rankings pages ───────────────────── */

.recruiting-header .card-body,
.rankings-header .card-body {
  display: grid;
  gap: 14px;
}
.recruiting-lede,
.rankings-lede {
  margin: 0;
  color: var(--text-muted);
}
.recruiting-stat-grid,
.rankings-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr));
  gap: 8px;
}
.recruiting-stat,
.rankings-stat {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand) 5%, var(--card));
  padding: 12px;
}
.recruiting-stat-label,
.rankings-stat-label {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
}
.recruiting-stat strong,
.rankings-stat strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 22px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.rankings-top-firms .entity-list .row {
  align-items: flex-start;
  gap: 12px;
}
.rankings-top-firms .entity-list .row .avatar {
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand) 10%, var(--bg));
  color: var(--brand);
  font-size: 10px;
  text-transform: uppercase;
}
.rankings-top-firms .entity-list .row .name {
  overflow-wrap: anywhere;
}
.rankings-top-firms .entity-list .row .tail {
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
}
.rankings-firm-count {
  display: inline-block;
}
.rankings-coverage-workbench .card-body {
  display: grid;
  gap: 16px;
}
.rankings-data-state .card-body {
  display: grid;
  gap: 10px;
}
.rankings-data-state-copy {
  margin: 0;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.rankings-data-state-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}
.rankings-data-state-actions span {
  min-width: 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.rankings-reset-link {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 10px;
  text-decoration: none;
}
.rankings-reset-link:hover {
  border-color: var(--brand);
}
.rankings-reset-placeholder {
  display: none;
}
.rankings-coverage-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.rankings-coverage-metric {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand) 4%, var(--card));
  padding: 12px;
}
.rankings-coverage-metric span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
}
.rankings-coverage-metric strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 20px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}
.rankings-coverage-metric small {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.rankings-coverage-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, 0.85fr);
  gap: 14px;
  align-items: start;
}
.rankings-coverage-panel {
  min-width: 0;
}
.rankings-coverage-panel h3 {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.rankings-coverage-buckets,
.rankings-gap-buckets {
  display: grid;
  gap: 10px;
}
.rankings-coverage-bucket,
.rankings-gap-bucket {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: inherit;
  padding: 12px;
  text-decoration: none;
}
.rankings-coverage-bucket:hover,
.rankings-gap-bucket:hover {
  border-color: var(--brand);
}
.rankings-coverage-meta {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}
.rankings-coverage-meta .tag-list,
.rankings-gap-bucket .tag-list {
  max-width: 100%;
}
.rankings-coverage-meta .tag,
.rankings-gap-bucket .tag {
  white-space: normal;
}
.rankings-coverage-bucket-head,
.rankings-gap-head {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}
.rankings-coverage-bucket-head strong,
.rankings-gap-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
}
.rankings-coverage-bucket-head span,
.rankings-coverage-meta > span {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}
.rankings-bucket-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}
.rankings-bucket-stats span {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand) 3%, var(--bg));
  padding: 7px;
}
.rankings-bucket-stats em {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
  font-style: normal;
}
.rankings-bucket-stats strong {
  display: block;
  font-variant-numeric: tabular-nums;
}
.rankings-sample-rows {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.rankings-sample-rows li {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.rankings-sample-rows strong,
.rankings-sample-rows span {
  overflow-wrap: anywhere;
}
.rankings-sample-rows span {
  color: var(--text-muted);
  font-size: 12px;
}
.recruiting-filters,
.rankings-filters,
.directory-filters,
.feed-filters,
.advisor-directory-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}
.rankings-filters {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.rankings-view-options-form {
  display: grid;
  grid-template-columns: minmax(180px, 260px);
  gap: 10px;
  align-items: end;
}
.directory-filters {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto auto;
  margin-bottom: 12px;
}
.feed-filters {
  grid-template-columns: minmax(150px, 1.4fr) minmax(150px, 1.2fr) auto auto;
}
.advisor-directory-filters {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 128px), 1fr));
}
.filter-field {
  display: grid;
  gap: 4px;
  min-width: 0;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}
.filter-field input,
.filter-field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  padding: 8px 10px;
}
.filter-button {
  height: 37px;
  border: 0;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.filter-button:hover {
  filter: brightness(0.96);
}
.watchlist-firms {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
}
.watchlist-firm-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 37px;
  gap: 6px;
  align-items: end;
  min-width: 0;
}
.watchlist-add-button,
.watchlist-remove-button {
  width: 37px;
  height: 37px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}
.watchlist-add-button:hover,
.watchlist-remove-button:hover {
  background: var(--bg);
}
.feed-filter-clear {
  min-height: 37px;
  border-radius: 8px;
}
.feed-filter-clear[disabled] {
  opacity: 0.55;
  cursor: default;
}
.feed-filter-summary {
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 13px;
}
.recruiting-table,
.rankings-table {
  min-width: 720px;
}
.snap-table-scroll > .recruiting-table {
  min-width: 0;
  table-layout: fixed;
}
.rankings-table {
  min-width: 760px;
  table-layout: fixed;
}
.recruiting-table td,
.rankings-table td {
  vertical-align: top;
}
.recruiting-table th,
.recruiting-table td,
.rankings-table th,
.rankings-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}
.recruiting-table th {
  overflow-wrap: normal;
  word-break: normal;
}
.firm-momentum-table th:first-child,
.firm-momentum-table td:first-child {
  width: 25%;
}
.firm-momentum-table th:nth-child(2),
.firm-momentum-table td:nth-child(2),
.firm-momentum-table th:nth-child(3),
.firm-momentum-table td:nth-child(3) {
  width: 21%;
}
.firm-momentum-table th:nth-child(4),
.firm-momentum-table td:nth-child(4) {
  width: 18%;
}
.firm-momentum-table th:nth-child(5),
.firm-momentum-table td:nth-child(5) {
  width: 15%;
}
.market-activity-table th:first-child,
.market-activity-table td:first-child {
  width: 26%;
}
.recent-moves-table th:first-child,
.recent-moves-table td:first-child {
  width: 15%;
}
.recent-moves-table th:nth-child(2),
.recent-moves-table td:nth-child(2) {
  width: 24%;
}
.recent-moves-table th:nth-child(3),
.recent-moves-table td:nth-child(3),
.recent-moves-table th:nth-child(4),
.recent-moves-table td:nth-child(4) {
  width: 12%;
}
.recent-moves-table th:nth-child(5),
.recent-moves-table td:nth-child(5) {
  width: 15%;
}
.recent-moves-table th:nth-child(6),
.recent-moves-table td:nth-child(6) {
  width: 22%;
}
.recruiting-firm-link {
  color: var(--text);
  font-weight: 700;
}
.stacked-cell {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.stacked-cell span {
  color: var(--text-muted);
  font-size: 12px;
}
.tag-list {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.source-disclosure {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.source-disclosure summary {
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}
.source-disclosure-tags {
  padding-top: 4px;
}
.recruiting-watchlist .card-body {
  display: grid;
  gap: 12px;
}
.watchlist-summary,
.watchlist-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.watchlist-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.watchlist-item,
.watchlist-metric {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}
.watchlist-item {
  display: grid;
  gap: 10px;
  padding: 10px;
}
.watchlist-metric {
  padding: 8px;
}
.watchlist-item-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  min-width: 0;
}
.watchlist-query {
  color: var(--text-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
  text-align: right;
}
.watchlist-metric-label {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}
.watchlist-status {
  padding-top: 2px;
}
.shortlist-brief-hero {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
}
.shortlist-brief-hero h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 26px;
  line-height: 1.15;
}
.shortlist-brief-summary .card-body,
.shortlist-brief-firms .card-body,
.shortlist-firm,
.shortlist-firm-list {
  display: grid;
  gap: 12px;
}
.shortlist-brief-note,
.shortlist-firm-title p,
.shortlist-coverage-limitation {
  margin: 0;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.shortlist-firm {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}
.shortlist-firm-header {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  min-width: 0;
}
.shortlist-firm-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.shortlist-firm-title h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.2;
}
.shortlist-coverage-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.shortlist-coverage-metric {
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
}
.shortlist-coverage-metric span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
}
.shortlist-coverage-metric strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
}
.shortlist-coverage-limitation {
  grid-column: 1 / -1;
  font-size: 13px;
}
.shortlist-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.shortlist-link-list a {
  max-width: 100%;
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.compare-entry-card .card-body,
.compare-entry-action {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.compare-entry-action {
  min-width: 0;
}
.compare-entry-button {
  white-space: nowrap;
}
.compare-entry-button[aria-pressed="true"] {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}
.compare-entry-status {
  min-width: 0;
  color: var(--text-muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.advisor-directory-row {
  align-items: center;
}
.advisor-readiness-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 24px;
  margin: 6px 6px 0 0;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}
.advisor-readiness-badge--ready {
  border-color: var(--success-border, var(--border));
  background: var(--success-bg, var(--chip-bg-firm));
  color: var(--text);
}
.advisor-readiness-badge--missing {
  border-color: var(--warning-border, var(--border));
  background: var(--warning-bg, var(--chip-bg-advisor));
  color: var(--text);
}
.compare-selection-bar {
  position: sticky;
  z-index: 8;
  top: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ab-space-3);
  margin-bottom: var(--ab-space-3);
  padding: var(--ab-space-3);
  border: 1px solid var(--border);
  border-radius: var(--ab-radius-card);
  background: #fff;
  box-shadow: var(--shadow);
}
.compare-selection-bar[hidden] {
  display: none;
}
.compare-selection-count {
  color: var(--text);
  font-weight: 800;
}
.compare-selection-actions {
  display: flex;
  align-items: center;
  gap: var(--ab-space-2);
}
.directory-row-link {
  color: inherit;
  font-weight: 700;
  text-decoration: none;
}
.directory-row-link:hover {
  color: var(--brand);
  text-decoration: underline;
}
.watchlist-body,
.watchlist-entries {
  display: grid;
  gap: 10px;
}
.watchlist-card .watchlist-firm-row {
  grid-template-columns: 20px 32px minmax(140px, 1fr) minmax(120px, 1fr) repeat(
      4,
      auto
    );
  align-items: center;
}
.watchlist-compare-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.watchlist-compare-button {
  width: auto;
}
.watchlist-compare-status {
  color: var(--text-muted);
  font-size: 13px;
}
.watchlist-compare-select {
  width: 16px;
  height: 16px;
  margin: 0;
}
.watchlist-generated {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}
.watchlist-coverage {
  display: grid;
  gap: 4px;
}
.watchlist-coverage-label {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}
.watchlist-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

@media (max-width: 700px) {
  .watchlist-card .watchlist-firm-row {
    grid-template-columns: 20px 32px minmax(0, 1fr);
  }
  .watchlist-card .watchlist-firm-row input[name="note"],
  .watchlist-card .watchlist-firm-row .watchlist-save-note,
  .watchlist-card .watchlist-firm-row .watchlist-remove-button,
  .watchlist-card .watchlist-firm-row .watchlist-status {
    grid-column: 1 / -1;
  }

  .recruiting-stat-grid,
  .rankings-stat-grid,
  .rankings-coverage-summary,
  .rankings-filters,
  .rankings-view-options-form,
  .directory-filters,
  .recruiting-filters,
  .feed-filters,
  .advisor-directory-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rankings-coverage-layout {
    grid-template-columns: 1fr;
  }
  .rankings-bucket-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .rankings-coverage-bucket-head,
  .rankings-gap-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .rankings-data-state-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .filter-button,
  .feed-filter-clear {
    grid-column: 1 / -1;
  }
  .snap-table-scroll:has(.recruiting-table),
  .snap-table-scroll:has(.rankings-table) {
    overflow-x: visible;
  }
  .snap-table-scroll > .rankings-table {
    min-width: 0;
  }
  .recruiting-table,
  .rankings-table,
  .recruiting-table thead,
  .rankings-table thead,
  .recruiting-table tbody,
  .rankings-table tbody,
  .recruiting-table tr,
  .rankings-table tr,
  .recruiting-table th,
  .rankings-table th,
  .recruiting-table td,
  .rankings-table td {
    display: block;
    width: 100%;
  }
  .rankings-table {
    min-width: 0;
    table-layout: fixed;
    width: 100%;
  }
  .rankings-table .tag-list {
    max-width: 100%;
    min-width: 0;
  }
  .rankings-table .tag {
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
  }
  .recruiting-table.firm-momentum-table th,
  .recruiting-table.firm-momentum-table td,
  .recruiting-table.market-activity-table th,
  .recruiting-table.market-activity-table td,
  .recruiting-table.recent-moves-table th,
  .recruiting-table.recent-moves-table td {
    width: 100%;
  }
  .recruiting-table,
  .rankings-table {
    border-collapse: separate;
    border-spacing: 0;
  }
  .recruiting-table thead,
  .rankings-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .recruiting-table tr,
  .rankings-table tr {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    overflow: hidden;
  }
  .recruiting-table tr + tr,
  .rankings-table tr + tr {
    margin-top: 10px;
  }
  .recruiting-table td,
  .rankings-table td {
    display: grid;
    grid-template-columns: minmax(82px, 34%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    min-width: 0;
    border-bottom: 1px solid var(--border);
  }
  .recruiting-table td::before,
  .rankings-table td::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
  }
  .recruiting-table tr:last-child td:not(:last-child),
  .rankings-table tr:last-child td:not(:last-child) {
    border-bottom: 1px solid var(--border);
  }
  .recruiting-table td:last-child,
  .rankings-table td:last-child {
    border-bottom: 0;
  }
  .watchlist-firms,
  .watchlist-grid,
  .shortlist-coverage-grid {
    grid-template-columns: 1fr;
  }
  .shortlist-firm-header {
    flex-direction: column;
  }
  .watchlist-summary,
  .watchlist-metrics {
    grid-template-columns: repeat(3, minmax(80px, 1fr));
    overflow-x: auto;
  }
}

.rail .card .card-body {
  padding: 12px 14px;
}
.rail .card h3.card-subtitle {
  margin-bottom: 10px;
}

.private-rating {
  display: grid;
  gap: 12px;
}
.private-rating-note,
.private-rating-status {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}
.private-rating-note--error {
  color: var(--accent-red);
}
.private-rating-link {
  justify-self: start;
  text-decoration: none;
}
.private-rating-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.private-rating-field {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}
.private-rating-field input,
.private-rating-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 8px 10px;
}
.private-rating-field textarea {
  resize: vertical;
}
.private-rating-field--wide,
.private-rating-save,
.private-rating-status {
  grid-column: 1 / -1;
}
.private-rating-help {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
}

.advisor-correction {
  display: grid;
  gap: 12px;
}
.advisor-correction-note,
.advisor-correction-status {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}
.advisor-correction-note--error {
  color: var(--accent-red);
}
.advisor-correction-open,
.advisor-correction-link {
  justify-self: start;
  text-decoration: none;
}
.advisor-correction-guidance {
  display: grid;
  gap: 10px;
}
.advisor-correction-guidance[hidden] {
  display: none;
}
.advisor-correction-form {
  display: grid;
  gap: 10px;
}
.advisor-correction-field {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}
.advisor-correction-field input,
.advisor-correction-field select,
.advisor-correction-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 8px 10px;
}
.advisor-correction-field textarea {
  resize: vertical;
}
.advisor-correction-field input[readonly] {
  color: var(--text-muted);
}
.advisor-correction-submit,
.advisor-correction-status {
  justify-self: start;
}

.correction-inbox-card {
  overflow-wrap: anywhere;
}

.correction-inbox-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.correction-inbox-field {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.correction-inbox-field select,
.correction-inbox-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  padding: 8px 10px;
}

.correction-inbox-field textarea {
  min-height: 96px;
  resize: vertical;
}

.correction-inbox-status {
  min-height: 20px;
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.comparison-status {
  display: flex;
  align-items: center;
  gap: var(--ab-space-3);
  margin: 0 0 var(--ab-space-4);
}

.comparison-status p {
  margin: 0;
  color: var(--text-muted);
}

.comparison-hero {
  display: grid;
  gap: var(--ab-space-3);
  margin-bottom: var(--ab-space-4);
}

.comparison-hero .profile-head {
  margin-bottom: 0;
}

.comparison-hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--ab-space-3);
}

.comparison-packet-button {
  min-width: 148px;
}

.comparison-start .card-body {
  display: grid;
  gap: var(--ab-space-4);
}

.comparison-start-copy {
  max-width: 720px;
  margin: 0;
  color: var(--text-muted);
  line-height: 1.55;
}

.comparison-start-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--ab-space-3);
}

.comparison-add-control {
  display: grid;
  gap: var(--ab-space-3);
  max-width: 720px;
}

.comparison-add-input {
  width: 100%;
  min-height: 44px;
  padding: 0 var(--ab-space-3);
  border: 1px solid var(--border);
  border-radius: var(--ab-radius-control);
  font: inherit;
}

.comparison-add-results {
  display: grid;
  gap: var(--ab-space-2);
}

.comparison-add-result {
  justify-content: flex-start;
  min-height: 40px;
  white-space: normal;
}

.comparison-add-status {
  min-height: 20px;
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.comparison-start-button {
  min-width: 160px;
}

.comparison-start-link {
  color: var(--ab-color-brand);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.comparison-start-link:hover {
  text-decoration: underline;
}

.comparison-start-steps {
  display: grid;
  gap: var(--ab-space-2);
  margin: 0;
  padding-left: var(--ab-space-5);
  color: var(--text);
  line-height: 1.5;
}

.comparison-card .card-body {
  padding: 0;
}

.comparison-table-wrap {
  overflow-x: auto;
}

.comparison-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  table-layout: fixed;
}

.comparison-table th,
.comparison-table td {
  padding: var(--ab-space-4);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.comparison-table thead th {
  background: var(--bg);
  color: var(--text);
}

.comparison-table tbody th {
  width: 180px;
  color: var(--text);
  font-weight: 700;
}

.comparison-table td {
  color: var(--text-muted);
  line-height: 1.45;
}

.comparison-cell {
  display: grid;
  gap: var(--ab-space-2);
}

.comparison-cell-value {
  color: var(--text);
}

.comparison-missing,
.comparison-brokercheck-missing {
  color: var(--text-muted);
}

.comparison-brokercheck-missing {
  font-size: 12px;
}

.comparison-source-attribution {
  font-size: 12px;
  line-height: 1.4;
}

.comparison-name,
.comparison-firm {
  display: block;
}

.comparison-name {
  color: var(--text);
  font-weight: 700;
}

.comparison-firm {
  margin-top: var(--ab-space-1);
  color: var(--text-muted);
  font-size: 13px;
}

.comparison-private {
  margin-top: var(--ab-space-5);
}

.comparison-private-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--ab-space-4);
}

.comparison-private-card {
  display: grid;
  gap: var(--ab-space-3);
  padding: var(--ab-space-4);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.comparison-private-card h3,
.comparison-private-card h4,
.comparison-private-card p {
  margin: 0;
}

.comparison-private-card h3 {
  color: var(--text);
  font-size: 16px;
}

.comparison-private-card h4 {
  color: var(--text);
  font-size: 13px;
}

.comparison-private-block {
  display: grid;
  gap: var(--ab-space-2);
}

.comparison-private-note,
.comparison-private-review {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.comparison-private-note {
  display: grid;
  gap: var(--ab-space-1);
  font-weight: 700;
}

.comparison-private-note span {
  font-weight: 500;
}

.comparison-private-metrics {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: var(--ab-space-2) var(--ab-space-3);
  margin: 0;
}

.comparison-private-metrics dt,
.comparison-private-metrics dd {
  margin: 0;
  font-size: 13px;
}

.comparison-private-metrics dt {
  color: var(--text-muted);
}

.comparison-private-metrics dd {
  color: var(--text);
  font-weight: 700;
  text-align: right;
}

.comparison-column-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--ab-space-1);
  margin-top: var(--ab-space-2);
}

.comparison-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 6px;
  color: var(--text-muted);
}

.comparison-control:hover:not([disabled]),
.comparison-control:focus-visible {
  color: var(--text);
  background: var(--bg);
}

.comparison-control .ab-icon,
.comparison-control svg {
  width: 16px;
  height: 16px;
}

.comparison-remove:hover:not([disabled]),
.comparison-remove:focus-visible {
  color: var(--accent-red);
}

.comparison-control[disabled] {
  cursor: not-allowed;
  opacity: 0.45;
}

.report-packet-hero {
  display: grid;
  gap: var(--ab-space-3);
  margin-bottom: var(--ab-space-4);
}

.report-packet-hero h2 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  line-height: 1.2;
}

.report-packet-summary .card-body {
  display: grid;
  gap: var(--ab-space-4);
}

.report-packet-metadata {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--ab-space-3);
  margin: 0;
}

.report-packet-metadata-row {
  display: grid;
  gap: var(--ab-space-1);
  min-width: 0;
}

.report-packet-metadata dt,
.report-packet-metadata dd {
  margin: 0;
}

.report-packet-metadata dt {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.report-packet-metadata dd {
  color: var(--text);
  overflow-wrap: anywhere;
}

.report-packet-advisors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--ab-space-3);
}

.report-packet-advisor {
  display: grid;
  align-content: start;
  gap: var(--ab-space-3);
  padding: var(--ab-space-4);
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
}

.report-packet-advisor h3,
.report-packet-advisor p,
.report-packet-attribution h4 {
  margin: 0;
}

.report-packet-advisor h3 {
  color: var(--text);
  font-size: 16px;
}

.report-packet-advisor-subtitle {
  color: var(--text-muted);
  line-height: 1.45;
}

.report-packet-evidence {
  display: grid;
  gap: var(--ab-space-2);
  margin: 0;
}

.report-packet-evidence-row {
  display: grid;
  gap: 2px;
}

.report-packet-evidence dt {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.report-packet-evidence dd {
  margin: 0;
  color: var(--text);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.report-packet-source-appendix {
  display: grid;
  gap: var(--ab-space-4);
  margin-top: var(--ab-space-5);
}

.report-packet-source-appendix h3,
.report-packet-source-advisor h4 {
  color: var(--text);
}

.report-packet-source-appendix h3 {
  font-size: 18px;
}

.report-packet-source-grid {
  display: grid;
  gap: var(--ab-space-3);
}

.report-packet-source-advisor {
  display: grid;
  gap: var(--ab-space-3);
  padding: var(--ab-space-4);
  border: 1px solid var(--border);
  border-radius: var(--ab-radius-md);
  background: var(--ab-color-surface);
}

.report-packet-source-advisor h4 {
  font-size: 15px;
}

.report-packet-source-advisor dl {
  display: grid;
  gap: var(--ab-space-3);
  margin: 0;
}

.report-packet-source-row {
  display: grid;
  gap: var(--ab-space-1);
}

.report-packet-source-row dt {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.report-packet-source-row dd {
  margin: 0;
  color: var(--text);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.report-packet-source-row ul {
  display: grid;
  gap: var(--ab-space-1);
  margin: 0;
  padding-left: 18px;
}

.report-packet-source-row li {
  color: var(--text-muted);
  line-height: 1.45;
}

@media (max-width: 700px) {
  .comparison-hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .comparison-packet-button {
    width: 100%;
  }

  .comparison-status {
    align-items: flex-start;
    flex-direction: column;
  }

  .comparison-start-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .compare-selection-bar {
    align-items: stretch;
    flex-direction: column;
    top: 56px;
  }

  .compare-selection-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .comparison-start-button,
  .comparison-start-link,
  .compare-selection-actions button {
    width: 100%;
  }

  .comparison-start-link {
    text-align: center;
  }

  .comparison-table-wrap {
    overflow-x: visible;
  }

  .comparison-table {
    display: block;
    min-width: 0;
  }

  .comparison-table thead,
  .comparison-table tbody,
  .comparison-table tr,
  .comparison-table th,
  .comparison-table td {
    display: block;
  }

  .comparison-table thead tr {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: var(--ab-space-3);
    padding: var(--ab-space-3);
  }

  .comparison-table thead th:first-child {
    display: none;
  }

  .comparison-table thead th {
    border: 1px solid var(--border);
    border-radius: 8px;
  }

  .comparison-table tbody {
    display: grid;
    gap: var(--ab-space-4);
    padding: 0 var(--ab-space-3) var(--ab-space-3);
  }

  .comparison-table tbody tr {
    display: grid;
    gap: var(--ab-space-2);
    padding-top: var(--ab-space-3);
    border-top: 1px solid var(--border);
  }

  .comparison-table tbody th {
    width: auto;
    padding: 0;
    border-bottom: 0;
  }

  .comparison-table tbody td {
    padding: var(--ab-space-3);
    border: 1px solid var(--border);
    border-radius: 8px;
  }

  .comparison-table tbody td::before {
    content: attr(data-advisor-label);
    display: block;
    margin-bottom: var(--ab-space-2);
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
  }
}

@media print {
  body {
    background: #fff;
    color: #111;
  }

  header.site-header,
  footer.site-footer,
  .comparison-hero-actions,
  .comparison-column-controls,
  .comparison-private .ab-btn {
    display: none !important;
  }

  .page,
  .full-width-page,
  .full-width-main,
  main {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .report-packet-hero,
  .report-packet-summary,
  .comparison-private {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .report-packet-hero h2 {
    color: #111;
    font-size: 22pt;
  }

  .report-packet-summary.card,
  .comparison-private.card,
  .report-packet-advisor,
  .report-packet-source-advisor,
  .comparison-private-card {
    border: 1px solid #bbb;
    box-shadow: none;
    background: #fff;
  }

  .report-packet-summary .card-body,
  .comparison-private .card-body {
    gap: 12pt;
  }

  .report-packet-advisors,
  .report-packet-source-grid,
  .comparison-private-grid {
    grid-template-columns: 1fr;
  }

  .report-packet-advisor,
  .report-packet-source-advisor,
  .comparison-private-card {
    break-inside: avoid;
    page-break-inside: avoid;
    padding: 12pt;
  }

  .report-packet-metadata dt,
  .report-packet-evidence dt,
  .report-packet-source-row dt,
  .comparison-private-metrics dt {
    color: #444;
  }

  .report-packet-metadata dd,
  .report-packet-evidence dd,
  .report-packet-source-row dd,
  .comparison-private-card p,
  .comparison-private-metrics dd {
    color: #111;
  }

  .report-packet-source-row li {
    color: #222;
  }
}

footer.site-footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  padding: 24px 0 40px;
}

.site-version {
  font-variant-numeric: tabular-nums;
}
