/* ============================================
   FIRM — firm-by-firm interview prep page styles.
   Reuses tokens from variables.css + components.css.
   ============================================ */

#firm-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6);
}

.firm-loading {
  text-align: center;
  padding: var(--space-16) var(--space-6);
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  /* Deferred: invisible for 350ms so a cached firm page render doesn't flash the spinner. */
  opacity: 0;
  animation: firm-loading-appear 0.2s ease 0.35s forwards;
}
@keyframes firm-loading-appear { to { opacity: 1; } }
.firm-loading__spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: firm-spin 0.8s linear infinite;
}
@keyframes firm-spin { to { transform: rotate(360deg); } }
.firm-loading__text { font-size: var(--text-sm); }

.firm-error {
  text-align: center;
  padding: var(--space-16) var(--space-6);
  color: var(--text-muted);
}
.firm-error h1 { color: var(--text-color); margin-bottom: var(--space-4); }

/* ---- Hero ---- */
.firm-hero {
  margin-bottom: var(--space-8);
}
.firm-hero__back {
  margin-bottom: var(--space-4);
}
.firm-hero__back a {
  color: var(--accent-primary);
  text-decoration: none;
  font-size: var(--text-sm);
}
.firm-hero__top {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  margin-bottom: var(--space-4);
}
.firm-hero__logo {
  height: 56px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
}
.firm-hero__title {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  margin: 0;
  line-height: 1.1;
}
.firm-hero__tagline {
  color: var(--text-muted);
  font-size: var(--text-base);
  margin-top: var(--space-1);
}
.firm-hero__blurb {
  color: var(--text-color);
  font-size: var(--text-lg);
  line-height: 1.6;
  max-width: 800px;
  margin: 0 0 var(--space-5) 0;
}
.firm-hero__ctas {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}

/* ---- Stat strip ---- */
.firm-stats {
  display: flex;
  gap: var(--space-6);
  flex-wrap: wrap;
  padding: var(--space-4) var(--space-5);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-8);
}
.firm-stats__item { display: flex; flex-direction: column; }
.firm-stats__n {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text-color);
  line-height: 1;
}
.firm-stats__l {
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: var(--space-1);
}
.firm-stats__item--diff { gap: var(--space-1); align-self: center; }
.firm-stats__diff { font-size: var(--text-sm); color: var(--text-muted); }
.firm-stats__diff--e { color: #10b981; }
.firm-stats__diff--m { color: #f59e0b; }
.firm-stats__diff--h { color: #ef4444; }

/* ---- Body layout: funnel rail + stages ---- */
/* .firm-body is just the positioning context (the gate overlays it). The
   240px/1fr grid lives on .firm-body__inner so it applies in BOTH the gated
   and unlocked cases — the inner wrapper is the real two-column container. */
.firm-body { position: relative; }
.firm-body__inner {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--space-8);
  align-items: start;
}

@media (max-width: 900px) {
  .firm-body__inner {
    grid-template-columns: 1fr;
  }
}

/* ---- Funnel rail (sticky on desktop) ---- */
.firm-rail {
  position: sticky;
  top: var(--space-6);
}
.firm-rail__heading {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}
.firm-rail__list { list-style: none; padding: 0; margin: 0; }
.firm-rail__item { margin: 0; }
.firm-rail__link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-color);
  font-size: var(--text-sm);
  transition: background var(--transition-base);
}
.firm-rail__link:hover {
  background: var(--bg-card);
}
.firm-rail__num {
  display: inline-block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--border-color);
  color: var(--text-muted);
  font-weight: var(--font-bold);
  font-size: var(--text-xs);
  line-height: 24px;
  text-align: center;
  flex-shrink: 0;
  transition: background var(--transition-base), color var(--transition-base);
}
.firm-rail__title { line-height: 1.3; }

/* "How this interview works" trigger — sits between heading and stage list */
.firm-rail__overview-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-3);
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-sm);
  color: var(--accent-primary);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition-base), border-color var(--transition-base), transform var(--transition-base);
}
.firm-rail__overview-btn:hover {
  background: rgba(99, 102, 241, 0.14);
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}
.firm-rail__overview-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}
.firm-rail__overview-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: white;
  font-weight: var(--font-bold);
  font-size: 11px;
  flex-shrink: 0;
}
.firm-rail__overview-label { line-height: 1.2; }

/* Active stage (scroll-spy highlights it) */
.firm-rail__item--active .firm-rail__link {
  background: var(--bg-card);
  font-weight: var(--font-bold);
  color: var(--text-color);
}
.firm-rail__item--active .firm-rail__num {
  background: var(--accent-primary);
  color: white;
}

/* ---- Stage section ---- */
.firm-stages { display: flex; flex-direction: column; gap: var(--space-10); }
.firm-stage {
  padding-top: var(--space-2);
  scroll-margin-top: 80px;
}
.firm-stage__head {
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
  flex-wrap: wrap;
  margin-bottom: var(--space-2);
}
.firm-stage__title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  margin: 0;
}
.firm-stage__format {
  font-size: var(--text-xs);
  color: var(--text-muted);
  background: var(--bg-card);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.firm-stage__blurb {
  color: var(--text-muted);
  font-size: var(--text-base);
  line-height: 1.5;
  margin: 0 0 var(--space-3) 0;
}
.firm-stage__blurb strong,
.firm-overview-modal__stage-body strong,
.round-overview__blurb strong {
  color: var(--text-primary, var(--text-color));
  font-weight: var(--font-semibold);
}

/* ---- Structured blurb sections ----
   A blurb with `**Label:**` markers gets rendered as an intro paragraph
   plus a definition-list of labeled sections. Lets long, multi-part
   stages (e.g. JS Super Day morning/lunch/afternoon) read as scannable
   chunks instead of a wall of prose. Used on firm.html, round.html
   overview, and the interview-walkthrough modal. */
.firm-blurb__intro {
  color: var(--text-secondary);
  font-size: var(--text-base);
  line-height: 1.55;
  margin: 0 0 var(--space-3) 0;
}
.firm-blurb__sections {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin: 0 0 var(--space-3) 0;
  padding: 0;
}
.firm-blurb__section {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--bg-secondary, #f8fafc);
  border-left: 3px solid var(--accent-primary);
  border-radius: var(--radius-sm);
  margin: 0;
}
.firm-blurb__label {
  font-size: 11px;
  font-weight: var(--font-bold);
  color: var(--accent-primary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  align-self: start;
  padding-top: 2px;
  line-height: 1.4;
}
.firm-blurb__body {
  margin: 0;
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--text-primary, var(--text-color));
}
.firm-blurb__body strong { color: var(--text-primary, var(--text-color)); }
@media (max-width: 600px) {
  .firm-blurb__section {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: var(--space-2) var(--space-3);
  }
  .firm-blurb__label { padding-top: 0; }
}
/* "Practice this round →" CTA below the blurb. Subtle outline button that
   leads to the dedicated round.html prep page. */
.firm-stage__prep-cta-count {
  display: inline-block;
  margin: 0 var(--space-1);
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
  font-size: 10px;
  font-weight: var(--font-bold);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  vertical-align: 1px;
}
.firm-stage__prep-cta:hover .firm-stage__prep-cta-count {
  background: rgba(255, 255, 255, 0.20);
  color: white;
}
/* "GAME" callout — surfaces a trading-game when one is tagged for this
   stage (data/trading-games.json -> firms[]/stages[]). Styled as a
   gamified "launch" button: play/icon badge on the left, a PLAY pill on
   the right, vibrant accent, lifts + glows on hover. Sits below the
   practice set so the problems lead and the games read as a bonus. */
.firm-stage__games {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-4);
}
.firm-stage__game-cta {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(76, 139, 245, 0.16), transparent 60%),
    linear-gradient(120deg, var(--accent-light), rgba(76, 139, 245, 0.02));
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg, 14px);
  text-decoration: none;
  color: var(--text-primary, var(--text-color));
  transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
}
.firm-stage__game-cta:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 10px 28px -8px var(--accent-glow), 0 2px 8px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}
/* Circular launch badge holding the dice/coin/play icon. */
.firm-stage__game-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  box-shadow: 0 4px 12px -2px var(--accent-glow);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.firm-stage__game-cta:hover .firm-stage__game-icon {
  transform: scale(1.07) rotate(-4deg);
  box-shadow: 0 6px 16px -2px var(--accent-glow);
}
.firm-stage__game-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.firm-stage__game-toprow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.firm-stage__game-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 10px;
  background: var(--accent-primary);
  color: white;
  border-radius: 4px;
  font-size: 10px;
  font-weight: var(--font-bold);
  letter-spacing: 0.12em;
}
.firm-stage__game-label {
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  color: var(--text-primary, var(--text-color));
}
.firm-stage__game-meta {
  font-size: 10px;
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  padding: 2px 7px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
}
.firm-stage__game-meta--diff {
  color: var(--accent-primary);
  border-color: var(--accent-border);
}
.firm-stage__game-blurb {
  font-size: var(--text-xs);
  line-height: 1.4;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* PLAY pill — the "press me" affordance. */
.firm-stage__game-play {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--accent-primary);
  color: white;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  transition: background var(--transition-base), transform var(--transition-base);
}
.firm-stage__game-play-arrow {
  font-size: 9px;
  transition: transform var(--transition-base);
}
.firm-stage__game-cta:hover .firm-stage__game-play {
  background: var(--accent-hover);
}
.firm-stage__game-cta:hover .firm-stage__game-play-arrow {
  transform: translateX(3px);
}
@media (max-width: 760px) {
  .firm-stage__games {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .firm-stage__game-cta {
    grid-template-columns: auto 1fr;
    gap: var(--space-3);
  }
  .firm-stage__game-play {
    grid-column: 2 / 3;
    justify-self: start;
    margin-top: 2px;
  }
}

.firm-stage__prep-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--accent-primary);
  color: var(--accent-primary);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  text-decoration: none;
  margin-bottom: var(--space-4);
  transition: background var(--transition-base), color var(--transition-base), transform var(--transition-base);
}
.firm-stage__prep-cta:hover {
  background: var(--accent-primary);
  color: white;
  transform: translateY(-1px);
}

/* ---- Editorial tips — card-grid design ---- */
.firm-tips {
  margin: var(--space-5) 0 var(--space-6) 0;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
}
.firm-tips__header {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border-color);
}
.firm-tips__eyebrow {
  font-size: 10px;
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.10);
  padding: 3px 8px;
  border-radius: 4px;
}
.firm-tips__title {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-muted);
  margin: 0;
  letter-spacing: 0.01em;
}
.firm-tips__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: var(--space-3);
}
.firm-tip {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-primary);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-4);
  transition: border-color var(--transition-base), box-shadow var(--transition-base), transform var(--transition-base);
}
.firm-tip:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.08);
  transform: translateY(-1px);
}
.firm-tip__heading {
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  color: var(--accent-primary);
  margin-bottom: var(--space-2);
  letter-spacing: -0.005em;
  line-height: 1.3;
}
.firm-tip__body {
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--text-color);
}
.firm-tip__body strong {
  color: var(--text-color);
}
/* Card variants */
.firm-tip--has-math {
  /* Math-heavy cards get slightly more vertical room so display math
     doesn't collide with the card edges. */
  padding-top: var(--space-4);
  padding-bottom: var(--space-4);
}
.firm-tip--has-math .firm-tip__body {
  font-size: var(--text-sm);
}
.firm-tip--has-math .katex {
  font-size: 1em; /* don't blow it up; match body text size */
}
.firm-tip--bodyonly .firm-tip__body {
  /* No heading → bump the body a touch for visual weight balance */
  font-size: var(--text-sm);
}
/* Inline KaTeX in tips gets a subtle background tint so it doesn't
   bleed into surrounding text — gives the math a "lifted" feel. */
.firm-tip .katex {
  padding: 0 1px;
}
.firm-tip .katex-display {
  margin: var(--space-3) 0;
  padding: var(--space-3) var(--space-2);
  background: rgba(99, 102, 241, 0.05);
  border-radius: var(--radius-sm);
}

/* ---- Problem grid ---- */
.firm-stage__grid {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.firm-row {
  display: grid;
  grid-template-columns: 56px 1fr 160px 80px 30px;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  text-decoration: none;
  color: var(--text-color);
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-base);
}
.firm-row:last-child { border-bottom: none; }
.firm-row:hover { background: var(--bg-card); }
.firm-row__did {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}
.firm-row__title {
  font-weight: var(--font-medium);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0; /* let title-text truncate inside grid */
}
.firm-row__title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.firm-row__category {
  color: var(--text-muted);
  font-size: var(--text-xs);
  text-transform: capitalize;
}
.firm-row__diff {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: var(--font-bold);
}
.firm-row__diff--easy { color: #10b981; }
.firm-row__diff--medium { color: #f59e0b; }
.firm-row__diff--hard { color: #ef4444; }
.firm-row__lock { font-size: 14px; opacity: 0.6; }

/* Unified status node — one circle that shows check / lock / neutral.
   Matches the playlist row design (css/playlist.css .pl-row__node) so a
   problem's solved/attempted/locked state looks identical site-wide.
   Also loaded on round.html (which pulls in firm.css). */
.statnode {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 1; font-size: 0;
  background: color-mix(in srgb, var(--text-muted) 13%, transparent);
  color: var(--text-muted); border: 1px solid transparent;
  transition: transform .14s ease, box-shadow .14s ease;
}
.statnode svg { width: 15px; height: 15px; }
.firm-row:hover .statnode { transform: scale(1.06); }
.statnode--solved { background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; box-shadow: 0 3px 10px -2px rgba(34,197,94,.5); }
.statnode--attempted { background: color-mix(in srgb, #f5b731 22%, transparent); color: #a16207; border-color: color-mix(in srgb, #f5b731 45%, transparent); }
.statnode--locked { background: transparent; color: var(--text-muted); border-color: var(--border-color); }
.statnode--locked svg { width: 13px; height: 13px; }
html[data-theme=dark] .statnode--attempted { color: #fbbf24; }

/* "Must-do" pinned rows (editorial.mustDoIds in firm JSON) */
.firm-row--mustdo {
  background: linear-gradient(90deg, rgba(99,102,241,0.06), transparent 60%);
  border-left: 3px solid var(--accent-primary, var(--accent));
}
.firm-row--mustdo .firm-row__did { color: var(--accent-primary, var(--accent)); font-weight: var(--font-bold); }
.firm-row__mustdo {
  font-size: 10px;
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-primary, var(--accent));
  background: rgba(99,102,241,0.12);
  padding: 2px 6px;
  border-radius: 3px;
  white-space: nowrap;
}
/* "seen YYYY-MM" — when this problem was reported in interviews at this firm
   (from the scraped post dates). Sits inside the title cell. */
.firm-row__seen {
  flex: none;
  margin-left: auto;
  font-size: 10px;
  font-weight: var(--font-semibold);
  color: var(--text-muted);
  background: var(--bg-subtle, rgba(127,127,127,0.10));
  border: 1px solid var(--border-color);
  padding: 1px 7px;
  border-radius: 999px;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .firm-row {
    grid-template-columns: 40px 1fr 60px;
  }
  .firm-row__category { display: none; }
}

.firm-stage__empty {
  padding: var(--space-4);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.firm-stage__empty a { color: var(--accent-primary); }

.firm-stage__editorial-only {
  padding: var(--space-4);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: var(--text-sm);
  font-style: italic;
}

/* ---- Wrap-up ---- */
.firm-wrapup {
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-color);
}
.firm-wrapup__title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  margin: 0 0 var(--space-4) 0;
}
.firm-wrapup__list {
  list-style: disc;
  padding-left: var(--space-5);
  margin: 0 0 var(--space-4) 0;
}
.firm-wrapup__list li {
  font-size: var(--text-base);
  line-height: 1.5;
  margin-bottom: var(--space-2);
}
.firm-wrapup__links a { color: var(--accent-primary); font-size: var(--text-sm); }

/* ====================================================================
   FIRM-AT-A-GLANCE — profile chips, pillars pipeline, comp table, context.
   Schema-2 only; firms without the data render nothing here.
   ==================================================================== */

/* Shared section header (used by all four new sections) */
.firm-section-head { margin-bottom: var(--space-4); }
.firm-section-head__title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  margin: 0 0 var(--space-2) 0;
  line-height: 1.2;
}
.firm-section-head__desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
  max-width: 760px;
}

/* In-page jump nav (top of page, under stat strip) */
.firm-jumpnav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0 0 var(--space-8) 0;
  padding: var(--space-2);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}
.firm-jumpnav__link {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background var(--transition-base), color var(--transition-base);
}
.firm-jumpnav__link:hover {
  background: rgba(99, 102, 241, 0.08);
  color: var(--accent-primary);
}

/* ---- At-a-glance: profile chip strip + culture notes ---- */
.firm-profile { margin-bottom: var(--space-10); scroll-margin-top: 80px; }
.firm-profile__chips {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}
.firm-profile__chip {
  padding: var(--space-3);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}
.firm-profile__chip-label {
  font-size: 10px;
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.firm-profile__chip-value {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-color);
}
.firm-profile__notes p {
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--text-color);
  margin: 0 0 var(--space-2) 0;
}
.firm-profile__culture strong, .firm-profile__vibe strong { color: var(--accent-primary); }

/* Tier list — editorial S/A/B/C ratings shown as colored badges + label */
.firm-tier {
  margin-top: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}
.firm-tier__heading {
  font-size: 10px;
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
}
.firm-tier__list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr));
  gap: var(--space-2);
}
.firm-tier__row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.firm-tier__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  font-weight: var(--font-bold);
  font-size: var(--text-sm);
  font-family: var(--font-mono);
  flex-shrink: 0;
}
.firm-tier__badge--s { background: #fde047; color: #713f12; }       /* S — gold */
.firm-tier__badge--a { background: #86efac; color: #14532d; }       /* A — green */
.firm-tier__badge--b { background: #93c5fd; color: #1e3a8a; }       /* B — blue */
.firm-tier__badge--c { background: #fcd34d; color: #78350f; }       /* C — amber */
.firm-tier__badge--d { background: #fca5a5; color: #7f1d1d; }       /* D — red */
.firm-tier__label {
  font-size: var(--text-sm);
  color: var(--text-color);
}

/* ---- Pillars: research-pipeline visualization ---- */
.firm-pillars { margin-bottom: var(--space-10); scroll-margin-top: 80px; }
.firm-pillars__pipeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
  position: relative;
}
.firm-pillar {
  position: relative;
  padding: var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.firm-pillar::after {
  content: '→';
  position: absolute;
  top: 50%;
  right: -18px;
  transform: translateY(-50%);
  font-size: 20px;
  font-weight: var(--font-bold);
  color: var(--accent-primary);
  opacity: 0.4;
  z-index: 1;
  pointer-events: none;
}
.firm-pillar:last-child::after { display: none; }
/* Hide arrows whenever the grid is even slightly cramped — auto-fit may
   wrap unpredictably with 5+ stages or narrow viewports, and a trailing
   arrow on a wrapped row looks broken. The "→" is decorative anyway;
   the numbered pills carry the order. */
@media (max-width: 1100px) {
  .firm-pillar::after { display: none; }
}
/* Grid layout (HRT, Jane Street, Citadel) — peer units, not a sequential
   pipeline. No arrows, no numbered pills. Used when pillars.layout="grid". */
.firm-pillar--grid::after { display: none !important; }
.firm-pillars--grid .firm-pillar__name {
  /* Slightly larger name since we drop the number pill */
  font-size: var(--text-lg);
}
.firm-pillar__num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: white;
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  text-align: center;
  line-height: 24px;
  margin-bottom: var(--space-1);
}
.firm-pillar__head {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.firm-pillar__name {
  font-size: var(--text-base);
  font-weight: var(--font-bold);
  margin: 0;
  line-height: 1.2;
}
.firm-pillar__owner {
  font-size: var(--text-xs);
  color: var(--accent-primary);
  font-weight: var(--font-medium);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.firm-pillar__focus {
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text-color);
  margin: 0;
}
.firm-pillar__iv {
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 1px dashed var(--border-color);
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.4;
}
.firm-pillar__iv-label {
  display: block;
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-primary);
  margin-bottom: 2px;
}

/* ---- Compensation: role × total table with mini-bars ---- */
.firm-comp { margin-bottom: var(--space-10); scroll-margin-top: 80px; }
.firm-comp__table {
  display: grid;
  grid-template-columns: 1fr;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.firm-comp__header, .firm-comp__row {
  display: grid;
  grid-template-columns: 240px 1fr 240px;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4);
  align-items: center;
  border-bottom: 1px solid var(--border-color);
}
.firm-comp__row:last-child { border-bottom: none; }
.firm-comp__header {
  background: var(--bg-card);
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.firm-comp__role { display: flex; flex-direction: column; gap: 2px; }
.firm-comp__role-name {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-color);
}
.firm-comp__role-level {
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.firm-comp__bar-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.firm-comp__bar-track {
  position: relative;
  height: 10px;
  background: var(--bg-card);
  border-radius: 999px;
  overflow: hidden;
}
.firm-comp__bar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  background: linear-gradient(90deg, var(--accent-primary), rgba(99, 102, 241, 0.6));
  border-radius: 999px;
}
.firm-comp__bar-label {
  font-size: var(--text-xs);
  font-weight: var(--font-bold);
  color: var(--text-color);
  font-family: var(--font-mono);
}
.firm-comp__notes {
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: 1.4;
}
.firm-comp__updated {
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-align: right;
}
@media (max-width: 800px) {
  .firm-comp__header, .firm-comp__row {
    grid-template-columns: 1fr;
    gap: var(--space-2);
  }
  .firm-comp__header > div:not(:first-child) { display: none; }
}

/* ---- Context: kind-tagged cards ---- */
.firm-context { margin-bottom: var(--space-10); scroll-margin-top: 80px; }
.firm-context__list {
  display: grid;
  /* min() so the grid never overflows the viewport on narrow screens (Codex 2026-05-22) */
  grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr));
  gap: var(--space-3);
}
.firm-context__item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}
.firm-context__icon {
  font-size: 20px;
  line-height: 1;
}
.firm-context__title {
  font-size: var(--text-sm);
  font-weight: var(--font-bold);
  margin: 0 0 var(--space-1) 0;
  line-height: 1.2;
  color: var(--text-color);
}
.firm-context__text {
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0;
}

/* ---- Back-to-top floating button (appears after scrolling) ---- */
.firm-totop {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--accent-primary);
  color: white;
  font-size: 20px;
  font-weight: var(--font-bold);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-base), transform var(--transition-base);
  z-index: 50;
}
.firm-totop:hover { transform: translateY(-2px); }
.firm-totop--visible { opacity: 1; pointer-events: auto; }
@media (max-width: 600px) {
  .firm-totop { bottom: var(--space-4); right: var(--space-4); }
}

/* ---- Phone pass: keep firm pages within a 360px viewport, zero h-overflow ----
   firm.css is shared by firm.html, firm-about.html and round.html, so these
   rules also tame the at-a-glance sections (chips/pillars/comp/context) that
   render on firm-about.html. Everything below lives inside max-width media
   queries so desktop (>768px) is untouched. */
@media (max-width: 768px) {
  /* Trim page gutters so the inner content box isn't squeezed on a 360px phone. */
  #firm-content { padding: var(--space-6) var(--space-4); }

  /* Hero: logo can be a wide wordmark — never let it push past the viewport. */
  .firm-hero { margin-bottom: var(--space-6); }
  .firm-hero__top { gap: var(--space-4); }
  .firm-hero__logo { max-width: 70vw; }
  .firm-hero__title { font-size: var(--text-2xl); }
  .firm-hero__blurb { font-size: var(--text-base); }
  .firm-hero__ctas .btn { flex: 1 1 auto; text-align: center; }

  /* Stat strip: smaller gaps so the 3 items wrap cleanly instead of overflowing. */
  .firm-stats { gap: var(--space-4) var(--space-5); }
  .firm-stats__item--diff { align-self: flex-start; }

  /* Funnel rail spacing once it's stacked above the stages (≤900px = 1 col). */
  .firm-rail { position: static; margin-bottom: var(--space-6); }

  /* Stage rhythm tightens a touch on phones. */
  .firm-stages { gap: var(--space-8); }

  /* Long words in prose/blurbs shouldn't force a horizontal scrollbar. */
  .firm-hero__blurb,
  .firm-stage__blurb,
  .firm-blurb__intro,
  .firm-blurb__body,
  .firm-tip__body,
  .firm-profile__notes p,
  .firm-context__text,
  .firm-pillar__focus { overflow-wrap: break-word; word-break: break-word; }

  /* At-a-glance (firm-about.html): single-column the pipeline / cards so the
     220px min-track can't overflow a ~312px content box. */
  .firm-pillars__pipeline { grid-template-columns: 1fr; }
  .firm-pillar { padding: var(--space-3) var(--space-4); }
  .firm-jumpnav { margin-bottom: var(--space-6); }
}

/* ---- Polished problem-row layout for narrow viewports ---- */
@media (max-width: 600px) {
  /* Stage header: title + format chip stack-friendly; KaTeX/long titles wrap. */
  .firm-stage__title,
  .firm-section-head__title { overflow-wrap: break-word; }
  /* Game CTA blurb can be long — already nowrap+ellipsis, but keep it from
     forcing width: the icon+main+play grid is constrained at 600 elsewhere. */
  .firm-stage__game-label { overflow-wrap: break-word; }
  /* Reported-in-interviews date column can be tighter on a phone. */
  .firm-report { gap: var(--space-2); }
}

@media (max-width: 480px) {
  .firm-hero__top { flex-direction: column; align-items: flex-start; gap: var(--space-3); }
  .firm-hero__logo { height: 40px; max-width: 80vw; }
  .firm-hero__title { font-size: var(--text-2xl); }
  .firm-stats { gap: var(--space-3); padding: var(--space-3); }
  .firm-stats__n { font-size: var(--text-xl); }
  /* Page gutters: drop to the smallest comfortable padding at true phone width. */
  #firm-content { padding: var(--space-5) var(--space-3); }
  /* Profile chips: 2-up minimum so labels stay legible on a 360px screen. */
  .firm-profile__chips { grid-template-columns: repeat(auto-fill, minmax(min(120px, 100%), 1fr)); }
}

/* ============================================
   Interview-stages overview modal — opened from the funnel rail's
   "How this interview works" button. Walks through every stage at a
   glance so users don't have to click each one to know what's coming.
   ============================================ */

body.has-modal-open { overflow: hidden; }

.firm-overview-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: firm-overview-fadein 0.18s ease-out;
}
.firm-overview-modal[hidden] { display: none; }
@keyframes firm-overview-fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.firm-overview-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 28, 0.55);
  backdrop-filter: blur(2px);
}
.firm-overview-modal__card {
  position: relative;
  background: var(--bg-primary, #ffffff);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  width: 100%;
  max-width: 720px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: firm-overview-rise 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes firm-overview-rise {
  from { transform: translateY(12px) scale(0.98); opacity: 0; }
  to   { transform: translateY(0) scale(1);       opacity: 1; }
}
.firm-overview-modal__close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  background: none;
  border: 1px solid transparent;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 22px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  transition: background var(--transition-base), border-color var(--transition-base), color var(--transition-base);
}
.firm-overview-modal__close:hover {
  background: var(--bg-card);
  border-color: var(--border-color);
  color: var(--text-color);
}
.firm-overview-modal__head {
  padding: var(--space-6) var(--space-6) var(--space-5) var(--space-6);
  background: var(--bg-secondary, #f8fafc);
  border-bottom: 1px solid var(--border-color);
}
.firm-overview-modal__eyebrow {
  font-size: 10px;
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent-primary);
  margin-bottom: var(--space-2);
}
.firm-overview-modal__title {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin: 0 0 var(--space-3) 0;
  letter-spacing: -0.01em;
  padding-right: var(--space-8);
  line-height: 1.2;
}
.firm-overview-modal__intro {
  margin: 0;
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.55;
}
.firm-overview-modal__stages {
  list-style: none;
  margin: 0;
  padding: var(--space-4) var(--space-6);
  overflow-y: auto;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.firm-overview-modal__stage {
  padding: var(--space-4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary, #f8fafc);
  transition: border-color var(--transition-base);
}
.firm-overview-modal__stage:hover { border-color: var(--accent-primary); }
.firm-overview-modal__stage-head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}
.firm-overview-modal__num {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: white;
  font-weight: var(--font-bold);
  font-size: var(--text-xs);
}
.firm-overview-modal__stage-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.firm-overview-modal__stage-title {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  margin: 0;
  line-height: 1.3;
}
.firm-overview-modal__format {
  display: inline-block;
  width: fit-content;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--bg-primary, #ffffff);
  border: 1px solid var(--border-color);
  padding: 2px 8px;
  border-radius: 999px;
}
.firm-overview-modal__stage-body {
  margin: 0 0 var(--space-2) 0;
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--text-color);
}
.firm-overview-modal__stage-cta {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  color: var(--accent-primary);
  text-decoration: none;
}
.firm-overview-modal__stage-cta:hover { text-decoration: underline; }
.firm-overview-modal__foot {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
}
@media (max-width: 700px) {
  .firm-overview-modal { padding: var(--space-2); }
  .firm-overview-modal__card { max-height: 94vh; }
  .firm-overview-modal__head,
  .firm-overview-modal__foot,
  .firm-overview-modal__stages { padding-left: var(--space-4); padding-right: var(--space-4); }
}

/* "Add to my prep" follow toggle in the firm hero */
.firm-follow-btn {
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  cursor: pointer;
}
.firm-follow-btn:hover { background: var(--accent); color: #fff; }
.firm-follow-btn--on { background: var(--accent); color: #fff; border-color: var(--accent); }
.firm-follow-btn--on:hover { background: var(--accent-hover); }

/* "Reported in interviews" — the complete dated list mined from candidate
   posts (data/firm-reports.json). In-bank items link out. */
.firm-reports { margin-top: var(--space-6); }
.firm-reports__note {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin: var(--space-2) 0 var(--space-3) 0;
}
.firm-reports__list {
  display: flex;
  flex-direction: column;
  max-height: 560px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}
.firm-report {
  display: grid;
  grid-template-columns: 64px 130px 1fr auto;
  align-items: baseline;
  gap: var(--space-3);
  padding: 7px var(--space-3);
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
  color: var(--text-color);
  font-size: var(--text-sm);
}
.firm-report:last-child { border-bottom: none; }
.firm-report--link:hover { background: var(--bg-card); }
.firm-report__date {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.firm-report__cat {
  font-size: var(--text-xs);
  text-transform: capitalize;
  color: var(--accent-primary, var(--accent));
}
.firm-report__text { line-height: 1.4; }
.firm-report__inbank {
  font-size: 10px;
  font-weight: var(--font-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-primary, var(--accent));
  white-space: nowrap;
}
@media (max-width: 600px) {
  .firm-report { grid-template-columns: 56px 1fr; }
  .firm-report__cat, .firm-report__inbank { display: none; }
}

/* ---- Pro gate: a blurred PEEK at the funnel (see the shape, not the detail) ---- */
/* Gated body must be a plain block: the base .firm-body is a 240px/1fr grid, but
   the absolutely-positioned gate leaves .firm-body__inner as the only in-flow child,
   which then collapses into the 240px column and blanks the right stages. Block here,
   and let .firm-body__inner carry its own grid. */
.firm-body--gated { position: relative; display: block; }
/* Keep the 2-column layout; the left rail stays fully interactive. */
.firm-body--gated .firm-body__inner {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: var(--space-8);
  align-items: start;
}
@media (max-width: 900px) { .firm-body--gated .firm-body__inner { grid-template-columns: 1fr; } }
/* Left rail = crisp + CLICKABLE: a free user reads OA -> 3 technical -> 3 MD ->
   final, and clicking a stage scrolls to it. Only the right-hand stage content
   (prose + problems) is blurred and non-interactive. */
.firm-body--gated .firm-stages {
  filter: blur(4px) saturate(1.04);
  pointer-events: none;
  user-select: none;
  max-height: 1700px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 90%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 90%, transparent 100%);
}
/* The gate overlay lets clicks pass THROUGH to the rail; only its card captures. */
.firm-gate { pointer-events: none; }
.firm-gate__card { pointer-events: auto; }
.firm-gate {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 120px 16px 0;
}
.firm-gate__card {
  background: color-mix(in srgb, var(--bg-card) 86%, transparent);
  -webkit-backdrop-filter: blur(7px) saturate(1.4);
  backdrop-filter: blur(7px) saturate(1.4);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: 0 30px 80px -26px rgba(15, 23, 42, 0.55);
  padding: 30px 30px 28px;
  max-width: 420px;
  text-align: center;
}
.firm-gate__lock {
  display: inline-flex; color: #6366f1;
  filter: drop-shadow(0 8px 18px rgba(99,102,241,.35));
  margin-bottom: 14px;
}
.firm-gate__lock svg { width: 54px; height: 54px; }
html[data-theme=dark] .firm-gate__lock { color: #818cf8; }
.firm-gate__title { font-size: 21px; font-weight: 800; color: var(--text-bright); margin-bottom: 10px; letter-spacing: -0.01em; }
.firm-gate__desc { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin: 0 0 16px; }
.firm-gate__desc b { color: var(--text-primary); font-weight: 700; }
.firm-gate__meta {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 0 0 20px;
}
.firm-gate__meta span {
  font-size: 11.5px; font-weight: 700; color: var(--text-secondary);
  background: var(--bg-elevated, rgba(99,102,241,.06)); border: 1px solid var(--border-color);
  border-radius: 999px; padding: 4px 11px;
}
.firm-gate__cta { display: inline-block; }

/* ---- OA timed-test launch link (firm funnel OA section) ---- */
.oa-test {
  display: flex; align-items: center; gap: 12px; text-decoration: none;
  border: 1.5px solid var(--accent, #4c8bf5); border-radius: 10px;
  padding: 11px 14px; margin: 8px 0 10px; transition: background .15s;
}
.oa-test:hover { background: rgba(76,139,245,.07); }
.oa-test-ic { flex-shrink: 0; display: flex; align-items: center; color: var(--accent, #4c8bf5); }
.oa-test-tx { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.oa-test-tx b { color: var(--text-bright, #111827); font-size: 14px; }
.oa-test-tx span { color: var(--text-secondary); font-size: 12px; }
.oa-test-go { font-weight: 700; color: var(--accent, #4c8bf5); font-size: 13px; flex-shrink: 0; }

.oa-practice-head {
  font-size: 11px; text-transform: uppercase; letter-spacing: .03em;
  color: var(--text-secondary); font-weight: 600; margin: 10px 0 6px;
}

/* ---- Partial gate: first stage is a FREE, interactive teaser; later stages
   blurred behind the Pro card. The first .firm-stage renders normally; only the
   .firm-gated-region (stages 2..N + wrap-up) is blurred + overlaid. The left
   rail and the first stage stay fully clickable. ---- */
.firm-gated-region { position: relative; }
.firm-gated-region > .firm-stages {
  filter: blur(4px) saturate(1.04);
  pointer-events: none;
  user-select: none;
  max-height: 1400px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 86%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 86%, transparent 100%);
}
/* Reuse the .firm-gate card styling; re-anchor the overlay to this region and
   pull the card up near the top of the first blurred (later) stage. */
.firm-gated-region > .firm-gate { padding-top: 44px; }

/* ---- Free-user Pro gate on OA action CTAs (timed assessment, games, practice).
   The OA stage stays a visible showcase, but these "start an activity" controls
   are Pro-only. Rather than overlay a badge (which collided with the action
   text), the action LABEL itself ("Start ->"/"Play ->") is replaced in markup
   with a gold lock-Pro pill. js/firm.js intercepts the click -> pricing.
   Problem ROWS are not badged (they gate per-problem on problems.html). ---- */
.oa-go-pro,
.firm-stage__game-play--pro {
  display: inline-flex; align-items: center; gap: 4px;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .03em;
  padding: 4px 10px; border-radius: 7px; white-space: nowrap; flex-shrink: 0;
}
.oa-go-pro svg, .firm-stage__game-play--pro svg { width: 11px; height: 11px; }

/* ---- Overall new-grad tier badge (firm-about "At a glance") ---- */
.firm-tier__heading { display: flex; align-items: center; gap: 10px; }
.firm-tier__overall {
  font-size: 12px; font-weight: 800; letter-spacing: .02em;
  padding: 3px 10px; border-radius: 999px; color: #fff; line-height: 1.3;
}
.firm-tier__overall--t0 { background: linear-gradient(135deg,#b91c1c,#f59e0b); }
.firm-tier__overall--t1 { background: linear-gradient(135deg,#15803d,#22c55e); }
.firm-tier__overall--t2 { background: linear-gradient(135deg,#1d4ed8,#3b82f6); }
.firm-tier__overall--t3 { background: linear-gradient(135deg,#475569,#64748b); }
.firm-tier__overall--t4 { background: linear-gradient(135deg,#6b7280,#9ca3af); }
.firm-tier__overall--t5 { background: linear-gradient(135deg,#9ca3af,#cbd5e1); color:#1f2937; }
/* Hero tier chip on firm.html */
.firm-hero__tier {
  display:inline-block; font-size:12px; font-weight:800; letter-spacing:.02em;
  padding:3px 10px; border-radius:999px; color:#fff; vertical-align:middle; margin-left:8px;
}
.firm-hero__tier--t0{background:linear-gradient(135deg,#b91c1c,#f59e0b);}
.firm-hero__tier--t1{background:linear-gradient(135deg,#15803d,#22c55e);}
.firm-hero__tier--t2{background:linear-gradient(135deg,#1d4ed8,#3b82f6);}
.firm-hero__tier--t3{background:linear-gradient(135deg,#475569,#64748b);}
.firm-hero__tier--t4{background:linear-gradient(135deg,#6b7280,#9ca3af);}
.firm-hero__tier--t5{background:linear-gradient(135deg,#9ca3af,#cbd5e1);color:#1f2937;}

/* Mobile audit fix: truncate long reported-problem titles instead of overflowing. */
@media (max-width: 600px) {
  .firm-report__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
}

/* ── End-of-funnel "other firms" CTA → company playlists ──────────── */
.firm-more { max-width: 980px; margin: 40px auto 0; padding: 0 18px; }
.firm-more__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  padding: 26px 28px; border-radius: 18px;
  background: linear-gradient(120deg, rgba(99,102,241,.10), rgba(139,92,246,.08));
  border: 1px solid var(--border-color, #e5e7eb);
}
.firm-more__title { font-size: 1.25rem; margin: 0 0 6px; color: var(--text-primary, #111827); }
.firm-more__sub { font-size: .92rem; color: var(--text-secondary, #6b7280); margin: 0; max-width: 46em; line-height: 1.5; }
.firm-more__btns { display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }
.firm-more__cta { white-space: nowrap; }
@media (max-width: 640px) {
  .firm-more__inner { flex-direction: column; align-items: flex-start; }
  .firm-more__btns { width: 100%; }
  .firm-more__cta { width: 100%; text-align: center; }
}
