/**
 * movement-lineage.css
 * Theme styles for the unified Tabbed Node Dossier & Lineage Map engine (`page.art-movement.json`).
 * Features museum-grade tabs (Description, Key Artists, Famous Artworks, Fun Facts, Shop) + 5-level lineage canvas.
 * Preserves SEO by visually hiding server-rendered HTML while keeping it fully accessible to search crawlers.
 */

.movement-lineage-section {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

[role="tabpanel"][hidden] {
  display: none !important;
}
[role="tabpanel"]:not([hidden]) {
  display: block;
}

.dossier-accordion-header {
  display: none !important;
}

.dossier-panel-body {
  display: block;
}

.ih-breadcrumb-title-item {
  display: none !important;
}

@media (max-width: 767px) {
  .dedicated-view {
    height: calc(100vh - var(--site-header-height, 68px) - 20px);
    min-height: 480px;
    border-radius: 8px;
    margin: 8px 0 12px 0;
  }
  .dedicated-header-panel {
    padding: 14px 0 0 !important;
    gap: 0 !important;
  }
  .hero-identity {
    padding: 0 16px 12px !important;
    gap: 4px;
  }
  .dossier-content {
    max-height: 380px;
    padding: 0 !important;
    margin: 0 !important;
  }
  .dossier-tabs {
    display: none !important;
  }
  .dossier-content [role="tabpanel"],
  .dossier-content .dossier-panel {
    display: block !important;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    margin-bottom: 0 !important;
  }
  .dossier-content .dossier-panel:last-child {
    border-bottom: none;
  }
  .dossier-accordion-header {
    display: flex !important;
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    color: #0f172a;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.18s ease, color 0.18s ease;
  }
  .dossier-accordion-header:hover {
    background: rgba(15, 23, 42, 0.03);
  }
  .dossier-accordion-header[aria-expanded="true"] {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.04);
  }
  .dossier-accordion-header .dah-title {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .dossier-accordion-header .dt-count {
    font-size: 0.78rem;
    font-weight: 700;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 999px;
  }
  .dossier-accordion-header[aria-expanded="true"] .dt-count {
    color: #ffffff;
    background: #2563eb;
  }
  .dossier-accordion-header .dah-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: transform 0.25s ease, color 0.18s ease;
  }
  .dossier-accordion-header[aria-expanded="true"] .dah-icon {
    transform: rotate(180deg);
    color: #2563eb;
  }
  .dossier-panel:not(.is-accordion-open) .dossier-panel-body {
    display: none !important;
  }
  .dossier-panel.is-accordion-open .dossier-panel-body {
    display: block !important;
    padding: 12px 16px 18px;
  }

  /* Mobile Minimized State (when zooming in on canvas) */
  .movement-lineage-sticky-header.is-minimized .dedicated-header-panel {
    padding: 10px 0 !important;
    gap: 0 !important;
  }
  .movement-lineage-sticky-header.is-minimized .hero-identity {
    padding: 0 16px !important;
    gap: 0 !important;
  }
  .movement-lineage-sticky-header.is-minimized .hero-title-text {
    display: none !important;
  }
  .movement-lineage-sticky-header.is-minimized .ih-breadcrumb-title-item {
    display: inline-flex !important;
  }
  .movement-lineage-sticky-header.is-minimized .dossier-content {
    max-height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    opacity: 0;
    overflow: hidden;
    border: none !important;
  }
}

/* Dedicated view wrapper */
.dedicated-view {
  width: 100%;
  max-width: 100%;
  margin: 12px 0 16px 0;
  box-sizing: border-box;
  position: relative;
  height: calc(100vh - var(--site-header-height, 68px) - 28px);
  min-height: 650px;
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  overflow: clip;
  display: flex;
  flex-direction: column;
  font-family: var(--font-heading, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
  color: #0f172a;
}

.dedicated-view.is-graph-only {
  height: 420px;
  min-height: 380px;
  max-height: 55vh;
  margin: 12px 0 0 0;
}

.dedicated-view.is-graph-only .dedicated-canvas-container {
  height: 100%;
  min-height: 380px;
}

/* Sticky Header Wrapper for Node View */
.movement-lineage-sticky-header {
  position: sticky;
  top: var(--site-header-height, 0px);
  z-index: 150;
  background: #ffffff;
  transition: box-shadow 0.25s ease;
  flex-shrink: 0;
}

.movement-lineage-sticky-header.is-minimized {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

/* Top Hero Header Dossier */
.dedicated-header-panel {
  padding: 16px 24px 0;
  background: #ffffff;
  border-bottom: 1px solid rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: padding 0.25s ease, gap 0.25s ease;
}

.movement-lineage-sticky-header.is-minimized .dedicated-header-panel {
  padding: 10px 24px 0;
  gap: 4px;
}

/* Hide or collapse dossier content when minimized so chart gets maximum space */
.movement-lineage-sticky-header.is-minimized .dossier-content {
  max-height: 0 !important;
  min-height: 0 !important;
  padding: 0 4px !important;
  margin: 0 !important;
  opacity: 0;
  overflow: hidden;
  border: none;
}

.hero-identity {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}

.hero-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.era-pill {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.period-pill {
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
}

.hero-title-text {
  font-family: var(--font-heading, var(--font-body, sans-serif));
  font-size: 1.6rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  margin: 0;
  max-height: 80px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease, font-size 0.25s ease, margin 0.25s ease;
}

.movement-lineage-sticky-header.is-minimized .hero-title-text {
  font-size: 1.25rem;
  max-height: 38px;
  opacity: 1;
  margin: 0;
}

/* Material Tab Bar inside Dossier */
.dossier-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.12);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

.dossier-tabs::-webkit-scrollbar {
  display: none;
}

.dossier-tab {
  flex: 0 0 auto;
  padding: 14px 22px;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: transparent;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #64748b;
  cursor: pointer;
  transition: all 0.18s ease;
}

.dossier-tab:hover {
  color: #0f172a;
  background: rgba(15, 23, 42, 0.03);
}

.dossier-tab.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

.dossier-tab .dt-count {
  margin-left: 8px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #94a3b8;
  background: #f1f5f9;
  padding: 2px 8px;
  border-radius: 999px;
}

.dossier-tab.active .dt-count {
  color: #ffffff;
  background: #2563eb;
}

/* Dossier Content Area */
.dossier-content {
  min-height: 120px;
  max-height: 480px;
  overflow-y: auto;
  padding: 20px 4px 24px;
}

.desc-para {
  font-family: var(--font-body, inherit);
  font-size: 0.95rem;
  line-height: 1.6;
  color: #334155;
  margin-bottom: 14px;
}

.desc-para:last-of-type {
  margin-bottom: 0;
}

.desc-readmore {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.desc-readmore-link,
.dossier-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 6px 14px;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.desc-inline-readmore {
  display: inline;
  font-weight: 600;
  color: #2563eb;
  text-decoration: underline;
  white-space: nowrap;
  font-size: inherit;
  transition: color 0.15s ease;
}

.desc-inline-readmore:hover {
  color: #1d4ed8;
}

.desc-readmore-link:hover,
.dossier-link:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

/* Responsive grid for structured lists (Artists / Facts / Related) */
.dossier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 12px;
}

.dossier-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 12px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.dossier-item:hover {
  border-color: rgba(15, 23, 42, 0.18);
  transform: translateY(-1px);
}

.dossier-item-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
}

a.dossier-item-title.link {
  text-decoration: none;
}

a.dossier-item-title.link:hover {
  color: #2563eb;
  text-decoration: underline;
}

.dossier-item-sub {
  font-size: 0.84rem;
  line-height: 1.45;
  color: #475569;
}

.dossier-fact {
  font-size: 0.9rem;
  line-height: 1.55;
  color: #334155;
}

.dossier-source {
  align-self: flex-start;
  margin-top: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #2563eb;
  text-decoration: none;
}

.dossier-source:hover {
  text-decoration: underline;
}

.dossier-empty {
  padding: 32px 16px;
  font-size: 0.95rem;
  color: #64748b;
  text-align: center;
  background: #f8fafc;
  border-radius: 12px;
  border: 1px dashed rgba(15, 23, 42, 0.15);
}

/* Artworks Gallery inside Tab View */
.dossier-artwork-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.dossier-artwork-card {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  overflow: hidden;
  background: #ffffff;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}

.dossier-artwork-card:hover {
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
  transform: translateY(-2px);
}

.dossier-artwork-thumb {
  position: relative;
  width: 100%;
  height: 150px;
  background: #f1f5f9;
  overflow: hidden;
}

.dossier-artwork-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dossier-artwork-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(45deg, #f8fafc, #f8fafc 10px, #f1f5f9 10px, #f1f5f9 20px);
}

.dossier-artwork-thumb.placeholder a {
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(15, 23, 42, 0.15);
  border-radius: 999px;
  padding: 6px 14px;
  text-decoration: none;
}

.dossier-artwork-thumb.placeholder a:hover {
  color: #2563eb;
}

.dossier-artwork-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px 14px;
}

.dossier-artwork-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #0f172a;
  text-decoration: none;
  line-height: 1.3;
}

.dossier-artwork-title:hover {
  color: #2563eb;
  text-decoration: underline;
}

.dossier-artwork-meta {
  font-size: 0.78rem;
  font-weight: 600;
  color: #64748b;
}

.dossier-artwork-sig {
  font-size: 0.8rem;
  line-height: 1.45;
  color: #475569;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 2px;
}

.dossier-artwork-credit {
  margin-top: 4px;
  font-size: 0.72rem;
  font-weight: 400;
  line-height: 1.35;
  color: #64748b;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dossier-artwork-credit:hover {
  color: #2563eb;
  text-decoration: underline;
}

/* Shop tab formatting - break out of container padding & override section grid to ensure 100% full width */
@media (min-width: 768px) {
  .dedicated-header-panel:has(.dossier-panel-shop:not([hidden])) {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .dedicated-header-panel:has(.dossier-panel-shop:not([hidden])) .hero-identity,
  .dedicated-header-panel:has(.dossier-panel-shop:not([hidden])) .dossier-tabs {
    padding-left: 24px;
    padding-right: 24px;
  }

  .dossier-content:has(.dossier-panel-shop:not([hidden])) {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

@media (max-width: 767px) {
  .dedicated-header-panel:has(.dossier-panel-shop.is-accordion-open) {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .dedicated-header-panel:has(.dossier-panel-shop.is-accordion-open) .hero-identity {
    padding-left: 24px;
    padding-right: 24px;
  }

  .dedicated-header-panel:has(.dossier-panel-shop.is-accordion-open) .dossier-panel-shop .dossier-accordion-header {
    padding-left: 24px;
    padding-right: 24px;
  }

  .dossier-content:has(.dossier-panel-shop.is-accordion-open) {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

.dossier-panel-shop {
  width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
}

.dossier-panel-shop .mv-section,
.dossier-panel-shop .movement-products-section,
.dossier-panel-shop .movement-products,
.dossier-panel-shop .section,
.dossier-shop-products-wrap,
.dossier-shop-products-wrap .section,
.dossier-shop-products-wrap .movement-products {
  display: block !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  grid-template-columns: 1fr !important;
}

.dossier-panel-shop .movement-products > *,
.dossier-panel-shop .section > *,
.dossier-shop-products-wrap .movement-products > *,
.dossier-shop-products-wrap .section > * {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  max-width: 100% !important;
}

.dossier-panel-shop .movement-products__header,
.dossier-shop-products-wrap .movement-products__header {
  margin-top: 0 !important;
  margin-bottom: 16px !important;
  padding-left: 24px !important;
  padding-right: 24px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.dossier-panel-shop .movement-products__carousel-wrapper,
.dossier-shop-products-wrap .movement-products__carousel-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
}

.dossier-panel-shop .movement-products__grid.movement-products__carousel,
.dossier-shop-products-wrap .movement-products__grid.movement-products__carousel {
  width: 100% !important;
  max-width: 100% !important;
  padding-left: 24px !important;
  padding-right: 24px !important;
  box-sizing: border-box !important;
  margin: 0 !important;
}

.dossier-panel-shop .movement-products__nav--prev,
.dossier-shop-products-wrap .movement-products__nav--prev {
  left: 8px !important;
}

.dossier-panel-shop .movement-products__nav--next,
.dossier-shop-products-wrap .movement-products__nav--next {
  right: 8px !important;
}

.dossier-shop-header {
  margin-bottom: 16px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
}

.dossier-shop-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

/* Lineage Header Title Bar */
.movement-lineage-header {
  padding: 12px 24px;
  background: #f8fafc;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  border-bottom: 1px solid rgba(15, 23, 42, 0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  max-height: 140px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.25s ease, padding 0.25s ease, opacity 0.2s ease, margin 0.25s ease;
}

.movement-lineage-sticky-header.is-minimized .movement-lineage-header {
  max-height: 0 !important;
  padding: 0 24px !important;
  margin: 0 !important;
  border-top: none !important;
  border-bottom: none !important;
  opacity: 0;
  overflow: hidden;
}

.movement-lineage-heading {
  margin: 0;
  font-family: var(--font-heading, var(--font-body, sans-serif));
  font-size: 1.125rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
  transition: font-size 0.25s ease;
}

.movement-lineage-subheading {
  margin: 2px 0 0 0;
  font-family: var(--font-body, sans-serif);
  font-size: 0.82rem;
  color: #64748b;
  max-height: 80px;
  opacity: 1;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease, margin 0.25s ease;
}

.movement-lineage-sticky-header.is-minimized .movement-lineage-subheading {
  max-height: 0;
  opacity: 0;
  margin: 0;
}

/* Dedicated Lineage Canvas Container */
.dedicated-canvas-container {
  flex: 1;
  width: 100%;
  position: relative;
  overflow: hidden;
  background-color: #ffffff;
  border-top: 1px solid rgba(15, 23, 42, 0.12);
}

.dedicated-canvas-container .dedicated-legend {
  position: absolute;
  bottom: 24px;
  left: 24px;
  top: auto;
  z-index: 20;
}

/* Reset Zoom Button inside Canvas Top-Right */
.reset-zoom-btn {
  position: absolute;
  right: 20px;
  top: 16px;
  z-index: 25;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.76rem;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
  transition: all 0.2s ease;
}

.reset-zoom-btn:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: rgba(15, 23, 42, 0.35);
}

.movement-lineage-svg {
  width: 100%;
  height: 100%;
  display: block;
  user-select: none;
}

/* Tooltip */
.movement-lineage-tooltip {
  position: absolute;
  z-index: 100000;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s ease;
  transform: none !important;
  margin: 0 !important;
  max-width: 280px;
}

.movement-lineage-tooltip.visible {
  opacity: 1;
}

.movement-lineage-tooltip-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
}

.movement-lineage-tooltip-meta {
  font-size: 0.8rem;
  color: #475569;
}

.movement-lineage-tooltip-era {
  font-size: 0.75rem;
  color: #2563eb;
  margin-top: 4px;
  font-weight: 600;
}

/* ── Static Server-Rendered Movement Page (`.movement-page-*`) Styles ── */
.movement-page-container,
.movement-page-dossier-ssr {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.movement-page-dossier-ssr .dossier-panel {
  margin-bottom: 36px;
}

.dossier-panel-heading {
  font-family: var(--font-heading, inherit);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--ink, #0f172a);
  margin: 0 0 16px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
}

.dedicated-header-panel .dossier-content .dossier-panel-heading {
  display: none !important;
}

.movement-page-section {
  margin-top: 40px;
  margin-bottom: 40px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.movement-page-intro {
  margin-top: 16px;
}

.movement-page-intro-p,
.movement-page-teaser-p {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ink, #0f172a);
  margin-bottom: 16px;
}

.movement-page-section h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  color: var(--ink, #0f172a);
}

/* Facts Box */
.movement-page-facts-box {
  margin: 24px 0 32px 0;
  padding: 20px 24px;
  background-color: rgba(15, 23, 42, 0.03);
  border-left: 3px solid rgba(15, 23, 42, 0.25);
  border-radius: 4px;
  box-sizing: border-box;
}

.movement-page-fact {
  margin: 6px 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink, #0f172a);
}

.movement-page-fact strong {
  font-weight: 600;
}

body:has(.dedicated-view) .mv-section:has(.movement-page-dossier-ssr),
body:has(.dedicated-view) .mv-section:has(.movement-page-container),
body:has(.dedicated-view) .main-page h1,
body:has(.dedicated-view) .main-page .heading,
body:has(.dedicated-view) .mv-section:has(.main-page) h1:not(.hero-title-text) {
  display: none !important;
}

/* --- Lineage explainer: Tier 1 accessible chart summary (icon-only disclosure, top-right of the
   Description panel). Emitted server-side by sync-movement-pages.js as a native <details>. --- */
.lineage-explainer {
  float: right;
  margin: 0 0 10px 14px;
  max-width: 340px;
}
.lineage-explainer > summary.lineage-explainer-toggle {
  list-style: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid #ccc;
  border-radius: 50%;
  background: #fff;
  color: #334155;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.lineage-explainer > summary.lineage-explainer-toggle::-webkit-details-marker { display: none; }
.lineage-explainer > summary.lineage-explainer-toggle:hover { background: #f2f2f2; border-color: #999; }
.lineage-explainer > summary.lineage-explainer-toggle:focus-visible { outline: 2px solid #334155; outline-offset: 2px; }
.lineage-explainer[open] > summary.lineage-explainer-toggle { background: #334155; border-color: #334155; color: #fff; }
.lineage-explainer-body {
  margin-top: 8px;
  padding: 12px 14px;
  background: #f7f7f7;
  border: 1px solid #eee;
  border-radius: 8px;
  font-size: 0.9em;
  line-height: 1.55;
  color: #36322e;
}
.lineage-explainer-body p { margin: 0 0 8px; }
.lineage-explainer-body p:last-child { margin: 0; }

/* Narrow viewports (incl. the mobile Description accordion): span full width instead of a cramped float. */
@media (max-width: 600px) {
  .lineage-explainer { float: none; max-width: none; margin: 0 0 12px; }
  .lineage-explainer-body { font-size: 0.95em; }
}