/* ============================================================
   Condition Lookup — Component Styles
   Inherits base reset, typography, layout, navbar, footer
   from main.css. Only DC-specific components live here.
   ============================================================ */

/* ── DC Page Scope ── */
/* DC pages use a narrower content width for readability */
.dc-page .container {
  max-width: 900px;
}

/* Skip link — accessibility (keep for DC pages that may load standalone) */
.skip-link {
  position: absolute;
  top: -60px;
  left: 0;
  background: var(--color-primary);
  color: #fff;
  padding: 0.75rem 1.5rem;
  z-index: 1000;
  font-weight: 600;
  text-decoration: none;
  transition: top 0.2s;
}
.skip-link:focus {
  top: 0;
}

/* ── DC Hero ── */
.dc-hero {
  text-align: center;
  margin-bottom: 1.5rem;
}
.dc-hero h1 {
  font-size: 1.6rem;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}
.dc-hero p {
  font-size: 1.05rem;
  color: var(--color-text-muted);
  max-width: 700px;
  margin: 0 auto;
}
.dc-hero strong {
  color: var(--color-primary);
}

/* ── DC Two-Panel Chooser ── */
.dc-chooser {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.dc-panel {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  transition: border-color 0.2s;
}
.dc-panel:hover {
  border-color: var(--color-primary);
}
.dc-panel-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.dc-panel h2 {
  font-size: 1.15rem;
  color: var(--color-primary);
  margin-bottom: 0.4rem;
}
.dc-panel-recommended {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #fff;
  background: var(--color-accent);
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  margin-left: 0.5rem;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.dc-panel p {
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
}

/* Search panel expands when active */
.dc-panel-search.search-active {
  grid-column: 1 / -1;
}

/* Browse button */
.dc-browse-btn {
  display: inline-block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  background: var(--color-primary);
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: all 0.2s;
}
.dc-browse-btn:hover {
  background: var(--color-primary-dark);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: #fff;
}

/* Example search links */
.dc-search-examples {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: -1rem;
  margin-bottom: 1rem;
}
.dc-search-examples a {
  color: var(--color-primary);
  text-decoration: underline;
  margin: 0 0.15rem;
}
.dc-search-examples a:hover {
  color: var(--color-primary-dark);
}

/* Browse fallback link (shown when search is active) */
.dc-browse-fallback {
  text-align: center;
  margin-bottom: 1.5rem;
  padding: 0.75rem;
  background: rgba(0, 51, 102, 0.04);
  border-radius: var(--radius-sm);
}
.dc-browse-fallback a {
  color: var(--color-primary);
  font-weight: 500;
  text-decoration: none;
  font-size: 0.95rem;
}
.dc-browse-fallback a:hover {
  text-decoration: underline;
}

/* ── DC Search (legacy, kept for search-box styling) ── */
.search-section { margin-bottom: 2rem; }
.search-section h1, .search-section h2 { margin-bottom: 0.5rem; color: var(--color-primary); }
.search-section p { color: var(--color-text-muted); margin-bottom: 1rem; }

.dc-search-box {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.dc-search-box input {
  flex: 1;
  padding: 0.75rem 1rem;
  font-size: 1.1rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  transition: border-color 0.2s;
}
.dc-search-box input:focus {
  border-color: var(--color-primary);
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.dc-search-box button {
  padding: 0.75rem 1.5rem;
  min-height: 44px;
  font-size: 1.1rem;
  font-family: var(--font-sans);
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}
.dc-search-box button:hover { background: var(--color-primary-light); }

/* ── Search Results ── */
#search-results .result-card {
  background: #f0f4f8;
  border: 2px solid #c8d6e5;
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 0.75rem;
  transition: all 0.2s;
  cursor: pointer;
}
#search-results .result-card:hover {
  box-shadow: 0 4px 16px rgba(26, 58, 107, .15);
  border-color: var(--color-primary);
  transform: translateY(-2px);
  background: #e8eef5;
}
#search-results .result-card a { text-decoration: none; color: inherit; display: block; }
.result-code { font-weight: 700; color: var(--color-primary); font-size: 1.1rem; }
.result-condition { color: var(--color-text); }
.result-system { color: var(--color-text-muted); font-size: 0.9rem; margin-top: 0.25rem; }

/* ── Body Systems Grid ── */
.browse-section h2 { margin-bottom: 1rem; color: var(--color-primary); }
#body-systems {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0.75rem;
}
.system-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-decoration: none;
  color: var(--color-text);
  transition: box-shadow 0.2s;
}
.system-card:hover { box-shadow: var(--shadow-md); }
.system-card h3 { color: var(--color-primary); font-size: 1rem; }
.system-card .count { color: var(--color-text-muted); font-size: 0.85rem; }

/* ── Breadcrumb (DC-scoped override) ── */
.dc-page .breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-size: 0.88rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}
.dc-page .breadcrumb a {
  color: var(--color-primary);
  text-decoration: none;
}
.dc-page .breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep {
  color: var(--color-border);
  margin: 0 0.15rem;
}

/* ── Code Detail Page ── */
.back-link { display: inline-block; margin-bottom: 1.5rem; color: var(--color-primary); text-decoration: none; }
.back-link:hover { text-decoration: underline; }

.code-header { margin-bottom: 1.5rem; }
.code-header .dc-number { font-size: 2rem; color: var(--color-primary); font-weight: 700; }
.code-header .dc-condition { font-size: 1.4rem; color: var(--color-text); }
.code-header .dc-system { color: var(--color-text-muted); margin-top: 0.25rem; }

.code-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.code-section h3 {
  color: var(--color-primary);
  margin-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-accent);
  padding-bottom: 0.5rem;
}

/* ── Rating Levels ── */
.rating-row {
  display: flex;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-bg);
  align-items: flex-start;
}
.rating-row:last-child { border-bottom: none; }
.rating-percent {
  min-width: 60px;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--color-primary);
  text-align: center;
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
}
.rating-criteria { flex: 1; }

/* ── Disclaimer ── */
.disclaimer {
  margin-top: 2rem;
  padding: 1rem;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: #664d03;
}

/* ── No Results ── */
.no-results { color: var(--color-text-muted); font-style: italic; padding: 1rem 0; }

/* ── Browse Page Layout ── */
.browse-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

.browse-sidebar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  position: static;
}
.browse-sidebar h2 {
  font-size: 1.1rem;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-accent);
}

/* ── Torso SVG Visual ── */
.torso-container {
  width: 100%;
  max-width: 380px;
  margin: 0 auto;
}
.torso-svg {
  width: 100%;
  height: auto;
  cursor: default;
}

/* Body outline */
.torso-body-outline ellipse,
.torso-body-outline rect,
.torso-body-outline path {
  transition: fill 0.2s;
}

/* Clickable zones on the body */
.torso-zone {
  fill: rgba(44, 90, 160, 0.08);
  stroke: none;
  cursor: pointer;
  transition: fill 0.2s, stroke 0.2s;
}
.torso-region:hover .torso-zone {
  fill: rgba(44, 90, 160, 0.25);
  stroke: var(--color-primary);
  stroke-width: 1.5;
}
.torso-region.active .torso-zone {
  fill: rgba(200, 146, 42, 0.3);
  stroke: var(--color-accent);
  stroke-width: 2;
}

/* Connector lines from body to labels */
.torso-connector {
  stroke: #b0bec5;
  stroke-width: 1;
  stroke-dasharray: 3 2;
  transition: stroke 0.2s;
}
.torso-region:hover .torso-connector {
  stroke: var(--color-primary);
  stroke-width: 1.5;
  stroke-dasharray: none;
}
.torso-region.active .torso-connector {
  stroke: var(--color-accent);
  stroke-width: 1.5;
  stroke-dasharray: none;
}

/* Label backgrounds (side labels) */
.torso-label-bg {
  fill: #f0f3f8;
  stroke: #d0d8e4;
  stroke-width: 1;
  cursor: pointer;
  transition: fill 0.2s, stroke 0.2s;
}
.torso-region:hover .torso-label-bg {
  fill: #dce4f0;
  stroke: var(--color-primary);
}
.torso-region.active .torso-label-bg {
  fill: var(--color-accent);
  stroke: var(--color-accent);
}

/* Label text (side labels) */
.torso-label {
  font-size: 10px;
  font-family: var(--font-sans);
  font-weight: 600;
  fill: var(--color-primary);
  cursor: pointer;
  pointer-events: none;
}
.torso-region.active .torso-label {
  fill: #fff;
}

/* Count badges */
.torso-count {
  font-size: 9px;
  font-family: var(--font-sans);
  font-weight: 700;
  fill: var(--color-text-muted);
  pointer-events: none;
}
.torso-region.active .torso-count {
  fill: #fff;
}

/* Labels placed directly on the body */
.torso-body-label {
  font-size: 10px;
  font-family: var(--font-sans);
  font-weight: 600;
  fill: var(--color-primary);
  pointer-events: none;
  opacity: 0.7;
}
.torso-body-count {
  font-size: 9px;
  opacity: 0.6;
}
.torso-region:hover .torso-body-label,
.torso-region:hover .torso-body-count {
  opacity: 1;
}
.torso-region.active .torso-body-label {
  fill: var(--color-accent-light);
  opacity: 1;
}
.torso-region.active .torso-body-count {
  fill: var(--color-accent);
  opacity: 1;
}

/* Focus ring for keyboard navigation */
.torso-region:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Mobile dropdown fallback */
.torso-mobile-select {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.torso-mobile-select select {
  width: 100%;
  padding: 0.5rem;
  font-size: 0.9rem;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
}

/* Legacy sidebar-link styles (kept for compatibility) */
.sidebar-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0.75rem;
  min-height: 44px;
  text-decoration: none;
  color: var(--color-text);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: background 0.15s;
}
.sidebar-link:hover { background: var(--color-bg); text-decoration: none; }
.sidebar-link.active { background: var(--color-primary); color: #fff; }
.sidebar-link.active .sidebar-count { color: var(--color-accent); }
.sidebar-name { flex: 1; }
.sidebar-count-text {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-left: 0.5rem;
  white-space: nowrap;
}

/* Browse Main Content */
.browse-main { min-width: 0; }

.browse-header { margin-bottom: 1rem; }
.browse-header h2 { color: var(--color-primary); font-size: 1.5rem; }
.browse-header p { color: var(--color-text-muted); margin-top: 0.25rem; }

.browse-filter { margin-bottom: 1rem; }
.browse-filter input {
  width: 100%;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  font-family: var(--font-sans);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.2s;
}
.browse-filter input:focus { border-color: var(--color-primary); }

.browse-prompt {
  color: var(--color-text-muted);
  font-style: italic;
  padding: 2rem 0;
  text-align: center;
}
.loading-text {
  color: var(--color-text-muted);
  font-style: italic;
}

/* ── Code Cards in Browse ── */
.code-card {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 0.6rem;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, border-color 0.2s;
}
.code-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
  text-decoration: none;
}
.code-card-header {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
  flex-wrap: wrap;
}
.code-card-dc {
  font-weight: 700;
  color: var(--color-primary);
  font-size: 1.05rem;
  white-space: nowrap;
}
.code-card-name {
  color: var(--color-text);
  font-size: 1rem;
}
.code-card-summary {
  margin-top: 0.5rem;
  font-size: 0.88rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ── PACT Act Badge ── */
.pact-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 0.5rem;
}
.pact-badge-burn-pit { background: #ffebee; color: #c62828; border: 1px solid #ef9a9a; }
.pact-badge-agent-orange { background: #fff3e0; color: #e65100; border: 1px solid #ffcc80; }
.pact-badge-radiation { background: #f3e5f5; color: #6a1b9a; border: 1px solid #ce93d8; }
.pact-badge-gulf-war { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }

/* ── PACT Act Landing Page ── */
.pact-hero {
  background: var(--color-surface);
  border: 2px solid var(--color-accent);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.pact-hero h2 {
  color: var(--color-primary);
  font-size: 1.6rem;
  margin-bottom: 0.75rem;
}
.pact-hero p {
  color: var(--color-text);
  font-size: 1.05rem;
  line-height: 1.7;
}

.pact-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.pact-stat {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}
.pact-stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary);
}
.pact-stat-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

.pact-filter { margin-bottom: 1.5rem; }
.pact-filter label {
  display: block;
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.pact-filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.pact-filter-btn {
  padding: 0.5rem 1rem;
  min-height: 44px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  cursor: pointer;
  font-size: 0.9rem;
  font-family: var(--font-sans);
  font-weight: 500;
  transition: all 0.2s;
}
.pact-filter-btn:hover { border-color: var(--color-primary); }
.pact-filter-btn.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}
.pact-filter-btn.burn-pit.active { background: #c62828; border-color: #c62828; }
.pact-filter-btn.agent-orange.active { background: #e65100; border-color: #e65100; }
.pact-filter-btn.radiation.active { background: #6a1b9a; border-color: #6a1b9a; }
.pact-filter-btn.gulf-war.active { background: #1565c0; border-color: #1565c0; }

.pact-category { margin-bottom: 2rem; }
.pact-category-header {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  color: #fff;
}
.pact-category-header h3 { font-size: 1.2rem; margin-bottom: 0.25rem; }
.pact-category-header p { font-size: 0.9rem; opacity: 0.9; }
.pact-tag-burn-pit { background: #c62828; }
.pact-tag-agent-orange { background: #e65100; }
.pact-tag-radiation { background: #6a1b9a; }
.pact-tag-gulf-war { background: #1565c0; }

.pact-conditions-list {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.pact-condition-card {
  padding: 0.75rem 1.25rem;
  border-bottom: 2px solid var(--color-border);
}
.pact-condition-card:last-child { border-bottom: none; }
.pact-condition-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.pact-condition-name {
  font-weight: 600;
  color: var(--color-text);
}
.pact-dc-link {
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.4rem 0.6rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  background: var(--color-bg);
  border-radius: 4px;
  white-space: nowrap;
}
.pact-dc-link:hover { background: var(--color-border); text-decoration: none; }
.pact-no-dc {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-style: italic;
}
.pact-condition-notes {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}
.pact-condition-period {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}

/* ── PACT Act grant rate badges ── */
.pact-grant-rate {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.35rem;
}
.pact-grant-badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  color: #fff;
}
.pact-grant-badge.grant-high { background: #2e7d32; }
.pact-grant-badge.grant-mid { background: #f57f17; }
.pact-grant-badge.grant-low { background: #c62828; }
.pact-grant-detail {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

/* ── PACT Act stats source ── */
.pact-stats-source {
  text-align: center;
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
  margin-bottom: 0;
}

/* ── PACT Act OIG Findings section ── */
.pact-oig-section {
  margin-bottom: 1.5rem;
  background: #fff3e0;
  border: 2px solid #e65100;
}
.pact-oig-section .collapsible-toggle {
  color: #bf360c;
  border-bottom-color: #e65100;
}
.pact-oig-section .toggle-icon {
  background: rgba(230, 81, 0, 0.1);
  border-color: #e65100;
  color: #bf360c;
}
.pact-oig-section .collapsible-toggle:hover .toggle-icon {
  background: rgba(230, 81, 0, 0.2);
}
.pact-oig-intro {
  font-size: 0.92rem;
  color: #4e342e;
  margin-bottom: 1rem;
}
.pact-oig-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.pact-oig-card {
  background: #fff;
  border: 1px solid #ffcc80;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}
.pact-oig-stat {
  font-weight: 700;
  font-size: 0.95rem;
  color: #bf360c;
  margin-bottom: 0.25rem;
}
.pact-oig-detail {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  line-height: 1.4;
  margin-bottom: 0.25rem;
}
.pact-oig-source {
  font-size: 0.75rem;
  color: #8d6e63;
  font-style: italic;
}
.pact-oig-cta {
  font-size: 0.9rem;
  color: #4e342e;
}
.pact-oig-cta a {
  color: var(--color-primary);
  font-weight: 600;
}

/* ── Top Conditions Page ── */
.top-hero {
  text-align: center;
  margin-bottom: 2rem;
}
.top-hero h1 {
  font-size: 1.8rem;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}
.top-hero p {
  font-size: 1rem;
  color: var(--color-text-muted);
  max-width: 750px;
  margin: 0 auto;
  line-height: 1.6;
}
.top-conditions-table {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.top-condition-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.6rem 0;
  border-bottom: 1px solid #f0f0f0;
}
.top-condition-row:last-child { border-bottom: none; }
.top-rank {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-primary);
  min-width: 2.5rem;
  text-align: center;
  padding-top: 0.1rem;
}
.top-info { flex: 1; }
.top-name-line {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.3rem;
}
.top-condition-link {
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  font-size: 0.95rem;
}
.top-condition-link:hover { text-decoration: underline; }
.top-dc {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}
.top-gao-rate {
  font-size: 0.72rem;
  font-weight: 700;
  color: #2e7d32;
  background: #e8f5e9;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
}
.top-bar-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.top-bar-track {
  flex: 1;
  height: 14px;
  background: #e8eaf6;
  border-radius: 3px;
  overflow: hidden;
}
.top-bar-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 3px;
  transition: width 0.3s;
}
.top-bar-fill.top-bar-new {
  background: #2e7d32;
}
.top-bar-count {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
  min-width: 85px;
}

/* Body system grid */
.top-system-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}
.top-system-card {
  background: #f8f9fc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 1rem;
}
.top-system-card h3 {
  font-size: 0.95rem;
  color: var(--color-primary);
  margin-bottom: 0.15rem;
}
.top-system-total {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.top-system-list {
  padding-left: 1.25rem;
  margin: 0;
}
.top-system-list li {
  font-size: 0.85rem;
  color: var(--color-text);
  padding: 0.15rem 0;
}

/* Takeaway cards */
.top-takeaways {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.top-takeaway {
  padding: 0.75rem 1rem;
  background: #f8f9fc;
  border-left: 3px solid var(--color-primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.9rem;
  line-height: 1.5;
}
.top-takeaway strong {
  color: var(--color-primary);
}

/* ── Top Conditions link card (on /dc/ page) ── */
.top-link-card {
  display: block;
  background: linear-gradient(135deg, #1b5e20, #2e7d32);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-decoration: none;
  margin-bottom: 1rem;
  transition: box-shadow 0.2s;
}
.top-link-card:hover { box-shadow: var(--shadow-lg); text-decoration: none; }
.top-link-card h3 { color: var(--color-accent); font-size: 1.1rem; margin-bottom: 0.25rem; }
.top-link-card p { color: rgba(255,255,255,.75); font-size: 0.95rem; margin-bottom: 0.75rem; }
.top-link-cta {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1b5e20;
  background: var(--color-accent);
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}
.top-link-card:hover .top-link-cta { background: #fff; }

/* ── BVA Insights link card (on /dc/ page) ── */
.bva-link-card {
  display: block;
  background: linear-gradient(135deg, #1a237e, #283593);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-decoration: none;
  margin-bottom: 2rem;
  transition: box-shadow 0.2s;
}
.bva-link-card:hover { box-shadow: var(--shadow-lg); text-decoration: none; }
.bva-link-card h3 { color: var(--color-accent); font-size: 1.1rem; margin-bottom: 0.25rem; }
.bva-link-card p { color: rgba(255,255,255,.75); font-size: 0.95rem; margin-bottom: 0.75rem; }
.bva-link-cta {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1a237e;
  background: var(--color-accent);
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}
.bva-link-card:hover .bva-link-cta { background: #fff; }

/* ── PACT Act section — special styling (uses generic collapsible) ── */
.pact-act-section {
  background: #fff8e1;
  border: 2px solid var(--color-accent);
}
.pact-act-section .collapsible-toggle {
  color: #b8860b;
  border-bottom-color: var(--color-accent);
}
.pact-act-section .toggle-icon {
  background: rgba(184, 134, 11, 0.15);
  border-color: #b8860b;
  color: #b8860b;
}
.pact-act-section .collapsible-toggle:hover .toggle-icon { background: rgba(184, 134, 11, 0.25); }
.pact-act-entry {
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0e0a0;
}
.pact-act-entry:last-child { border-bottom: none; }
.pact-act-entry .pact-cat-label { font-weight: 600; }
.pact-act-entry .pact-period { font-size: 0.88rem; color: var(--color-text-muted); margin-top: 0.25rem; }
.pact-act-entry .pact-notes { font-size: 0.88rem; color: var(--color-text-muted); font-style: italic; }

/* ── Generic collapsible sections (C&P Exam, Evidence to Bring) ── */
.collapsible-toggle {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  min-height: 44px;
}
.collapsible-toggle:hover { opacity: 0.8; }
.collapsible-toggle .toggle-icon {
  font-size: 0.85rem;
  padding: 0.3rem 0.75rem;
  background: rgba(0, 51, 102, 0.08);
  border: 1px solid var(--color-primary);
  border-radius: 4px;
  color: var(--color-primary);
  white-space: nowrap;
  transition: background 0.2s;
}
.collapsible-toggle:hover .toggle-icon { background: rgba(0, 51, 102, 0.15); }
.collapsible-toggle .toggle-icon::after {
  content: ' \25BC';
  font-size: 0.7rem;
  transition: transform 0.2s;
  display: inline-block;
}
.collapsible-section:not(.open) .toggle-icon::after {
  transform: rotate(-90deg);
}
.collapsible-section:not(.open) .collapsible-toggle {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.collapsible-body {
  display: none;
  padding-top: 0;
}
.collapsible-section.open .collapsible-body {
  display: block;
  padding-top: 0.75rem;
}

/* ── Bullet list styling for exam/evidence tips ── */
.tip-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.tip-list li {
  position: relative;
  padding: 0.5rem 0 0.5rem 1.5rem;
  line-height: 1.55;
  border-bottom: 1px solid #f0f0f0;
}
.tip-list li:last-child {
  border-bottom: none;
}
.tip-list li::before {
  content: '\2022';
  position: absolute;
  left: 0.25rem;
  color: var(--color-primary);
  font-size: 1.2rem;
  font-weight: bold;
  line-height: 1.55;
}

/* ── Homepage PACT Act link card ── */
.pact-link-card {
  display: block;
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary-light));
  color: #fff;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-decoration: none;
  margin-bottom: 2rem;
  transition: box-shadow 0.2s;
}
.pact-link-card:hover { box-shadow: var(--shadow-lg); text-decoration: none; }
.pact-link-card:hover .pact-link-cta { background: #fff; color: var(--color-primary); }
.pact-link-card h3 { color: var(--color-accent); font-size: 1.1rem; margin-bottom: 0.25rem; }
.pact-link-card p { color: rgba(255,255,255,.75); font-size: 0.95rem; margin-bottom: 0.75rem; }
.pact-link-cta {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  background: var(--color-accent);
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}

/* ── What the Data Shows — Insights Section ── */
.insights-section {
  border: 2px solid var(--color-primary);
  background: #f8f9fc;
}
.insights-section .collapsible-toggle {
  color: var(--color-primary);
}
.insights-intro {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}
.insights-subsection {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e0e0e0;
}
.insights-subsection:last-of-type {
  border-bottom: none;
  margin-bottom: 0.5rem;
}
.insights-subhead {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}
.insights-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.insights-list li {
  position: relative;
  padding: 0.4rem 0 0.4rem 1.25rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--color-text);
}
.insights-list li::before {
  content: '\2022';
  position: absolute;
  left: 0.15rem;
  color: var(--color-primary);
  font-weight: bold;
}
.insights-list li strong {
  color: var(--color-primary-dark);
}
.insights-source {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  font-style: italic;
}
.insights-note {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.5rem;
  line-height: 1.4;
}
.insights-note a {
  color: var(--color-primary);
  font-weight: 600;
}
.insights-oig .insights-list li strong {
  color: #bf360c;
}
.insights-disclaimer {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e0e0e0;
  line-height: 1.4;
}

/* ── BVA Insights Page ── */
.bva-hero {
  text-align: center;
  margin-bottom: 2rem;
}
.bva-hero h1 {
  font-size: 1.8rem;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}
.bva-hero p {
  font-size: 1rem;
  color: var(--color-text-muted);
  max-width: 750px;
  margin: 0 auto;
  line-height: 1.6;
}
.bva-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.bva-stat-card {
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: center;
}
.bva-stat-number {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--color-primary);
}
.bva-stat-label {
  font-size: 0.82rem;
  color: var(--color-text-muted);
  margin-top: 0.2rem;
}

/* Headline finding card */
.bva-headline-card {
  background: linear-gradient(135deg, #f8f9fc, #e8eaf6);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-md);
  padding: 2rem;
  margin-bottom: 2rem;
  text-align: center;
}
.bva-headline-card h2 {
  color: var(--color-primary);
  font-size: 1.3rem;
  margin-bottom: 1.25rem;
}
.bva-headline-compare {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.bva-compare-item {
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  min-width: 180px;
}
.bva-compare-good {
  background: #e8f5e9;
  border: 2px solid #2e7d32;
}
.bva-compare-bad {
  background: #ffebee;
  border: 2px solid #c62828;
}
.bva-compare-number {
  font-size: 2.5rem;
  font-weight: 800;
}
.bva-compare-good .bva-compare-number { color: #2e7d32; }
.bva-compare-bad .bva-compare-number { color: #c62828; }
.bva-compare-label {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-top: 0.25rem;
}
.bva-compare-vs {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text-muted);
}
.bva-headline-explain {
  font-size: 0.95rem;
  color: var(--color-text);
  line-height: 1.6;
  max-width: 650px;
  margin: 0 auto 0.5rem;
  text-align: left;
}
.bva-headline-source {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  font-style: italic;
}

/* Section styling */
.bva-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.bva-section h2 {
  color: var(--color-primary);
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}
.bva-section-intro {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}
.bva-section-note {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  font-style: italic;
  margin-top: 0.75rem;
}
.bva-section-cta {
  font-size: 0.92rem;
  margin-top: 1rem;
}
.bva-section-cta a {
  color: var(--color-primary);
  font-weight: 600;
}

/* Pairs table */
.bva-pairs-table {
  width: 100%;
}
.bva-pair-header {
  display: grid;
  grid-template-columns: 1fr 80px 80px;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 2px solid var(--color-border);
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.bva-pair-header:has(+ .bva-pair-row .bva-pair-transition) {
  grid-template-columns: 1fr 80px 80px 120px;
}
.bva-pair-row {
  display: grid;
  grid-template-columns: 1fr 80px 80px;
  gap: 0.5rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
  align-items: center;
}
.bva-pair-row:has(.bva-pair-transition) {
  grid-template-columns: 1fr 80px 80px 120px;
}
.bva-pair-name { color: var(--color-text); }
.bva-pair-name a { color: var(--color-primary); text-decoration: none; }
.bva-pair-name a:hover { text-decoration: underline; }
.bva-pair-count { text-align: center; color: var(--color-text-muted); }
.bva-pair-rate { text-align: center; font-weight: 700; }
.bva-pair-rate.rate-high { color: #2e7d32; }
.bva-pair-rate.rate-mid { color: #f57f17; }
.bva-pair-rate.rate-low { color: #c62828; }
.bva-pair-transition { font-size: 0.82rem; color: var(--color-text-muted); text-align: center; }

/* Two-column layout */
.bva-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
@media (max-width: 700px) {
  .bva-two-col { grid-template-columns: 1fr; }
}
.bva-factor-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.bva-factor-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.88rem;
  line-height: 1.5;
}
.bva-factor-list li:last-child { border-bottom: none; }
.bva-factors-win li strong { color: #2e7d32; }
.bva-factors-lose li strong { color: #c62828; }

/* OIG banner */
.bva-oig-banner {
  background: #fff3e0;
  border-color: #e65100;
}
.bva-oig-banner h2 { color: #bf360c; }
.bva-oig-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}
.bva-oig-stat {
  background: #fff;
  border: 1px solid #ffcc80;
  border-radius: var(--radius-sm);
  padding: 1rem;
  text-align: center;
}
.bva-oig-number {
  font-size: 2rem;
  font-weight: 800;
  color: #bf360c;
}
.bva-oig-label {
  font-size: 0.85rem;
  color: #4e342e;
  margin-top: 0.25rem;
}
.bva-oig-source {
  font-size: 0.72rem;
  color: #8d6e63;
  margin-top: 0.25rem;
  font-style: italic;
}

/* CTA section */
.bva-cta-section {
  text-align: center;
  padding: 2rem;
  background: linear-gradient(135deg, var(--color-primary-dark), var(--color-primary));
  color: #fff;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
}
.bva-cta-section h2 {
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}
.bva-cta-section p {
  color: rgba(255,255,255,.85);
  margin-bottom: 1.25rem;
  max-width: 550px;
  margin-left: auto;
  margin-right: auto;
}
.bva-cta-buttons {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}
.bva-cta-buttons .btn {
  background: var(--color-accent);
  color: #fff;
  text-decoration: none;
}
.bva-cta-buttons .btn-outline {
  background: transparent;
  border: 2px solid rgba(255,255,255,.4);
  color: #fff;
}
.bva-cta-buttons .btn-outline:hover {
  border-color: #fff;
  background: rgba(255,255,255,.1);
}

/* ── Rating Distribution Card (Browse page) ── */
.rating-dist-card {
  background: #f8f9fc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.rating-dist-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.rating-dist-header h3 {
  font-size: 1rem;
  color: var(--color-primary);
  margin: 0;
}
.rating-dist-total {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: 600;
}
.dist-bars {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
}
.dist-bar-row {
  display: grid;
  grid-template-columns: 40px 1fr 45px;
  align-items: center;
  gap: 0.5rem;
}
.dist-bar-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-primary);
  text-align: right;
}
.dist-bar-track {
  height: 18px;
  background: #e8eaf6;
  border-radius: 3px;
  overflow: hidden;
}
.dist-bar-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 3px;
  min-width: 2px;
  transition: width 0.3s ease;
}
.dist-bar-pct {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  font-weight: 600;
}
.dist-top-conditions {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 0.5rem;
  line-height: 1.5;
}
.dist-top-conditions strong {
  color: var(--color-text);
}
.rating-dist-source {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  font-style: italic;
  margin: 0;
}

/* ── Back to body system link ── */
.back-to-system {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-border);
}
.back-to-system a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}
.back-to-system a:hover { text-decoration: underline; }

/* ── About Page ── */
.about-page { margin-bottom: 2rem; }
.about-page h2 {
  color: var(--color-primary);
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
}
.about-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.about-section h3 {
  color: var(--color-primary);
  margin-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-accent);
  padding-bottom: 0.5rem;
}
.about-section p { margin-bottom: 0.75rem; line-height: 1.7; }
.about-section ul, .about-section ol {
  margin: 0.75rem 0;
  padding-left: 1.5rem;
}
.about-section li {
  margin-bottom: 0.5rem;
  line-height: 1.6;
}
.about-section a { color: var(--color-primary); }

/* ===== Secondary Conditions ===== */
.secondary-section { margin-top: 1.5rem; }
.secondary-intro {
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
.secondary-cards {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.secondary-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  transition: box-shadow 0.2s;
}
.secondary-card:hover {
  box-shadow: var(--shadow-sm);
}
.secondary-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.secondary-link {
  text-decoration: none;
  color: var(--color-primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.secondary-link:hover { text-decoration: underline; }
.secondary-dc {
  background: var(--color-primary);
  color: #fff;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
}
.secondary-name { font-size: 1rem; }
.secondary-desc {
  color: #444;
  font-size: 0.93rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

/* Relationship type badges */
.rel-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.rel-well-established {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}
.rel-commonly-claimed {
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffcc80;
}
.rel-emerging {
  background: #f3e5f5;
  color: #7b1fa2;
  border: 1px solid #ce93d8;
}

/* Expandable details */
.secondary-details-toggle {
  color: var(--color-primary);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0;
  user-select: none;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.secondary-details-toggle:hover { text-decoration: underline; }
.secondary-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.secondary-card.expanded .secondary-details {
  max-height: 600px;
}
.secondary-card .secondary-details-toggle .toggle-text::before {
  content: '\25B8 ';
}
.secondary-card.expanded .secondary-details-toggle .toggle-text::before {
  content: '\25BE ';
}
.detail-block {
  padding: 0.6rem 0;
  border-top: 1px solid var(--color-bg);
  font-size: 0.9rem;
}
.detail-block strong {
  color: var(--color-primary);
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.detail-block p { margin: 0; color: #444; line-height: 1.5; }
.detail-source {
  font-size: 0.85rem;
  color: var(--color-text-muted);
}
.detail-source strong { display: inline; text-transform: none; letter-spacing: 0; }

/* BVA pair data on secondary cards */
.bva-pair-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  color: #fff;
  margin-top: 0.35rem;
}
.bva-pair-badge.bva-high { background: #2e7d32; }
.bva-pair-badge.bva-mid { background: #f57f17; }
.bva-pair-badge.bva-low { background: #c62828; }
.detail-bva {
  background: #f0f4ff;
  border: 1px solid #c5cae9;
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-top: 0.5rem;
}
.detail-bva strong {
  color: var(--color-primary);
}
.bva-outcome-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0;
}
.bva-outcome-list li {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.25rem 0;
  font-size: 0.88rem;
}
.bva-outcome-list li strong {
  min-width: 2rem;
  text-align: right;
}
.detail-bva-note {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  font-style: italic;
  margin-top: 0.35rem;
  margin-bottom: 0;
}

/* Secondary disclaimer */
.secondary-disclaimer {
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  background: #fff8e1;
  border: 1px solid #ffe082;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: #5d4037;
  line-height: 1.5;
}

/* "This condition as a secondary" section */
.secondary-to-section { margin-top: 1rem; }
.secondary-to-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.secondary-to-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
  gap: 0.5rem;
}
.secondary-to-item:hover {
  border-color: var(--color-primary);
}

/* ── Residual Conditions Section ── */
.residual-section { margin-top: 1.5rem; }
.residual-intro { color: var(--color-text-muted); margin-bottom: 1rem; font-size: 0.95rem; }

.residual-timeline {
  background: #e0f2f1;
  border-left: 4px solid #00796b;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  font-size: 0.93rem;
  color: #004d40;
  line-height: 1.5;
}
.residual-floor {
  background: #e0f2f1;
  border-left: 4px solid #00897b;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.93rem;
  color: #004d40;
  line-height: 1.5;
}

.residual-cards { display: flex; flex-direction: column; gap: 1rem; }
.residual-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  transition: box-shadow 0.2s;
}
.residual-card:hover { box-shadow: var(--shadow-sm); }

.residual-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.residual-link {
  text-decoration: none;
  color: #00796b;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.residual-link:hover { text-decoration: underline; }
.residual-link-self {
  color: #555;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.residual-dc {
  background: #00796b;
  color: #fff;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
}
.residual-name { font-size: 0.95rem; }
.residual-desc { color: #444; font-size: 0.93rem; line-height: 1.5; margin-bottom: 0.5rem; }

/* Frequency badges */
.freq-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.freq-common { background: #e0f2f1; color: #00695c; border: 1px solid #80cbc4; }
.freq-possible { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }
.freq-rare { background: #fff8e1; color: #f57f17; border: 1px solid #ffe082; }

/* Expandable details */
.residual-details-toggle {
  color: #00796b;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0;
  user-select: none;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.residual-details-toggle:hover { text-decoration: underline; }
.residual-details {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.residual-card.expanded .residual-details { max-height: 600px; }

/* Disclaimer */
.residual-disclaimer {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #e0f2f1;
  border: 1px solid #80cbc4;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: #004d40;
  line-height: 1.5;
}

/* "This condition as a residual" section */
.residual-of-section { margin-top: 1rem; }
.residual-of-list { display: flex; flex-direction: column; gap: 0.5rem; }
.residual-of-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
  gap: 0.5rem;
}
.residual-of-item:hover { border-color: #00796b; }
.residual-cat-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  background: #e0f2f1;
  color: #00695c;
  border: 1px solid #80cbc4;
}

/* ── DC Error Page ── */
.dc-page .error-page {
  text-align: center;
  padding: 3rem 1rem;
}
.dc-page .error-page h2 {
  font-size: 2rem;
  color: var(--color-primary);
  margin-bottom: 1rem;
}
.dc-page .error-page p {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}
.error-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}
.error-btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  min-height: 44px;
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: background 0.2s;
}
.error-btn:hover { background: var(--color-primary-light); text-decoration: none; }
.error-btn-secondary {
  background: var(--color-surface);
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}
.error-btn-secondary:hover {
  background: var(--color-primary);
  color: #fff;
}

/* ── Global focus-visible ring for keyboard navigation ── */
.dc-page *:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.dc-page a:focus-visible {
  border-radius: 2px;
}

/* ===== DC Mobile Responsive ===== */
@media (max-width: 768px) {
  .browse-layout {
    grid-template-columns: 1fr;
  }
  .browse-sidebar {
    position: static;
  }
  .torso-container {
    max-width: 320px;
  }
  .torso-mobile-select {
    display: flex !important;
  }
}

@media (max-width: 600px) {
  .dc-search-box { flex-direction: column; }
  .dc-search-box button { width: 100%; }
  #body-systems { grid-template-columns: 1fr; }
  .code-header .dc-number { font-size: 1.5rem; }
  .pact-stats-grid { grid-template-columns: 1fr; }
  .pact-filter-buttons { flex-direction: column; }
  .pact-filter-btn { width: 100%; text-align: center; }
  .pact-condition-header { flex-direction: column; align-items: flex-start; gap: 0.25rem; }
  .secondary-card-header { flex-direction: column; align-items: flex-start; }
  .secondary-to-item { flex-direction: column; align-items: flex-start; }
  .residual-card-header { flex-direction: column; align-items: flex-start; }
  .residual-of-item { flex-direction: column; align-items: flex-start; }
  .error-actions { flex-direction: column; }
  .error-btn { width: 100%; text-align: center; }
}
