:root {
  --ink: #202321;
  --muted: #636864;
  --rule: #d9dcd8;
  --paper: #fff;
  --link: #225b72;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    16px Georgia,
    "Times New Roman",
    serif;
}
button,
input {
  font:
    14px system-ui,
    sans-serif;
  color: inherit;
}
button {
  border: 1px solid var(--rule);
  background: white;
  padding: 7px 10px;
  cursor: pointer;
  border-radius: 0;
}
button:hover {
  background: #f0f2ef;
}
button.active,
button[aria-pressed="true"] {
  background: #e8ede9;
  border-color: #8a958c;
}
button:focus-visible,
input:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #225b72;
  outline-offset: 3px;
}
a {
  color: var(--link);
}
[hidden] {
  display: none !important;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--rule);
  padding: 12px 20px;
  gap: 16px;
}
h1 {
  font-size: 26px;
  font-weight: 400;
  margin: 0;
}
h1 a {
  color: inherit;
  text-decoration: none;
}
h2 {
  font-weight: 400;
  font-size: 23px;
  margin: 0;
}
h3 {
  font-weight: 400;
  font-size: 21px;
}
p {
  line-height: 1.5;
}
.workspace {
  height: calc(100dvh - 60px);
  min-height: 520px;
  display: flex;
}
.sidebar {
  flex: 0 0 17.75rem;
  padding: 18px 12px;
  border-right: 1px solid var(--rule);
  overflow: auto;
}
.search-wrap {
  position: relative;
  margin-bottom: 18px;
}
input[type="search"] {
  width: 100%;
  padding: 9px 8px;
  border: 1px solid #aeb5ae;
  border-radius: 0;
}
.family-btn {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  padding: 8px 9px;
  background: none;
  font-size: 14px;
  line-height: 1.3;
}
.family-btn.active {
  border-left: 2px solid #364c3f;
  padding-left: 7px;
  background: #edf1ed;
}
.family-btn[data-family="all"] {
  margin-bottom: 9px;
}
main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.main-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 18px 10px;
}
.main-top p {
  font-size: 15px;
  color: var(--muted);
  margin: 5px 0 0;
  max-width: 750px;
  line-height: 1.4;
}
.view-tabs {
  display: flex;
  align-items: start;
  flex-shrink: 0;
}
.view-tabs button + button {
  border-left: 0;
}
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--rule);
  font: 14px system-ui;
}
.filters {
  display: flex;
  gap: 9px 16px;
  flex-wrap: wrap;
}
.filters label {
  display: flex;
  gap: 5px;
  align-items: center;
  cursor: pointer;
}
input[type="checkbox"] {
  accent-color: #3f6050;
  width: 14px;
  height: 14px;
  margin: 0;
}
#stage {
  position: relative;
  flex: 1;
  min-height: 250px;
  overflow: hidden;
  background: #fff;
}
#network {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}
#network:active {
  cursor: grabbing;
}
#world .panel-rule {
  stroke: #cbd0ca;
  stroke-width: 1;
  fill: none;
}
.panel-title {
  font: 28px Georgia;
  fill: #242d27;
}
.panel-open {
  font: 15px system-ui;
  fill: #5c675e;
}
.flag-node {
  cursor: pointer;
  outline: none;
}
.node-card {
  fill: #fff;
  stroke: none;
}
.flag-node:hover .node-card,
.flag-node:focus .node-card,
.flag-node.selected .node-card {
  stroke: #2d5d48;
  stroke-width: 1.5;
  fill: #f5f8f4;
}
.node-label {
  font: 16px Georgia;
  fill: #202621;
  text-anchor: middle;
}
.node-year {
  font: 12px system-ui;
  fill: #5a655e;
  text-anchor: middle;
}
.node-portal {
  font: 11px system-ui;
  fill: #466550;
  text-anchor: middle;
}
.flag-node.selected .node-label {
  font-weight: bold;
}
.edge-group {
  cursor: pointer;
}
.edge {
  fill: none;
  stroke-width: 1.65;
  stroke-linejoin: round;
}
.edge-halo {
  fill: none;
  stroke: white;
  stroke-width: 6;
  stroke-linejoin: round;
}
.edge-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 14;
  pointer-events: stroke;
}
.edge-group:hover .edge,
.edge-group.active .edge {
  stroke-width: 3;
}
.edge-group.muted {
  opacity: 0.13;
}
.flag-node.muted {
  opacity: 0.25;
}
.edge-group.active {
  opacity: 1;
}
.map-tools {
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 7px 15px;
  font: 13px system-ui;
  color: var(--muted);
}
.zoom-controls {
  display: flex;
  gap: 0;
  flex-shrink: 0;
}
.zoom-controls button {
  padding: 5px 9px;
}
.zoom-controls button + button {
  border-left: 0;
}
.legend {
  display: flex;
  justify-content: center;
  gap: 10px 20px;
  flex-wrap: wrap;
  padding: 7px 14px 10px;
  font: 12px system-ui;
  color: #505b53;
}
.legend span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.line {
  display: inline-block;
  width: 22px;
  border-top: 2px solid #4b6558;
}
.line.probable {
  border-color: #916928;
  border-top-style: dashed;
}
.line.redesign {
  border-color: #726083;
}
.line.family {
  border-color: #637d90;
  border-top-style: dashed;
}
.line.similarity {
  border-color: #986573;
  border-top-style: dotted;
}
#detail {
  flex: 0 0 330px;
  position: relative;
  border-left: 1px solid var(--rule);
  padding: 38px 22px 24px;
  overflow: auto;
  line-height: 1.45;
}
#detail h2 {
  font-size: 26px;
}
#detail p {
  margin: 12px 0;
  font-size: 16px;
}
.close {
  position: absolute;
  right: 10px;
  top: 8px;
  border: 0;
  font-size: 24px;
  padding: 0 7px;
}
.detail-flag {
  display: block;
  max-width: 100%;
  width: 220px;
  height: 125px;
  object-fit: contain;
  object-position: left;
  margin-bottom: 18px;
}
.tag {
  display: inline-block;
  font: 13px system-ui;
  color: #5e685f;
  margin: 3px 5px 5px 0;
}
.tag:not(button) {
  display: block;
}
button.tag {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  padding: 4px 0;
}
.detail-date {
  font: 14px system-ui;
  color: #626e64;
  margin-top: 7px;
}
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 18px 0;
}
.detail-subtitle {
  font-size: 19px;
  margin: 25px 0 8px;
}
.relation {
  padding: 13px 0;
  border-top: 1px solid var(--rule);
}
.relation > small {
  font: 13px system-ui;
}
.relation button {
  border: 0;
  text-align: left;
  padding: 0;
  color: var(--link);
  font: 17px Georgia;
}
.relation p {
  font-size: 15px !important;
}
.source {
  font: 14px system-ui;
}
.source-list {
  padding-left: 18px;
}
.source-list li {
  margin: 8px 0;
}
#gallery {
  overflow: auto;
  height: 100%;
  padding: 20px;
}
.gallery-group-title {
  font: 18px Georgia;
  margin: 0 0 20px;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 25px 15px;
}
.flag-tile {
  border: 0;
  padding: 8px;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  min-height: 145px;
}
.flag-tile img {
  width: 105px;
  height: 66px;
  object-fit: contain;
}
.flag-tile strong {
  font: 16px Georgia;
  text-align: center;
}
.flag-tile small {
  font: 12px system-ui;
  color: #626e64;
}
.flag-tile.selected {
  outline: 1px solid #456853;
}
.result {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--rule);
  text-align: left;
  padding: 9px;
}
.result img {
  width: 35px;
  height: 24px;
  object-fit: contain;
}
.result small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
#search-results {
  position: absolute;
  left: 12px;
  top: 112px;
  z-index: 5;
  max-height: 60vh;
  overflow: auto;
  width: 300px;
  border: 1px solid #8b958c;
  background: white;
}
.no-results {
  padding: 15px;
}
dialog {
  max-width: 660px;
  width: calc(100% - 32px);
  border: 1px solid #929b93;
  padding: 30px;
  max-height: 85dvh;
  color: var(--ink);
}
dialog::backdrop {
  background: #202b2459;
}
dialog p,
dialog li {
  font-size: 16px;
  line-height: 1.5;
}
dialog li {
  margin: 6px 0;
}
.download-link {
  display: inline-block;
  margin: 15px 0;
}
#loading,
#empty {
  position: absolute;
  top: 20px;
  left: 20px;
  background: #fff;
  padding: 8px;
  font: 14px system-ui;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 1100px) {
  .sidebar {
    flex-basis: 17.75rem;
    padding: 12px 8px;
  }
  #detail {
    flex-basis: 285px;
    padding: 36px 16px 20px;
  }
  .main-top {
    flex-wrap: wrap;
    gap: 10px;
  }
  .legend {
    gap: 7px 12px;
  }
  .map-tools {
    flex-wrap: wrap;
  }
  .main-top p {
    font-size: 14px;
  }
}
@media (max-width: 760px) {
  header {
    padding: 11px 12px;
  }
  h1 {
    font-size: 22px;
  }
  header button {
    font-size: 12px;
    padding: 6px;
  }
  .workspace {
    height: auto;
    min-height: calc(100dvh - 55px);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--rule);
    padding: 8px 12px;
    display: flex;
    gap: 10px;
    align-items: center;
    overflow: visible;
  }
  .sidebar .search-wrap {
    margin: 0;
    flex: 1;
    min-width: 100px;
  }
  .sidebar > .family-btn {
    width: auto;
    margin: 0;
    white-space: nowrap;
  }
  #families {
    max-width: 38%;
    position: relative;
  }
  #families select {
    font: 14px system-ui;
    width: 100%;
    padding: 9px 3px;
    border: 1px solid var(--rule);
    background: white;
  }
  .family-btn {
    font-size: 13px;
  }
  .main-top {
    padding: 12px;
    flex-wrap: nowrap;
  }
  .main-top h2 {
    font-size: 21px;
  }
  .view-tabs button {
    padding: 6px;
    font-size: 13px;
  }
  .toolbar {
    padding: 8px 12px;
  }
  .filters {
    gap: 9px;
    font-size: 12px;
  }
  .filters input {
    width: 13px;
    height: 13px;
  }
  #stage {
    height: 62dvh;
    min-height: 370px;
    flex: auto;
  }
  #detail {
    border-left: 0;
    border-top: 1px solid var(--rule);
    overflow: visible;
    padding: 25px 20px;
    max-width: none;
  }
  .detail-flag {
    width: 180px;
    height: 100px;
  }
  #search-results {
    top: 110px;
    left: 12px;
    width: calc(100vw - 24px);
  }
  .map-tools {
    padding: 6px 12px;
    font-size: 12px;
  }
  .legend {
    font-size: 11px;
  }
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
  .sidebar nav .family-btn {
    display: none;
  }
  .main-top p {
    line-height: 1.3;
  }
}
@media (min-width: 761px) {
  #families select {
    display: none;
  }
}
.line.claimed {
  border-color: #94675c;
  border-top-style: dotted;
}
.overview .node-label,
.overview .node-year {
  visibility: hidden;
}
.overview .edge {
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.overview .edge-halo {
  stroke-width: 2.5;
  vector-effect: non-scaling-stroke;
}
.overview .edge-group.active .edge {
  stroke-width: 2;
}

#detail > .close {
  position: sticky;
  display: block;
  top: 0;
  margin: -28px -10px 8px auto;
  z-index: 3;
  background: #fff;
  border: 1px solid #b7c0b9;
  width: 38px;
  height: 34px;
  font-size: 25px;
}
.map-tools {
  justify-content: flex-end;
}
.edge {
  stroke-linecap: round;
}
.line.probable {
  border-top-style: dotted;
}
.line.family {
  border-top-style: dashed;
}
.line.similarity {
  border-color: #b22d77;
  border-top-style: dotted;
}
.regional-nav-label {
  font: 14px Georgia;
  padding: 18px 9px 6px;
  color: #656e67;
  border-top: 1px solid var(--rule);
  margin-top: 12px;
}
@media (max-width: 760px) {
  .regional-nav-label {
    display: none;
  }
}

.tradition-band {
  cursor: pointer;
}
.tradition-band rect {
  fill: #eef3f8;
  fill-opacity: 0.7;
  stroke: #c2cfdb;
  stroke-width: 1;
  stroke-dasharray: 5 5;
}
.tradition-band text {
  fill: #516477;
  font:
    12px Georgia,
    serif;
  pointer-events: none;
}
.tradition-band:focus rect {
  stroke: #365b78;
  stroke-width: 2;
}
.comparison-band rect {
  fill: #faeff8;
  stroke: #c58bb6;
  stroke-dasharray: 1 11;
}
.comparison-band text {
  fill: #8c4175;
}
.overview .tradition-band text {
  display: none;
}
.tradition-members {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.tradition-members button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid #d6dce1;
  text-align: center;
}
.tradition-members img {
  width: 85px;
  height: 48px;
  object-fit: contain;
}
.largest-btn {
  margin-bottom: 15px !important;
  border-bottom: 1px solid #c8cdd2 !important;
  padding-bottom: 15px !important;
}
.legend .line.family {
  height: 12px;
  border: 1px dashed #a7bbcb;
  background: #eef3f8;
}
.unillustrated {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f2f3f4;
  color: #59636a;
  font:
    13px Georgia,
    serif;
  text-align: center;
  padding: 8px;
}
.unillustrated-node {
  text-anchor: middle;
  font:
    12px Georgia,
    serif;
  fill: #586573;
}
.edge-detail-image {
  width: 105px;
  height: 65px;
  object-fit: contain;
}

.node-label {
  font-size: var(--label-size, 16px);
}
.overview .node-label,
.overview .node-year {
  visibility: hidden;
}
.branch-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.toolbar {
  flex-wrap: wrap;
}
.edge {
  vector-effect: non-scaling-stroke;
}
.node-label {
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 2px;
  stroke-linejoin: round;
}
.node-year {
  pointer-events: none;
}
#world {
  will-change: transform;
}

.band-caption text {
  font:
    12px Georgia,
    serif;
  fill: #51616b;
}
.atlas-section {
  font:
    28px Georgia,
    serif;
  fill: #303e36;
}
#related-views:empty {
  display: none;
}
#related-views {
  margin: 4px 0 8px;
}

.other-nav-section {
  border-top: 1px solid var(--rule);
  margin-top: 16px;
  padding-top: 10px;
}
@media (max-width: 760px) {
  .other-nav-section {
    display: none;
  }
}

/* Size the working surface from the actual header and viewport. */
body {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
}
.workspace {
  height: 100%;
  min-height: 0;
  position: relative;
}
main {
  min-height: 0;
}
@media (min-width: 761px) and (max-width: 1100px) {
  #detail {
    position: absolute;
    inset: 0 0 0 auto;
    width: min(340px, 90%);
    background: white;
    box-shadow: -8px 0 24px #00000016;
    z-index: 5;
  }
}
@media (max-width: 760px) {
  body {
    display: block;
    height: auto;
    min-height: 100dvh;
    overflow: auto;
  }
  .workspace {
    height: auto;
    min-height: 0;
  }
  .sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
  }
  .sidebar .search-wrap {
    min-width: 0;
  }
  .sidebar > .family-btn {
    display: none;
  }
  #families {
    width: 100%;
    max-width: none;
    min-width: 0;
  }
  #family-select {
    min-width: 0;
  }
  .main-top {
    flex-wrap: wrap;
    gap: 8px;
  }
  .main-top > div:first-child {
    min-width: 0;
  }
  #detail {
    min-width: 0;
    overflow-wrap: anywhere;
  }
}

body{--serif:"EB Garamond",Georgia,serif;} h1,h2,h3,.model-description{font-family:var(--tool-serif,"EB Garamond",Georgia,serif)}
