#lineage-panel {
  position: fixed;
  top: 158px;
  left: 20px;
  width: 218px;
  max-height: calc(100dvh - 360px);
  overflow-y: auto;
  scrollbar-width: thin;
  z-index: 10;
  color: #33485b;
}
.lineage-card {
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(50,80,110,.14);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 12px;
  box-shadow: 0 4px 20px rgba(38,72,101,.06);
}
.lineage-heading {
  margin: 0;
  padding: 10px 12px 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(50,80,110,.08);
}
.lineage-heading span { color: #1565c0; }
.lineage-art {
  position: relative;
  width: 100%;
  height: clamp(82px, calc((100dvh - 560px) / 3), 150px);
  background: #eef2f6;
  overflow: hidden;
}
.lineage-image-window {
  position: absolute;
  height: 100%;
  aspect-ratio: 1;
  left: 50%;
  transform: translateX(-50%);
  overflow: hidden;
}
.lineage-image-window img {
  position: absolute;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}
.lineage-image-window img.is-atlas { width: 400%; height: 300%; }
.lineage-art.is-wide .lineage-image-window { width: 100%; aspect-ratio: auto; }
.lineage-art.is-wide img { object-fit: contain; }
.lineage-status {
  position: absolute; right: 5px; bottom: 5px;
  padding: 3px 6px; border-radius: 5px;
  background: rgba(255,248,226,.95); color: #785017;
  font-size: 9px; font-weight: 700;
}
.lineage-status[hidden] { display: none; }
.lineage-art.is-unknown .lineage-image-window,
.lineage-art.image-unavailable .lineage-image-window { display: none; }
.lineage-empty {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  padding: 16px;
  text-align: center;
  font-size: 13px;
  color: #657b8d;
}
.lineage-art.is-unknown .lineage-empty,
.lineage-art.image-unavailable .lineage-empty { display: flex; }
.lineage-copy { padding: 9px 12px 12px; }
.lineage-name { font-size: 16px; line-height: 1.2; font-weight: 600; margin: 0 0 4px; }
.lineage-period { color: #1565c0; font: 700 9px 'JetBrains Mono', monospace; line-height: 1.5; }
.lineage-description { font-size: 11px; line-height: 1.4; margin: 5px 0 0; color: #637484; }
.lineage-note {
  background: rgba(255,255,255,.94);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 11px;
  line-height: 1.5;
}
.lineage-note summary { cursor: pointer; color: #1565c0; }
.lineage-note p { margin-top: 7px; }
.lineage-note a { color: #1565c0; }
@media (max-width: 1100px) {
  #lineage-panel { width: 178px; top: 180px; max-height: calc(100dvh - 380px); }
  .lineage-name { font-size: 14px; }
}
@media (min-width: 701px) and (max-height: 1050px) {
  #lineage-panel { top: 145px; max-height: calc(100dvh - 305px); }
  .lineage-card { display: grid; grid-template-columns: 82px minmax(0, 1fr); }
  .lineage-heading { grid-column: 1 / -1; }
  .lineage-art { height: 82px; }
  .lineage-name { font-size: 13px; }
  .lineage-copy { padding: 7px; }
  .lineage-heading { padding: 7px 10px; }
  .lineage-description { display: none; }
}
@media (max-width: 700px) {
  #lineage-panel {
    top: auto; bottom: 172px; left: 10px; right: 10px;
    width: auto; max-height: 180px;
    display: flex; gap: 8px; align-items: flex-start; overflow-x: auto;
    scroll-snap-type: x proximity;
  }
  .lineage-card { flex: 1 0 140px; min-width: 140px; margin: 0; scroll-snap-align: start; }
  .lineage-art { height: 72px; }
  .lineage-heading { padding: 6px 8px; font-size: 9px; }
  .lineage-copy { padding: 5px 8px 7px; }
  .lineage-name { font-size: 12px; }
  .lineage-period { font-size: 8px; }
  .lineage-description { display: none; }
  .lineage-note { display: none; }
}
