/* Wissensnetz: Geschichte der Informatik als synchronoptische Wissenskarte */

body.history-page {
  --history-panel-bg: linear-gradient(158deg, rgba(12, 21, 40, 0.86), rgba(8, 14, 28, 0.92));
  --history-panel-border: rgba(176, 200, 248, 0.24);
  --history-panel-border-strong: rgba(176, 200, 248, 0.38);
  --history-panel-shadow: inset 0 1px 0 rgba(232, 240, 255, 0.14), 0 12px 30px rgba(5, 10, 20, 0.34);
  --history-stage-bg: linear-gradient(180deg, rgba(10, 18, 35, 0.86), rgba(5, 10, 21, 0.9));
  --history-lane-label-width: clamp(150px, 12vw, 190px);
  --history-row-min-height: 104px;
  --history-muted: rgba(220, 231, 250, 0.72);
  color: #edf2ff;
}

body.history-page .main {
  align-items: stretch;
  justify-content: flex-start;
}

.history-page__shell {
  width: 100%;
  max-width: none;
  min-width: 0;
  display: grid;
  gap: 12px;
}

.history-hero,
.history-stage,
.history-info-section {
  width: 100%;
  max-width: none;
  margin: 0;
  border: 1px solid var(--history-panel-border);
  border-radius: 16px;
  background: var(--history-panel-bg);
  color: #edf2ff;
  box-shadow: var(--history-panel-shadow);
  backdrop-filter: blur(var(--glass-box-blur, 2px));
  -webkit-backdrop-filter: blur(var(--glass-box-blur, 2px));
}

.history-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: clamp(16px, 2vw, 24px);
}

.history-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 4.2rem);
  line-height: 0.98;
  color: #f7f9ff;
  letter-spacing: 0;
}

.history-hero__subtitle {
  display: block;
  margin-top: 10px;
  color: rgba(226, 237, 255, 0.82);
  font-size: clamp(1rem, 1.35vw, 1.22rem);
  font-weight: 650;
}

.history-hero__question {
  max-width: min(92ch, 100%);
  margin: 16px 0 0;
  padding-left: 14px;
  border-left: 3px solid rgba(127, 176, 255, 0.62);
  color: rgba(245, 248, 255, 0.96);
  font-size: clamp(0.98rem, 1.02vw, 1.08rem);
  line-height: 1.55;
}

.history-hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.history-stage {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.history-timeline-controls {
  position: sticky;
  top: 8px;
  left: 0;
  z-index: 70;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.history-timeline-summary {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid rgba(176, 200, 248, 0.16);
  border-radius: 8px;
  background: rgba(7, 13, 26, 0.76);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.history-map-meta {
  color: var(--history-muted);
  font-size: 0.76rem;
  line-height: 1.3;
  text-align: left;
  white-space: normal;
}

.history-statusbar {
  min-width: 0;
  color: rgba(255, 242, 214, 0.96);
  font: 720 0.8rem/1.3 var(--font-ui);
}

.history-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  gap: 12px;
  min-width: 0;
  align-items: start;
}

.history-selection-shell {
  min-width: 0;
  border: 1px solid var(--history-panel-border);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(14, 25, 47, 0.94), rgba(8, 14, 27, 0.94)),
    var(--history-stage-bg);
  box-shadow: inset 0 1px 0 rgba(232, 240, 255, 0.12);
  overflow: clip;
}

.history-selection-shell[hidden] {
  display: none;
}

.history-selection-empty,
.history-selection-toolbar,
.history-focus-tree,
.history-focus-local-gallery,
.history-focus-dataset {
  padding: 14px;
}

.history-selection-empty {
  display: grid;
  gap: 10px;
  min-height: 260px;
  align-content: center;
  justify-items: start;
}

.history-selection-empty h2,
.history-selection-toolbar h2 {
  margin: 0;
  color: #f7f9ff;
  font-size: clamp(1.18rem, 1.5vw, 1.6rem);
  line-height: 1.18;
}

.history-selection-empty p,
.history-selection-toolbar p,
.history-focus-tree__empty {
  margin: 0;
  color: rgba(226, 236, 255, 0.78);
  font-size: 0.9rem;
  line-height: 1.45;
}

.history-selection-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  border-bottom: 1px solid rgba(176, 200, 248, 0.16);
}

.history-selection-toolbar__title {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.history-selection-toolbar__title > span {
  width: fit-content;
  padding: 2px 7px;
  border: 1px solid rgba(255, 210, 124, 0.28);
  border-radius: 999px;
  background: rgba(255, 210, 124, 0.08);
  color: rgba(255, 230, 181, 0.96);
  font: 780 0.68rem/1.2 var(--font-ui);
  text-transform: uppercase;
}

.history-focus-tree {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(220px, 0.9fr) minmax(170px, 1fr);
  grid-template-areas:
    "pre center suc"
    "ctx ctx ctx";
  gap: 12px;
}

.history-focus-tree--relation {
  grid-template-areas:
    "pre center suc"
    "ctx ctx ctx";
}

.history-focus-tree__column,
.history-focus-tree__center,
.history-focus-tree__context {
  min-width: 0;
  border: 1px solid rgba(176, 200, 248, 0.16);
  border-radius: 10px;
  background: rgba(8, 15, 29, 0.48);
}

.history-focus-tree__column {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px;
}

.history-focus-tree__column--predecessor {
  grid-area: pre;
  border-color: rgba(255, 210, 124, 0.2);
}

.history-focus-tree__column--successor {
  grid-area: suc;
  border-color: rgba(126, 220, 160, 0.2);
}

.history-focus-tree__center {
  grid-area: center;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 12px;
  border-color: rgba(209, 226, 255, 0.34);
  background: rgba(16, 31, 56, 0.68);
}

.history-focus-tree__context {
  grid-area: ctx;
  display: grid;
  gap: 8px;
  padding: 10px;
}

.history-focus-tree h3 {
  margin: 0;
  color: rgba(244, 248, 255, 0.94);
  font-size: 0.78rem;
  line-height: 1.2;
  text-transform: uppercase;
}

.history-focus-branch-list,
.history-focus-context-list,
.history-focus-members {
  display: grid;
  gap: 8px;
}

.history-focus-context-list {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.history-focus-context-node {
  display: grid;
  gap: 5px;
}

.history-focus-context-node__reason,
.history-focus-more {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  border: 1px solid rgba(176, 200, 248, 0.16);
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(8, 15, 29, 0.58);
  color: rgba(226, 236, 255, 0.72);
  font: 700 0.68rem/1.2 var(--font-ui);
}

.history-focus-more {
  border-style: dashed;
  color: rgba(255, 230, 181, 0.82);
}

.history-focus-branch {
  display: grid;
  gap: 6px;
  align-content: start;
}

.history-focus-branch--predecessor {
  justify-items: end;
}

.history-focus-branch--successor,
.history-focus-branch--context {
  justify-items: start;
}

.history-focus-branch__connector {
  display: block;
  width: min(100%, 72px);
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--focus-edge-accent, #9db8ff) 54%, rgba(176, 200, 248, 0.18)), transparent);
  opacity: 0.72;
}

.history-focus-branch.is-weak {
  opacity: 0.72;
}

.history-focus-branch.is-secondary {
  border-left: 2px solid rgba(176, 200, 248, 0.18);
  padding-left: 8px;
}

.history-focus-node {
  appearance: none;
  display: grid;
  gap: 4px;
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(143, 170, 221, 0.24);
  border-radius: 8px;
  background: rgba(13, 24, 43, 0.72);
  color: rgba(238, 245, 255, 0.92);
  padding: 8px 9px;
  text-align: left;
}

button.history-focus-node {
  cursor: pointer;
}

button.history-focus-node:hover,
button.history-focus-node:focus-visible {
  border-color: rgba(188, 211, 255, 0.58);
  background: rgba(127, 176, 255, 0.14);
  outline: none;
}

.history-focus-node.is-focus {
  border-color: rgba(255, 230, 181, 0.42);
  background: linear-gradient(180deg, rgba(45, 62, 96, 0.76), rgba(16, 31, 56, 0.82));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 10px 24px rgba(0, 0, 0, 0.18);
}

.history-focus-node.is-dataset-active {
  border-color: rgba(255, 210, 124, 0.72);
  background: linear-gradient(180deg, rgba(65, 56, 34, 0.76), rgba(22, 32, 49, 0.82));
  box-shadow: 0 0 0 2px rgba(255, 210, 124, 0.12);
}

.history-focus-node.is-compact {
  padding: 6px 8px;
}

.history-focus-node__type {
  width: fit-content;
  color: rgba(255, 230, 181, 0.96);
  font: 780 0.66rem/1.2 var(--font-ui);
  text-transform: uppercase;
}

.history-focus-node strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #f8fbff;
  font-size: 0.9rem;
  line-height: 1.2;
}

.history-focus-node.is-focus strong {
  font-size: 1.02rem;
}

.history-focus-node__meta {
  min-width: 0;
  color: rgba(226, 236, 255, 0.72);
  font-size: 0.75rem;
  line-height: 1.25;
}

.history-focus-node__concepts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.history-focus-node__concepts span,
.history-focus-members__label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  border: 1px solid rgba(127, 176, 255, 0.24);
  border-radius: 999px;
  padding: 2px 7px;
  background: rgba(127, 176, 255, 0.08);
  color: rgba(238, 245, 255, 0.88);
  font-size: 0.7rem;
  line-height: 1.2;
}

.history-focus-node__badges span {
  border-color: rgba(255, 210, 124, 0.24);
  background: rgba(255, 210, 124, 0.08);
  color: rgba(255, 238, 202, 0.9);
}

.history-focus-edge-pill {
  appearance: none;
  justify-self: start;
  max-width: 100%;
  min-height: 28px;
  border: 1px solid color-mix(in srgb, var(--focus-edge-accent, #9db8ff) 44%, rgba(143, 170, 221, 0.24));
  border-radius: 999px;
  background: color-mix(in srgb, var(--focus-edge-accent, #9db8ff) 13%, rgba(8, 15, 29, 0.82));
  color: rgba(244, 248, 255, 0.94);
  padding: 4px 9px;
  font: 720 0.72rem/1.15 var(--font-ui);
  text-align: left;
  white-space: normal;
  cursor: pointer;
}

.history-focus-edge-pill:hover,
.history-focus-edge-pill:focus-visible {
  border-color: color-mix(in srgb, var(--focus-edge-accent, #9db8ff) 72%, white 10%);
  background: color-mix(in srgb, var(--focus-edge-accent, #9db8ff) 22%, rgba(12, 23, 42, 0.8));
  outline: none;
}

.history-focus-members {
  padding-top: 8px;
  border-top: 1px solid rgba(176, 200, 248, 0.14);
}

.history-focus-local-gallery,
.history-focus-dataset {
  display: grid;
  gap: 10px;
  border-top: 1px solid rgba(176, 200, 248, 0.16);
}

.history-focus-local-gallery h2,
.history-focus-dataset h2 {
  margin: 0;
  color: #f7f9ff;
  font-size: 1rem;
  line-height: 1.2;
}

.history-focus-local-gallery__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.history-focus-local-gallery__item {
  appearance: none;
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  min-width: 0;
  min-height: 74px;
  border: 1px solid rgba(143, 170, 221, 0.24);
  border-radius: 8px;
  background: rgba(13, 24, 43, 0.68);
  color: rgba(238, 245, 255, 0.92);
  padding: 6px;
  text-align: left;
  cursor: pointer;
}

.history-focus-local-gallery__item:hover,
.history-focus-local-gallery__item:focus-visible {
  border-color: rgba(255, 210, 124, 0.6);
  background: rgba(28, 43, 70, 0.82);
  outline: none;
}

.history-focus-local-gallery__thumb {
  display: grid;
  place-items: center;
  min-width: 0;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(8, 15, 29, 0.78);
}

.history-focus-local-gallery__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-focus-local-gallery__meta {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
}

.history-focus-local-gallery__meta strong,
.history-focus-local-gallery__meta span,
.history-focus-local-gallery__meta small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.history-focus-local-gallery__meta strong {
  color: #f8fbff;
  font-size: 0.78rem;
  line-height: 1.2;
}

.history-focus-local-gallery__meta span {
  color: rgba(226, 236, 255, 0.76);
  font-size: 0.72rem;
  line-height: 1.25;
}

.history-focus-local-gallery__meta small {
  color: rgba(255, 230, 181, 0.78);
  font: 720 0.66rem/1.2 var(--font-ui);
}

.history-focus-dataset__list {
  display: grid;
  gap: 8px;
}

.history-focus-dataset-card {
  border: 1px solid rgba(143, 170, 221, 0.22);
  border-radius: 8px;
  background: rgba(8, 15, 29, 0.44);
  color: rgba(238, 245, 255, 0.9);
  overflow: clip;
}

.history-focus-dataset-card.is-focus {
  border-color: rgba(209, 226, 255, 0.34);
  background: rgba(15, 28, 50, 0.62);
}

.history-focus-dataset-card.is-active {
  border-color: rgba(255, 210, 124, 0.68);
  box-shadow: 0 0 0 2px rgba(255, 210, 124, 0.12);
}

.history-focus-dataset-card__summary {
  display: grid;
  gap: 4px;
  padding: 10px;
  cursor: pointer;
}

.history-focus-dataset-card__summary:focus-visible {
  outline: 2px solid rgba(255, 210, 124, 0.58);
  outline-offset: -2px;
}

.history-focus-dataset-card__role {
  width: fit-content;
  padding: 2px 7px;
  border: 1px solid rgba(255, 210, 124, 0.24);
  border-radius: 999px;
  background: rgba(255, 210, 124, 0.08);
  color: rgba(255, 230, 181, 0.94);
  font: 780 0.66rem/1.2 var(--font-ui);
  text-transform: uppercase;
}

.history-focus-dataset-card__summary strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #f8fbff;
  font-size: 0.92rem;
  line-height: 1.22;
}

.history-focus-dataset-card__meta {
  color: rgba(226, 236, 255, 0.72);
  font-size: 0.75rem;
  line-height: 1.25;
}

.history-focus-dataset-card__body {
  display: grid;
  gap: 10px;
  padding: 0 10px 12px;
}

.history-focus-dataset-card__section {
  display: grid;
  gap: 5px;
}

.history-focus-dataset-card__section h3 {
  margin: 0;
  color: rgba(244, 248, 255, 0.96);
  font-size: 0.76rem;
  line-height: 1.2;
  text-transform: uppercase;
}

.history-focus-dataset-card__section p {
  margin: 0;
  color: rgba(226, 236, 255, 0.82);
  font-size: 0.88rem;
  line-height: 1.48;
}

.history-timeline-shell {
  position: relative;
  min-width: 0;
  overflow: auto;
  border: 1px solid var(--history-panel-border);
  border-radius: 14px;
  background: var(--history-stage-bg);
  box-shadow: inset 0 1px 0 rgba(232, 240, 255, 0.12);
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  cursor: grab;
}

.history-timeline-shell.is-panning,
.history-timeline-shell.is-panning * {
  cursor: grabbing !important;
  user-select: none;
}

.history-timeline-shell button,
.history-timeline-shell a[href],
.history-timeline-shell input,
.history-timeline-shell textarea,
.history-timeline-shell select,
.history-event-card,
.history-group-card,
.history-group-card__select,
.history-group-card__toggle,
.history-relation-edge,
.history-relation-edge__hit {
  cursor: pointer;
}

.history-floating-toolbar {
  position: relative;
  z-index: 60;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px;
  border: 1px solid rgba(190, 213, 255, 0.22);
  border-radius: 8px;
  background: rgba(7, 13, 26, 0.82);
  box-shadow: 0 10px 24px rgba(2, 8, 20, 0.26);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.history-floating-toolbar__search {
  display: grid;
  min-width: 148px;
}

.history-floating-toolbar__search label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.history-floating-search {
  width: min(210px, 32vw);
  min-height: 32px;
  border: 1px solid rgba(190, 213, 255, 0.24);
  border-radius: 7px;
  background: rgba(9, 17, 32, 0.92);
  color: #f4f8ff;
  padding: 6px 10px;
  font: 650 0.78rem/1.2 var(--font-ui);
}

.history-floating-search:focus-visible {
  border-color: rgba(255, 210, 124, 0.68);
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 210, 124, 0.18);
}

.history-floating-menu {
  position: relative;
}

.history-floating-menu[hidden],
.history-floating-menu__panel[hidden],
.history-context-menu[hidden] {
  display: none;
}

.history-floating-menu__trigger,
.history-floating-menu__panel button,
.history-context-menu button {
  appearance: none;
  min-height: 32px;
  border: 1px solid rgba(190, 213, 255, 0.22);
  border-radius: 7px;
  background: rgba(14, 25, 45, 0.88);
  color: rgba(244, 248, 255, 0.94);
  padding: 6px 10px;
  font: 730 0.76rem/1.15 var(--font-ui);
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.history-floating-menu__trigger:hover,
.history-floating-menu__trigger:focus-visible,
.history-floating-menu__panel button:hover,
.history-floating-menu__panel button:focus-visible,
.history-context-menu button:hover,
.history-context-menu button:focus-visible {
  border-color: rgba(255, 210, 124, 0.52);
  background: rgba(35, 51, 80, 0.94);
  outline: none;
}

.history-floating-menu__trigger[aria-expanded="true"],
.history-floating-menu__panel button[aria-pressed="true"],
.history-floating-menu__panel button[aria-current="true"] {
  border-color: rgba(255, 210, 124, 0.58);
  background: rgba(255, 210, 124, 0.16);
  color: #fff3cf;
}

.history-floating-menu__panel {
  position: absolute;
  inset-block-start: calc(100% + 6px);
  inset-inline-start: 0;
  z-index: 80;
  display: grid;
  gap: 5px;
  min-width: 190px;
  max-width: min(360px, calc(100vw - 34px));
  padding: 7px;
  border: 1px solid rgba(190, 213, 255, 0.24);
  border-radius: 8px;
  background: rgba(7, 13, 26, 0.97);
  box-shadow: 0 18px 34px rgba(2, 8, 20, 0.44);
}

.history-floating-menu:last-child .history-floating-menu__panel {
  inset-inline: auto 0;
}

.history-floating-menu__panel--wide {
  min-width: 260px;
}

.history-floating-menu__label {
  color: rgba(226, 236, 255, 0.72);
  font: 760 0.67rem/1 var(--font-ui);
  text-transform: uppercase;
}

.history-floating-menu__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.history-floating-menu__chips button {
  min-height: 28px;
  padding: 5px 8px;
  white-space: normal;
}

.history-context-menu {
  position: fixed;
  z-index: 1000;
  display: grid;
  gap: 4px;
  width: max-content;
  min-width: 205px;
  max-width: min(270px, calc(100vw - 18px));
  padding: 6px;
  border: 1px solid rgba(190, 213, 255, 0.28);
  border-radius: 8px;
  background: rgba(7, 13, 26, 0.98);
  box-shadow: 0 18px 36px rgba(2, 8, 20, 0.48);
}

.history-context-menu button {
  width: 100%;
  min-height: 30px;
  border-color: rgba(190, 213, 255, 0.16);
  background: transparent;
  white-space: normal;
}

.history-media-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.history-context-menu .history-media-strip {
  max-width: 286px;
  padding: 3px 2px 6px;
  border-bottom: 1px solid rgba(190, 213, 255, 0.16);
}

.history-media-thumb {
  appearance: none;
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 58px;
  height: 46px;
  min-height: 46px;
  overflow: hidden;
  border: 1px solid rgba(190, 213, 255, 0.26);
  border-radius: 7px;
  background: rgba(13, 24, 43, 0.76);
  color: rgba(244, 248, 255, 0.92);
  padding: 0;
  cursor: pointer;
}

.history-context-menu .history-media-strip button.history-media-thumb {
  width: 54px;
  min-height: 42px;
  height: 42px;
  padding: 0;
}

.history-media-thumb:hover,
.history-media-thumb:focus-visible {
  border-color: rgba(255, 210, 124, 0.62);
  background: rgba(35, 51, 80, 0.94);
  outline: none;
}

.history-media-thumb__image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.history-media-thumb__placeholder {
  color: rgba(226, 236, 255, 0.72);
  font: 760 0.68rem/1.1 var(--font-ui);
}

.history-media-thumb__caption {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  padding: 2px 4px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(4, 9, 18, 0), rgba(4, 9, 18, 0.86));
  color: rgba(248, 251, 255, 0.94);
  font: 720 0.62rem/1.1 var(--font-ui);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-media-thumb--feature {
  width: 118px;
  height: 84px;
  min-height: 84px;
}

.history-media-thumb--more {
  width: auto;
  min-width: 58px;
  padding: 4px 6px;
  font: 760 0.68rem/1.15 var(--font-ui);
  text-align: center;
}

.history-detail-section--media {
  gap: 8px;
}

.history-media-feature {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.history-media-attribution {
  display: grid;
  gap: 2px;
  min-width: 0;
  color: rgba(226, 236, 255, 0.72);
  font-size: 0.74rem;
  line-height: 1.28;
}

.history-gallery-overlay[hidden] {
  display: none;
}

.history-gallery-overlay {
  position: fixed;
  inset: 0;
  z-index: 1600;
  display: grid;
  place-items: center;
  padding: 18px;
}

.history-gallery-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 16, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.history-gallery-dialog {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  width: min(1080px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 1px solid rgba(202, 221, 255, 0.3);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(10, 18, 34, 0.98), rgba(6, 12, 24, 0.98));
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(232, 240, 255, 0.12);
  padding: 10px;
}

.history-gallery-dialog:focus-visible {
  outline: 2px solid rgba(255, 210, 124, 0.5);
  outline-offset: 3px;
}

.history-gallery-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.history-gallery-counter {
  color: rgba(226, 236, 255, 0.76);
  font: 760 0.78rem/1.2 var(--font-ui);
}

.history-gallery-close,
.history-gallery-nav {
  appearance: none;
  border: 1px solid rgba(190, 213, 255, 0.26);
  border-radius: 7px;
  background: rgba(14, 25, 45, 0.88);
  color: rgba(244, 248, 255, 0.94);
  cursor: pointer;
}

.history-gallery-close {
  min-height: 32px;
  padding: 6px 10px;
  font: 760 0.76rem/1.15 var(--font-ui);
}

.history-gallery-nav {
  display: grid;
  place-items: center;
  width: 34px;
  height: 46px;
  padding: 0;
  font: 860 1.3rem/1 var(--font-ui);
}

.history-gallery-close:hover,
.history-gallery-close:focus-visible,
.history-gallery-nav:hover,
.history-gallery-nav:focus-visible {
  border-color: rgba(255, 210, 124, 0.62);
  background: rgba(35, 51, 80, 0.94);
  outline: none;
}

.history-gallery-nav:disabled {
  opacity: 0.42;
  cursor: default;
}

.history-gallery-stage {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.history-gallery-image-surface {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: min(52vh, 520px);
  border: 1px solid rgba(176, 200, 248, 0.16);
  border-radius: 8px;
  background: rgba(4, 9, 18, 0.68);
  overflow: hidden;
}

.history-gallery-image {
  display: block;
  max-width: min(90vw, 100%);
  max-height: 72vh;
  object-fit: contain;
}

.history-gallery-error {
  margin: 0;
  color: rgba(255, 213, 198, 0.94);
  font: 760 0.9rem/1.3 var(--font-ui);
}

.history-gallery-meta {
  display: grid;
  gap: 4px;
  color: rgba(226, 236, 255, 0.82);
}

.history-gallery-meta h2 {
  margin: 0;
  color: #f8fbff;
  font-size: 1rem;
  line-height: 1.25;
}

.history-gallery-meta p {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.35;
}

.history-gallery-credit,
.history-gallery-links {
  color: rgba(226, 236, 255, 0.7);
}

.history-gallery-meta a {
  color: rgba(255, 230, 181, 0.96);
  text-decoration: underline;
  text-underline-offset: 2px;
}

body.history-gallery-is-open {
  overflow: hidden;
}

.history-timeline {
  --history-time-width: 1200px;
  position: relative;
  width: max-content;
  min-width: 100%;
  color: #edf2ff;
}

.history-epoch-row,
.history-lane-row {
  display: grid;
  grid-template-columns: var(--history-lane-label-width) var(--history-time-width);
  width: max-content;
  min-width: 100%;
}

.history-epoch-row {
  position: sticky;
  top: 0;
  z-index: 12;
  min-height: 68px;
  border-bottom: 1px solid rgba(176, 200, 248, 0.24);
  background: rgba(7, 13, 26, 0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.history-timeline-corner,
.history-lane-label {
  position: sticky;
  left: 0;
  z-index: 10;
  border-right: 1px solid rgba(176, 200, 248, 0.22);
  background: rgba(8, 15, 29, 0.96);
}

.history-timeline-corner {
  z-index: 14;
  display: grid;
  gap: 2px;
  align-content: center;
  padding: 8px 10px;
  color: rgba(230, 240, 255, 0.72);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

.history-timeline-corner strong,
.history-timeline-corner span {
  display: block;
  min-width: 0;
  line-height: 1.12;
}

.history-timeline-corner strong {
  color: #f5f8ff;
  font-size: 0.78rem;
}

.history-timeline-corner span {
  color: rgba(222, 233, 255, 0.58);
  font-size: 0.62rem;
  font-weight: 650;
}

.history-time-header {
  position: relative;
  min-height: 68px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 96px 100%,
    rgba(8, 15, 29, 0.72);
}

.history-epoch-band {
  position: absolute;
  inset-block: 0;
  display: grid;
  align-content: start;
  min-width: 28px;
  padding: 8px 9px 28px;
  border-right: 1px solid rgba(176, 200, 248, 0.2);
  border-left: 1px solid rgba(176, 200, 248, 0.12);
  background: linear-gradient(180deg, rgba(32, 52, 88, 0.48), rgba(12, 24, 46, 0.28));
  box-shadow: inset 1px 0 0 rgba(255, 255, 255, 0.05);
}

.history-epoch-band:nth-child(even) {
  background: linear-gradient(180deg, rgba(41, 61, 96, 0.54), rgba(16, 29, 52, 0.34));
}

.history-epoch-band__label {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  color: #f5f8ff;
  font-size: 0.82rem;
  line-height: 1.15;
  text-overflow: ellipsis;
}

.history-time-axis-title {
  position: absolute;
  inset-inline-start: 9px;
  inset-block-end: 22px;
  z-index: 4;
  padding: 1px 5px 2px 0;
  background: linear-gradient(90deg, rgba(8, 15, 29, 0.9), rgba(8, 15, 29, 0));
  color: rgba(226, 237, 255, 0.72);
  font-size: 0.62rem;
  font-weight: 760;
  line-height: 1.1;
  text-transform: uppercase;
  pointer-events: none;
}

.history-time-axis {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  z-index: 3;
  height: 24px;
  color: rgba(229, 239, 255, 0.82);
  pointer-events: none;
}

.history-time-axis::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-start: 5px;
  height: 1px;
  background: linear-gradient(90deg, rgba(229, 239, 255, 0.58), rgba(229, 239, 255, 0.76), rgba(229, 239, 255, 0.58));
}

.history-time-axis-tick {
  position: absolute;
  inset-block: 0;
  inset-inline-start: var(--tick-x);
  width: 0;
}

.history-time-axis-tick::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 1px;
  width: 1px;
  height: 10px;
  background: rgba(245, 248, 255, 0.78);
  transform: translateX(-0.5px);
}

.history-time-axis-label {
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: 11px;
  color: rgba(245, 248, 255, 0.88);
  font-size: 0.68rem;
  font-weight: 720;
  line-height: 1;
  white-space: nowrap;
  transform: translateX(-50%);
}

.history-time-axis-tick.is-first .history-time-axis-label {
  transform: translateX(0);
}

.history-time-axis-tick.is-last .history-time-axis-label {
  transform: translateX(-100%);
}

.history-lane-row {
  border-bottom: 1px solid rgba(176, 200, 248, 0.14);
}

.history-lane-row:last-child {
  border-bottom: 0;
}

.history-lane-label {
  display: grid;
  align-content: start;
  gap: 3px;
  min-height: 100%;
  padding: 9px 10px;
}

.history-lane-label strong {
  color: #f4f8ff;
  font-size: 0.82rem;
  line-height: 1.2;
}

.history-lane-label span {
  color: rgba(218, 230, 255, 0.66);
  font-size: 0.68rem;
  line-height: 1.28;
}

.history-lane-track {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0) 0,
      rgba(255, 255, 255, 0) 61px,
      rgba(176, 200, 248, 0.09) 61px,
      rgba(176, 200, 248, 0.09) 62px,
      rgba(255, 255, 255, 0) 62px,
      rgba(255, 255, 255, 0) 68px
    ),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px) 0 0 / 96px 100%,
    rgba(255, 255, 255, 0.015);
}

.history-lane-epoch-band {
  position: absolute;
  inset-block: 0;
  border-right: 1px solid rgba(176, 200, 248, 0.12);
  border-left: 1px solid rgba(176, 200, 248, 0.05);
  background: rgba(255, 255, 255, 0.018);
  pointer-events: none;
}

.history-lane-epoch-band:nth-child(even) {
  background: rgba(255, 255, 255, 0.034);
}

.history-relation-layer {
  position: absolute;
  left: var(--history-lane-label-width);
  z-index: 1;
  width: var(--history-time-width);
  overflow: visible;
  pointer-events: none;
}

.history-relation-edge {
  color: var(--relation-accent, #9db8ff);
  outline: none;
}

.history-relation-edge__line {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.2;
  vector-effect: non-scaling-stroke;
  transition: opacity 140ms ease, stroke-width 140ms ease;
}

.history-relation-edge__arrow {
  fill: currentColor;
  opacity: 0.46;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.history-relation-edge__hit {
  fill: none;
  stroke: transparent;
  stroke-width: 16;
  pointer-events: stroke;
  cursor: pointer;
}

.history-relation-edge__line.is-dashed {
  stroke-dasharray: 8 8;
}

.history-relation-edge__line.is-dotted {
  stroke-dasharray: 2 7;
}

.history-relation-edge.has-lineage .history-relation-edge__line {
  opacity: 0.42;
}

.history-relation-edge.is-context-active .history-relation-edge__line {
  opacity: 0.54;
}

.history-relation-edge:hover .history-relation-edge__line,
.history-relation-edge:focus .history-relation-edge__line {
  stroke-width: 1.75;
  opacity: 0.68;
}

.history-relation-edge:hover .history-relation-edge__arrow,
.history-relation-edge:focus .history-relation-edge__arrow,
.history-relation-edge.is-context-active .history-relation-edge__arrow {
  opacity: 0.72;
}

.history-relation-edge.is-fixed .history-relation-edge__line {
  stroke-width: 2.2;
  opacity: 0.9;
}

.history-relation-edge.is-fixed .history-relation-edge__arrow {
  opacity: 0.9;
}

.history-relation-edge.is-weak:not(.is-context-active):not(.is-fixed) .history-relation-edge__line {
  opacity: 0.09;
}

.history-relation-edge.is-weak:not(.is-context-active):not(.is-fixed) .history-relation-edge__arrow {
  opacity: 0.18;
}

.history-relation-edge.is-selection-inactive .history-relation-edge__line {
  stroke-width: 1;
  opacity: 0.045;
}

.history-relation-edge.is-selection-inactive .history-relation-edge__arrow {
  opacity: 0.08;
}

.history-relation-edge.is-selection-inactive:hover .history-relation-edge__line,
.history-relation-edge.is-selection-inactive:focus .history-relation-edge__line {
  stroke-width: 1.35;
  opacity: 0.18;
}

.history-relation-edge.is-selection-inactive:hover .history-relation-edge__arrow,
.history-relation-edge.is-selection-inactive:focus .history-relation-edge__arrow {
  opacity: 0.24;
}

.history-relation-edge__label {
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.history-relation-edge:hover .history-relation-edge__label,
.history-relation-edge:focus .history-relation-edge__label,
.history-relation-edge.is-label-visible .history-relation-edge__label,
.history-relation-edge.is-fixed .history-relation-edge__label {
  opacity: 1;
}

.history-relation-edge.is-selection-inactive:hover .history-relation-edge__label,
.history-relation-edge.is-selection-inactive:focus .history-relation-edge__label {
  opacity: 0.34;
}

.history-relation-edge__label-bg {
  fill: rgba(9, 17, 32, 0.9);
  stroke: color-mix(in srgb, currentColor 52%, rgba(232, 240, 255, 0.18));
  stroke-width: 1;
}

.history-relation-edge__label-text {
  fill: rgba(244, 248, 255, 0.94);
  font: 720 0.68rem/1 var(--font-ui);
}

.history-group-card {
  position: absolute;
  z-index: 3;
  min-height: 46px;
  display: block;
  padding: 0;
  border: 1px solid rgba(147, 176, 226, 0.34);
  border-left: 4px solid var(--group-accent, #8fb7ff);
  border-radius: 7px;
  background:
    linear-gradient(90deg, rgba(127, 176, 255, 0.13), rgba(18, 31, 52, 0) 46%),
    linear-gradient(180deg, rgba(18, 31, 52, 0.99), rgba(9, 17, 32, 0.99));
  color: #f4f8ff;
  box-shadow: 0 7px 16px rgba(2, 8, 20, 0.22);
  text-align: left;
  cursor: default;
  overflow: hidden;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease, background-color 160ms ease;
}

.history-group-card:hover,
.history-group-card:focus-within {
  border-color: rgba(195, 216, 255, 0.62);
  box-shadow: 0 12px 24px rgba(2, 8, 20, 0.34);
  outline: none;
  transform: translateY(-1px);
}

.history-group-card.is-active,
.history-group-card.is-expanded {
  border-color: rgba(220, 233, 255, 0.72);
  background:
    linear-gradient(90deg, rgba(127, 176, 255, 0.2), rgba(27, 47, 78, 0) 50%),
    linear-gradient(180deg, rgba(27, 47, 78, 1), rgba(11, 24, 45, 0.99));
}

.history-group-card.is-current-group {
  box-shadow: 0 0 0 2px rgba(127, 176, 255, 0.2), 0 12px 24px rgba(2, 8, 20, 0.34);
}

.history-group-card.contains-active-event {
  border-color: rgba(255, 210, 124, 0.72);
}

.history-group-card.is-relation-endpoint,
.history-event-card.is-relation-endpoint {
  border-color: rgba(229, 240, 255, 0.82);
}

.history-group-card.is-relation-expanded {
  box-shadow: 0 0 0 2px rgba(166, 227, 161, 0.22), 0 12px 24px rgba(2, 8, 20, 0.34);
}

.history-group-card.is-relation-endpoint-a,
.history-event-card.is-relation-endpoint-a {
  box-shadow: 0 0 0 2px rgba(255, 210, 124, 0.3), 0 14px 28px rgba(2, 8, 20, 0.4);
}

.history-group-card.is-relation-endpoint-b,
.history-event-card.is-relation-endpoint-b {
  box-shadow: 0 0 0 2px rgba(119, 215, 232, 0.28), 0 14px 28px rgba(2, 8, 20, 0.4);
}

.history-event-card.is-active-relation-event {
  outline: 2px solid rgba(245, 248, 255, 0.66);
  outline-offset: 2px;
}

.history-group-card.is-expanded {
  z-index: 4;
}

.history-group-card.is-lineage-dimmed,
.history-event-card.is-lineage-dimmed {
  opacity: 0.38;
}

.history-group-card.is-lineage-active,
.history-event-card.is-lineage-active {
  border-color: rgba(224, 236, 255, 0.62);
}

.history-group-card.has-filter .history-group-card__count {
  border-color: rgba(255, 210, 124, 0.5);
  color: #ffe4a9;
}

.history-group-card.has-search-hit {
  border-color: rgba(255, 210, 124, 0.54);
}

.history-group-card.has-filter-miss {
  opacity: 0.62;
  border-style: dashed;
}

.history-group-card__select,
.history-group-card__toggle {
  appearance: none;
  font-family: var(--font-ui);
}

.history-group-card__select {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 46px;
  padding: 7px 10px 8px 34px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.history-group-card__select:focus-visible {
  outline: 2px solid rgba(255, 210, 124, 0.46);
  outline-offset: -3px;
}

.history-group-card__toggle {
  position: absolute;
  inset-block-start: 7px;
  inset-inline-start: 8px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(255, 230, 181, 0.28);
  border-radius: 6px;
  background: rgba(255, 210, 124, 0.1);
  cursor: pointer;
}

.history-group-card__toggle:hover,
.history-group-card__toggle:focus-visible {
  border-color: rgba(255, 230, 181, 0.68);
  background: rgba(255, 210, 124, 0.18);
  outline: none;
}

.history-group-card__main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.history-group-card__chevron {
  color: rgba(255, 230, 181, 0.96);
  font-size: 0.9rem;
  line-height: 1;
}

.history-group-card__label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  color: #f8fbff;
  font-size: 0.82rem;
  font-weight: 760;
  line-height: 1.16;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-group-card__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 25px;
  min-height: 20px;
  padding: 2px 6px;
  border: 1px solid rgba(202, 221, 255, 0.34);
  border-radius: 999px;
  background: rgba(127, 176, 255, 0.1);
  color: rgba(242, 247, 255, 0.92);
  font: 750 0.68rem/1 var(--font-ui);
}

.history-group-card__relation-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  padding: 2px 6px;
  border: 1px solid rgba(255, 210, 124, 0.34);
  border-radius: 999px;
  background: rgba(255, 210, 124, 0.09);
  color: rgba(255, 230, 181, 0.94);
  font: 750 0.66rem/1 var(--font-ui);
  white-space: nowrap;
}

.history-group-card__meta {
  min-width: 0;
  overflow: hidden;
  color: rgba(220, 232, 255, 0.7);
  font-size: 0.68rem;
  font-weight: 650;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-group-card__span {
  position: absolute;
  inset-inline: 12px;
  inset-block-end: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--group-accent, #8fb7ff), rgba(143, 183, 255, 0.08));
  opacity: 0.66;
  pointer-events: none;
}

.history-timeline-state {
  min-height: 180px;
  display: grid;
  place-items: center;
  padding: 24px;
  color: rgba(232, 240, 255, 0.76);
  font-size: 0.95rem;
}

.history-timeline-state--error {
  color: rgba(255, 213, 198, 0.9);
}

.history-event-card {
  position: relative;
  width: 100%;
  min-height: 54px;
  display: grid;
  gap: 3px;
  text-align: left;
  border: 1px solid rgba(144, 172, 224, 0.28);
  border-left: 3px solid var(--event-accent, #7fb0ff);
  border-radius: 7px;
  padding: 6px 8px;
  background: linear-gradient(180deg, rgba(19, 31, 52, 0.99), rgba(9, 17, 32, 0.99));
  color: #f2f6ff;
  box-shadow: 0 6px 14px rgba(2, 8, 20, 0.22);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 120ms ease, background-color 160ms ease;
}

.history-event-card--timeline {
  position: absolute;
  z-index: 2;
  min-height: 54px;
  max-height: 60px;
  overflow: hidden;
}

.history-event-card--span {
  border-inline-start-width: 5px;
  background:
    linear-gradient(90deg, rgba(127, 176, 255, 0.16), rgba(127, 176, 255, 0.02) 42%, rgba(127, 176, 255, 0) 100%),
    linear-gradient(180deg, rgba(19, 31, 52, 1), rgba(9, 17, 32, 0.99));
}

.history-event-card--span::after {
  content: "";
  position: absolute;
  inset-inline: 10px;
  inset-block-start: 0;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--event-accent, #7fb0ff), rgba(127, 176, 255, 0));
  opacity: 0.62;
  pointer-events: none;
}

.history-event-card--timeline.history-event-card--long-span {
  grid-template-columns: minmax(96px, auto) minmax(0, 1fr);
  align-content: center;
  column-gap: 7px;
}

.history-event-card--timeline.history-event-card--long-span .history-event-card__meta {
  align-self: center;
}

.history-event-card--timeline.history-event-card--long-span .history-event-card__title {
  align-self: center;
  -webkit-line-clamp: 1;
}

.history-event-card:hover,
.history-event-card:focus-visible {
  border-color: rgba(185, 210, 255, 0.58);
  box-shadow: 0 12px 24px rgba(2, 8, 20, 0.32);
  outline: none;
  transform: translateY(-1px);
}

.history-event-card.is-active {
  z-index: 6;
  border-color: rgba(232, 241, 255, 0.88);
  background:
    linear-gradient(90deg, rgba(127, 176, 255, 0.18), rgba(127, 176, 255, 0) 40%),
    linear-gradient(180deg, rgba(31, 56, 94, 1), rgba(13, 27, 51, 0.99));
  box-shadow: 0 0 0 2px rgba(127, 176, 255, 0.28), 0 16px 32px rgba(2, 8, 20, 0.46);
}

.history-event-card[hidden] {
  display: none;
}

.history-event-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  color: rgba(217, 230, 255, 0.74);
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.2;
}

.history-event-card__year {
  color: #ffffff;
  font-family: var(--font-mono);
}

.history-event-card__category {
  color: rgba(223, 234, 255, 0.72);
}

.history-event-card__title {
  color: #f8fbff;
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.history-event-card__short {
  display: none;
}

.history-event-card--timeline .history-event-card__meta {
  flex-wrap: nowrap;
  overflow: hidden;
}

.history-event-card--timeline .history-event-card__category {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-event-card--timeline .history-event-card__title {
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.history-detail-panel {
  min-width: 0;
  border: 1px solid var(--history-panel-border);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(10, 18, 34, 0.94), rgba(7, 13, 25, 0.9));
  box-shadow: inset 0 1px 0 rgba(232, 240, 255, 0.12);
  overflow: clip;
}

.history-detail-panel__inner {
  display: grid;
  gap: 12px;
  padding: 15px;
}

.history-detail-panel h2 {
  margin: 0;
  color: #f7f9ff;
  font-size: clamp(1.16rem, 1.35vw, 1.45rem);
  line-height: 1.18;
}

.history-inspector-header {
  display: grid;
  gap: 4px;
}

.history-inspector-kicker {
  width: fit-content;
  padding: 2px 7px;
  border: 1px solid rgba(255, 210, 124, 0.28);
  border-radius: 999px;
  background: rgba(255, 210, 124, 0.08);
  color: rgba(255, 230, 181, 0.96);
  font: 780 0.68rem/1.2 var(--font-ui);
  text-transform: uppercase;
}

.history-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.history-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.history-detail-action {
  appearance: none;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(143, 170, 221, 0.34);
  border-radius: 999px;
  background: rgba(25, 38, 64, 0.68);
  color: rgba(238, 244, 255, 0.92);
  min-height: 30px;
  padding: 4px 10px;
  font: 720 0.76rem/1.15 var(--font-ui);
  cursor: pointer;
  text-decoration: none;
}

.history-detail-action:hover,
.history-detail-action:focus-visible {
  border-color: rgba(188, 211, 255, 0.58);
  background: rgba(127, 176, 255, 0.14);
  outline: none;
}

.history-detail-pill,
.history-concept-chip,
.history-related-button,
.history-relation-node-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid rgba(127, 176, 255, 0.28);
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(127, 176, 255, 0.08);
  color: rgba(238, 245, 255, 0.92);
  font-size: 0.76rem;
  line-height: 1.2;
}

.history-detail-pill--strong {
  border-color: rgba(209, 226, 255, 0.42);
  color: #ffffff;
  font-family: var(--font-mono);
}

.history-detail-section {
  display: grid;
  gap: 5px;
}

.history-detail-section h3 {
  margin: 0;
  color: rgba(244, 248, 255, 0.96);
  font-size: 0.8rem;
  line-height: 1.2;
  text-transform: uppercase;
}

.history-detail-section p {
  margin: 0;
  color: rgba(226, 236, 255, 0.8);
  font-size: 0.9rem;
  line-height: 1.48;
}

.history-concept-list,
.history-related-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.history-relation-node-list {
  display: grid;
  gap: 6px;
}

.history-relation-inspector-list {
  display: grid;
  gap: 7px;
}

.history-relation-inspector-row {
  appearance: none;
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid rgba(143, 170, 221, 0.22);
  border-radius: 7px;
  background: rgba(13, 24, 43, 0.58);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.history-relation-inspector-row:hover,
.history-relation-inspector-row:focus-visible {
  border-color: rgba(195, 216, 255, 0.52);
  background: rgba(20, 36, 62, 0.74);
  outline: none;
}

.history-relation-inspector-row.is-active {
  border-color: rgba(255, 210, 124, 0.68);
  background: rgba(44, 37, 21, 0.72);
}

.history-relation-inspector-row.is-muted {
  opacity: 0.62;
}

.history-relation-inspector-row strong {
  color: #f8fbff;
  font-size: 0.8rem;
  line-height: 1.25;
}

.history-relation-inspector-row span {
  color: rgba(226, 236, 255, 0.76);
  font-size: 0.75rem;
  line-height: 1.3;
}

.history-relation-inspector-action {
  justify-self: start;
  margin-top: 2px;
  padding: 2px 7px;
  border: 1px solid rgba(143, 170, 221, 0.28);
  border-radius: 999px;
  background: rgba(127, 176, 255, 0.12);
  color: rgba(238, 245, 255, 0.88);
}

.history-inspector-event-list {
  display: grid;
  gap: 6px;
}

.history-inspector-event {
  appearance: none;
  display: grid;
  grid-template-columns: minmax(72px, auto) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  width: 100%;
  border: 1px solid rgba(143, 170, 221, 0.24);
  border-radius: 7px;
  background: rgba(13, 24, 43, 0.64);
  color: rgba(238, 245, 255, 0.9);
  padding: 6px 8px;
  text-align: left;
  cursor: pointer;
}

.history-inspector-event:hover,
.history-inspector-event:focus-visible,
.history-inspector-event.is-active {
  border-color: rgba(188, 211, 255, 0.58);
  background: rgba(127, 176, 255, 0.14);
  outline: none;
}

.history-inspector-event.has-search-hit {
  border-color: rgba(255, 210, 124, 0.42);
}

.history-inspector-event.has-filter-miss {
  opacity: 0.48;
}

.history-inspector-event:disabled {
  cursor: default;
}

.history-inspector-event__year {
  color: #ffffff;
  font: 720 0.72rem/1.15 var(--font-mono);
}

.history-inspector-event__title {
  min-width: 0;
  overflow-wrap: anywhere;
  font: 720 0.82rem/1.2 var(--font-ui);
}

.history-collapsible {
  display: grid;
  gap: 7px;
}

.history-collapsible summary {
  width: fit-content;
  color: rgba(238, 245, 255, 0.92);
  cursor: pointer;
  font: 720 0.8rem/1.25 var(--font-ui);
}

.history-related-button {
  appearance: none;
  max-width: 100%;
  font-family: var(--font-ui);
  text-align: left;
  white-space: normal;
  cursor: pointer;
}

.history-related-button--passive {
  cursor: default;
}

.history-related-button:hover,
.history-related-button:focus-visible {
  border-color: rgba(188, 211, 255, 0.58);
  background: rgba(127, 176, 255, 0.14);
  outline: none;
}

.history-mobile-list {
  display: none;
}

.history-mobile-group {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(176, 200, 248, 0.18);
  border-radius: 12px;
  background: rgba(8, 15, 29, 0.72);
}

.history-mobile-group h3 {
  margin: 0;
  color: #f5f8ff;
  font-size: 1rem;
}

.history-mobile-group__list {
  display: grid;
  gap: 8px;
}

.history-group-card--mobile {
  position: relative;
  inset: auto;
  width: 100%;
  min-height: 44px;
}

.history-group-card--mobile .history-group-card__select {
  min-height: 44px;
}

.history-info-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  padding: 14px;
}

.history-info-section article {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(176, 200, 248, 0.18);
  border-radius: 12px;
  background: rgba(10, 18, 34, 0.56);
}

.history-info-section h2 {
  margin: 0 0 7px;
  color: #f6f9ff;
  font-size: 1rem;
}

.history-info-section p {
  margin: 0;
  color: rgba(226, 236, 255, 0.78);
  font-size: 0.9rem;
  line-height: 1.45;
}

.history-fallback-list {
  margin-top: 12px;
}

body.history-page--enhanced .history-fallback-list {
  display: none;
}

body.history-page--enhanced.history-page--data-unavailable .history-fallback-list {
  display: block;
}

@media (min-width: 1200px) {
  body.history-page .site-shell {
    --sidebar-width: var(--rail-width, 80px);
  }

  body.history-page .sidebar.rail {
    opacity: 0.7;
    transition: opacity 0.2s ease;
  }

  body.history-page .sidebar.rail:hover {
    opacity: 1;
  }

  body.history-page .main {
    padding: 10px 10px 14px;
  }

  .history-hero {
    min-height: 150px;
  }

  .history-detail-panel {
    align-self: start;
  }
}

@media (min-width: 1181px) {
  body.history-page--enhanced .history-map-layout {
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
    align-items: start;
  }

  body.history-page--enhanced .history-timeline-shell,
  body.history-page--enhanced .history-selection-shell {
    grid-column: 1;
    max-height: calc(100vh - 170px);
    min-height: 560px;
  }

  body.history-page--enhanced .history-selection-shell {
    overflow: auto;
    overscroll-behavior: contain;
  }

  body.history-page--enhanced .history-detail-panel {
    grid-column: 2;
    position: sticky;
    top: 112px;
    z-index: 55;
    justify-self: stretch;
    align-self: start;
    width: auto;
    max-height: calc(100vh - 126px);
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow:
      0 18px 38px rgba(2, 8, 20, 0.34),
      inset 0 1px 0 rgba(232, 240, 255, 0.12);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}

@media (max-width: 1180px) {
  .history-hero {
    grid-template-columns: 1fr;
  }

  .history-hero__actions {
    justify-content: flex-start;
  }

  .history-map-layout {
    grid-template-columns: 1fr;
  }

  .history-selection-toolbar {
    grid-template-columns: 1fr;
  }

  .history-focus-tree {
    grid-template-columns: 1fr;
    grid-template-areas:
      "pre"
      "center"
      "ctx"
      "suc";
  }

  .history-detail-panel {
    max-width: 100%;
  }

  .history-info-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  body.history-page .main {
    padding-inline: clamp(10px, 3.8vw, 16px);
  }

  .history-hero,
  .history-stage,
  .history-info-section {
    border-radius: 14px;
  }

  .history-hero {
    padding: 13px;
  }

  .history-hero h1 {
    font-size: clamp(1.7rem, 10vw, 2.45rem);
  }

  .history-hero__question {
    margin-top: 12px;
    font-size: 0.94rem;
  }

  .history-stage {
    padding: 10px;
  }

  .history-statusbar {
    font-size: 0.82rem;
  }

  .history-timeline-controls {
    position: static;
  }

  .history-floating-toolbar {
    display: flex;
    max-width: none;
    width: 100%;
  }

  .history-floating-toolbar__search,
  .history-floating-search {
    width: 100%;
  }

  .history-floating-menu {
    flex: 1 1 130px;
  }

  .history-floating-menu__trigger {
    width: 100%;
    text-align: center;
  }

  .history-floating-menu__panel,
  .history-floating-menu:last-child .history-floating-menu__panel {
    inset-inline: 0 auto;
    min-width: min(260px, calc(100vw - 38px));
  }

  body.history-page--enhanced .history-timeline-shell {
    display: none;
  }

  body.history-page--enhanced .history-selection-shell[hidden] {
    display: none;
  }

  body.history-page--enhanced .history-map-layout {
    display: contents;
  }

  body.history-page--enhanced .history-stage.is-selection-mode .history-selection-shell {
    display: block;
    order: 2;
  }

  body.history-page--enhanced .history-stage.is-selection-mode .history-mobile-list {
    display: none;
  }

  body.history-page--enhanced .history-mobile-list {
    display: grid;
    gap: 10px;
    order: 2;
  }

  body.history-page--enhanced .history-detail-panel {
    order: 3;
    scroll-margin-top: 12px;
  }

  .history-event-card {
    min-height: 0;
  }

  .history-detail-panel__inner {
    padding: 12px;
  }

  .history-selection-empty,
  .history-selection-toolbar,
  .history-focus-tree,
  .history-focus-local-gallery,
  .history-focus-dataset {
    padding: 12px;
  }

  .history-focus-context-list {
    grid-template-columns: 1fr;
  }

  .history-focus-local-gallery__grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-gutter: stable;
  }

  .history-focus-local-gallery__item {
    grid-template-columns: 64px minmax(0, 1fr);
    flex: 0 0 min(78vw, 280px);
  }

  .history-inspector-event {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .history-group-card,
  .history-event-card,
  .history-floating-menu__trigger,
  .history-floating-menu__panel button,
  .history-context-menu button,
  body.history-page .sidebar.rail {
    transition: none;
  }

  .history-group-card:hover,
  .history-group-card:focus-within,
  .history-event-card:hover,
  .history-event-card:focus-visible {
    transform: none;
  }
}
