:root {
  color-scheme: light;
  --ink: #192b29;
  --sub: #4e6862;
  --quiet: #697a74;
  --rule: #d4dcd3;
  --paper: #f8faf4;
  --mint: #b9ebbf;
  --deep: #134941;
  --map: #101a1c;
  --serif: "Baskervville", "Baskerville", "Iowan Old Style", Georgia, serif;
  --sans:
    "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font: clamp(.94rem, .88rem + .22vw, 1.05rem)/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}
button,
input,
select {
  font: inherit;
}
button,
select {
  cursor: pointer;
}
button,
a,
input,
select,
[tabindex] {
  -webkit-tap-highlight-color: transparent;
}
a {
  color: var(--deep);
  text-underline-offset: 3px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #368e8c;
  outline-offset: 2px;
}
button {
  color: inherit;
}
button:disabled,
select:disabled {
  opacity: 0.6;
  cursor: wait;
}
button {
  border: 0;
  background: none;
}
.mast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: clamp(.55rem, 1.3vh, .95rem) max(env(safe-area-inset-right), clamp(.8rem, 2.3vw, 2.8rem)) clamp(.55rem, 1.3vh, .95rem) max(env(safe-area-inset-left), clamp(.8rem, 2.3vw, 2.8rem));
  background: #fcfdf8;
  border-bottom: 1px solid var(--rule);
  z-index: 4;
}
.identity {
  display: flex;
  align-items: center;
  gap: clamp(.55rem, 1.15vw, .95rem);
  min-width: 0;
}
.sigil {
  display: grid;
  place-content: center;
  flex: none;
  width: clamp(2.75rem, 3.8vw, 3.3rem);
  aspect-ratio: 1;
  border-radius: 12px 3px 12px 3px;
  background: var(--deep);
  color: #d4f1bf;
  font: italic clamp(2.25rem, 3.35vw, 2.9rem)/1 var(--serif);
  padding: 0;
}
.sigil span { transform: translate(-.045em, -.055em); }
.sigil:hover { background: #236658; }
.sigil:active { background: #0b372f; }
.mast h1,
.panel h2,
dialog h2 {
  font: normal 35px/1.06 var(--serif);
  letter-spacing: -0.04em;
  margin: 0;
}
.mast h1 { font-size: clamp(1.35rem, 1rem + 1.53vw, 2.55rem); }
.mast .identity p {
  color: var(--sub);
  font-size: clamp(.73rem, .66rem + .31vw, .92rem);
  letter-spacing: 0.02em;
  margin: 3px 0 0;
}
.mast nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.mast nav button {
  min-height: 42px;
  font-size: clamp(.83rem, .74rem + .3vw, .98rem);
  padding: 8px 14px;
  border-radius: 24px;
  color: var(--sub);
}
.mast nav button:hover,
.mast nav button.active {
  background: #e7eee4;
  color: var(--deep);
}
main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(20rem, 29vw, 30rem);
  flex: 1;
  min-height: 0;
}
.mapspace {
  position: relative;
  overflow: hidden;
  background: var(--map);
  isolation: isolate;
  container-type: size;
}
#viewport {
  position: absolute;
  inset: 0;
  outline-offset: -3px;
  touch-action: none;
  cursor: grab;
}
#viewport.grabbing {
  cursor: grabbing;
}
#viewport.pointing {
  cursor: pointer;
}
canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.mapbar {
  position: absolute;
  top: 19px;
  left: 19px;
  right: 19px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr) auto;
  max-width: 31rem;
  align-items: stretch;
  gap: 6px;
  z-index: 3;
  pointer-events: none;
}
.mapbar > * {
  pointer-events: auto;
}
.field,
.layers,
.maptools,
.layerbox {
  color: #eff6ed;
  background: #182727f4;
  border: 1px solid #506660;
  box-shadow: 0 3px 16px #0004;
}
.field {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 5px 11px;
  border-radius: 6px;
  min-width: 0;
}
.field span {
  font-size: 12px;
  color: #b3c9be;
}
.field select {
  appearance: none;
  color: inherit;
  background: transparent;
  border: 0;
  padding: 1px 19px 2px 0;
  font-size: 14px;
  width: 100%;
  min-width: 0;
  text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23bccec4' stroke-width='1.5'/%3E%3C/svg%3E");
  background-size: 10px;
  background-repeat: no-repeat;
  background-position: right center;
}
.field option {
  color: #10221d;
  background: #f4f7f0;
}
.layerwrap {
  position: relative;
}
.layers {
  border-radius: 6px;
  padding: 8px 13px;
  font-size: 14px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}
.layers:before {
  content: "";
  width: 13px;
  height: 9px;
  transform: skewY(-15deg);
  border: 1px solid #c4d9c7;
  box-shadow:
    0 3px 0 -1px #192727,
    0 4px #c4d9c7;
}
.layerbox {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 3;
  padding: 8px 12px;
  border-radius: 8px;
  min-width: 160px;
  max-height: calc(100cqh - 5rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  font-size: 14px;
}
.layerbox label {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 5px 0;
  white-space: nowrap;
}
.layerbox input {
  width: 15px;
  height: 15px;
  accent-color: var(--mint);
}
.maptools {
  position: absolute;
  bottom: 55px;
  right: 18px;
  display: grid;
  border-radius: 7px;
  overflow: hidden;
}
.maptools button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: inherit;
}
.maptools svg, .searchfield svg {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.65;
  stroke-linecap: round; stroke-linejoin: round;
}
.maptools button:focus-visible { outline-offset: -4px; }
#fullScreen .contract, #fullScreen[aria-pressed="true"] .expand { display: none; }
#fullScreen[aria-pressed="true"] .contract { display: inline; }
.searchfield svg { color: var(--sub); }
#inspectToggle[aria-expanded="true"] { background: #dce9dc; }
.maptools button + button {
  border-top: 1px solid #445a54;
}
.maptools button:hover,
.layers:hover {
  background: #2d403c;
}
#mapbarBottom {
  position: absolute;
  bottom: 18px;
  left: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  gap: 11px;
  color: #e4ede6;
  font: 12px var(--mono);
  text-shadow: 0 1px 3px #000;
  background: #122020e8;
  border: 1px solid #39514c;
  width: max-content;
  max-width: calc(100% - 36px);
  border-radius: 5px;
  padding: 6px 10px;
  pointer-events: none;
}
#scale {
  color: #a7bfb2;
  border-right: 1px solid #47605a;
  padding-right: 10px;
}
.layerkey {
  display: flex;
  align-items: center;
  gap: 6px;
}
.layerkey i {
  width: 8px;
  height: 8px;
  border: 1.5px solid #fff;
  border-radius: 50%;
  background: #edb974;
}
.paperkey i {
  width: 5px;
  height: 5px;
  background: #acafa4;
  border: 0;
}
.panel {
  overflow-wrap: anywhere;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  scrollbar-gutter: stable;
  padding: 21px clamp(17px, 1.75vw, 34px) 30px;
  border-left: 1px solid #c6d2c8;
  background: var(--paper);
}
.searchbox {
  margin: 0 0 23px;
}
.searchbox > label {
  font-size: 14px;
  color: var(--sub);
  display: block;
  margin-bottom: 6px;
}
.searchfield {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #bccdc2;
  padding: 6px 9px;
  border-radius: 6px;
}
.searchfield:focus-within {
  border-color: #378074;
  box-shadow: 0 0 0 2px #35827229;
}
.searchfield > span {
  font: 25px/1 var(--serif);
  color: #45625a;
}
.searchfield input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: none;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--ink);
  background: transparent;
}
.searchfield kbd {
  font: 12px var(--mono);
  color: var(--sub);
  background: #f0f4ec;
  border: 1px solid var(--rule);
  border-radius: 3px;
  padding: 1px 5px;
}
.panel h2,
dialog h2 {
  font-size: clamp(29px, 2.5vw, 39px);
  overflow-wrap: anywhere;
}
.panel h3,
dialog h3 {
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 24px 0 8px;
}
.panel p,
dialog p {
  margin: 9px 0 13px;
}
.intro {
  color: var(--sub);
  line-height: 1.52;
  font-size: 15px;
}
.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 16px 0;
  margin: 17px 0 11px;
  border-block: 1px solid var(--rule);
}
.stats strong {
  display: block;
  font: normal clamp(1.75rem, 1.22rem + 1.15vw, 2.35rem)/1.08 var(--serif);
  font-variant-numeric: lining-nums tabular-nums;
  letter-spacing: -0.04em;
}
.stats span,
.meta {
  font-size: 13px;
  color: var(--sub);
}
.subjectRow,
.listItem {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  padding: 8px 0;
}
.subjectRow:hover,
.listItem:hover {
  color: #176653;
}
.subjectRow .dot,
.topicDot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  border: 1px solid #0002;
}
.subjectRow span:nth-child(2) {
  flex: 1;
  font-size: 14px;
}
.subjectRow small,
.num {
  font: 12px var(--mono);
  color: var(--sub);
}
.meter {
  position: relative;
  height: 3px;
  background: #e1e8dc;
  border-radius: 3px;
  margin: -4px 0 1px 18px;
}
.meter i {
  display: block;
  height: 100%;
  border-radius: 3px;
}
.primary,
.quiet,
.back,
.chip,
.extlink {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border-radius: 5px;
  padding: 7px 11px;
  font-size: 14px;
  line-height: 1.4;
}
.primary,
.extlink {
  color: #f3faef;
  background: var(--deep);
  text-decoration: none;
}
.primary:hover,
.extlink:hover {
  background: #206758;
}
.quiet,
.chip {
  background: #ecf1e6;
  color: var(--deep);
  border: 1px solid #c9d6ca;
}
.quiet:hover,
.chip:hover {
  background: #e0e9da;
}
.back {
  padding: 0;
  color: #416758;
  margin-bottom: 13px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 13px 0;
}
.listItem {
  display: block;
  border-bottom: 1px solid var(--rule);
  overflow-wrap: anywhere;
  line-height: 1.35;
}
.listItem strong {
  font-weight: 550;
  font-size: 14px;
  display: block;
}
.listItem small {
  display: block;
  color: var(--sub);
  font-size: 12.5px;
  margin-top: 3px;
}
.bigcode {
  font: 500 clamp(19px, 1.55vw, 25px) / 1.2 var(--mono) !important;
  letter-spacing: -0.045em !important;
}
.label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--sub);
  font-size: 13px;
  margin-bottom: 7px;
}
.panel dl {
  display: grid;
  grid-template-columns: minmax(0,max-content) minmax(0,1fr);
  gap: 4px 10px;
  font-size: 14px;
  margin: 7px 0;
}
.panel dt {
  color: var(--sub);
}
.panel dd {
  margin: 0;
  overflow-wrap: anywhere;
}
.panel pre {
  padding: 12px 13px;
  border: 1px solid #cad7c8;
  background: #eef3e9;
  border-radius: 6px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 13px/1.6 var(--mono);
  max-height: 240px;
  overflow: auto;
}
.small {
  font-size: 14px;
  color: var(--sub);
}
.section {
  padding: 0 0 12px;
  border-bottom: 1px solid var(--rule);
}
.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.pills span {
  max-width: 100%;
  background: #e8eee2;
  font-size: 12px;
  padding: 3px 7px;
  border-radius: 4px;
  color: #365b4a;
}
.tabline {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin: 15px 0;
}
.tabline button[aria-pressed="true"] {
  background: var(--deep);
  color: #fff;
}
.note,
.warn {
  font-size: 14px;
  color: var(--sub);
  border-left: 3px solid #b2c6b3;
  padding-left: 10px;
  margin: 12px 0;
}
.warn {
  border-color: #b78649;
}
#tip,
#mapMessage {
  position: absolute;
  pointer-events: none;
  color: #edf6ed;
  background: #162525f5;
  border: 1px solid #526c64;
  box-shadow: 0 2px 7px #0005;
  border-radius: 5px;
  font: 13px/1.35 var(--sans);
  padding: 6px 9px;
  max-width: min(300px, 85%);
}
#mapMessage {
  top: 88px;
  left: 19px;
}
.empty {
  padding: 12px;
  color: var(--sub);
  background: #eef3ea;
  border-radius: 5px;
}
dialog {
  width: min(580px, calc(100vw - 28px));
  max-height: 85dvh;
  padding: 30px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: 0 15px 80px #06110b66;
}
dialog::backdrop {
  background: #112424aa;
}
dialog h2 {
  padding-right: 29px;
}
dialog ul {
  padding-left: 22px;
}
dialog li {
  margin: 7px 0;
}
.dismiss {
  float: right;
  font-size: 24px;
  background: #e4edde;
  border-radius: 20px;
  width: 34px;
  height: 34px;
  line-height: 28px;
}
.closeby {
  font-size: 13px;
  color: var(--sub);
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 18px;
  background: #eff3eb;
  border-top: 1px solid #cdd9cd;
  font-size: 12px;
}
footer a {
  color: #456056;
  text-decoration: none;
}
footer a:hover {
  text-decoration: underline;
}
@media (max-width: 1040px) {
  main { grid-template-columns: minmax(0,1fr) clamp(17rem,32vw,21rem); }
  .mapbar { inset: 12px 12px auto; }
  .layerbox { left: auto; right: 0; }
  .panel { padding: 1rem clamp(.9rem,2vw,1.35rem) 1.65rem; }
}
@media (max-width: 820px) and (orientation: portrait), (max-width: 620px) {
  body { height: auto; min-height: 100dvh; }
  .mast { gap: .35rem; padding-block: .5rem; }
  .mast nav { gap: 0; flex: none; }
  .mast nav button { padding: .4rem .48rem; }
  .mast #home { display: none; }
  main { display: flex; flex-direction: column; }
  .mapspace { flex: none; height: clamp(19rem, 52dvh, 39rem); }
  .mapbar { inset: .55rem .6rem auto; gap: .3rem; }
  .field { padding: .25rem .48rem; }
  .field span { font-size: .72rem; }
  .field select { font-size: .9rem; }
  .layers { padding-inline: .65rem; }
  .panel { height: auto; overflow: visible; border: 0; border-top: 1px solid var(--rule); padding: 1.05rem max(1.05rem,env(safe-area-inset-left)) 1.8rem; }
  .searchbox { margin-bottom: 1.15rem; }
  .stats { margin-block: .85rem; padding-block: .85rem; }
  .maptools { right: .65rem; bottom: 2.75rem; }
  #mapbarBottom { bottom: .65rem; left: .65rem; }
  #mapMessage { top: 4.2rem; left: .65rem; }
  footer { padding: .4rem max(.7rem,env(safe-area-inset-right)) max(.4rem,env(safe-area-inset-bottom)); }
}
@media (max-width: 430px) {
  .identity { gap: .45rem; }
  .mast { padding-inline: max(.55rem,env(safe-area-inset-left)); }
  .mast h1 { font-size: clamp(1.19rem,5.05vw,1.42rem); }
  .mast .identity p { font-size: .69rem; }
  .layers:before { display: none; }
  .layerbox { padding-inline: .7rem; }
  .mapbar { grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; }
  #mapbarBottom { font-size: .68rem; gap: .45rem; }
  dialog { padding: 1.25rem; }
}
@media (max-height: 540px) and (min-width: 621px) {
  .mast { padding-block: .25rem; }
  .mast h1 { font-size: 1.45rem; }
  .mast .identity p { display: none; }
  main { grid-template-columns: minmax(0,1fr) clamp(14rem,31vw,20rem); }
  .mapbar { inset: .45rem .5rem auto; }
  .field { padding: .2rem .45rem; }
  .layers { padding-inline: .5rem; }
  .layers:before { display: none; }
  .maptools { grid-auto-flow: column; bottom: .55rem; right: .55rem; }
  .maptools button + button { border-top: 0; border-left: 1px solid #445a54; }
  #mapbarBottom { bottom: .55rem; left: .55rem; }
  #mapbarBottom .layerkey { display: none; }
}
@media (pointer: coarse) {
  .searchfield input, .bundleSearch, .field select, .evidenceField select { font-size: 1rem; }
  .layerbox label { min-height: 2.65rem; }
  .dismiss { width: 44px; height: 44px; }
}
@media (max-height: 540px) and (max-width: 620px) and (orientation: landscape) {
  .maptools { grid-auto-flow: column; bottom: .5rem; right: .55rem; }
  .maptools button + button { border-top: 0; border-left: 1px solid #445a54; }
  #mapbarBottom .layerkey { display: none; }
}
body.immersive {
  position: fixed; inset: 0; height: 100dvh; min-height: 0;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}
.immersive main { display: grid; grid-template-columns: minmax(0,1fr); }
.immersive .mapspace { height: auto; min-height: 0; max-height: none; }
.immersive footer, .immersive #home { display: none; }
.immersive .panel { overflow: auto; min-height: 0; overscroll-behavior: contain; }
.immersive.inspector-open main { grid-template-columns: minmax(0,1fr) clamp(16rem,30vw,30rem); }
@media (max-width: 820px) and (orientation: portrait), (max-width: 620px) {
  .immersive main { display: flex; flex-direction: column; }
  .immersive .mapspace { flex: 1 1 0; }
  .immersive .panel { flex: 0 0 44%; }
}
@media (max-width: 550px) {
  .immersive .mast nav #method, .immersive .mast nav #sources { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
}
.bundleSearch {
  width: 100%;
  padding: 8px 10px;
  color: var(--ink);
  border: 1px solid #bdcdc1;
  border-radius: 5px;
  margin: 6px 0;
  background: white;
}
.panel details summary {
  cursor: pointer;
  color: var(--deep);
  padding: 7px 0;
}
.panel .extlink,
.panel .primary {
  font-weight: 550;
}
dialog a {
  overflow-wrap: anywhere;
}
.witnessSelect {
  max-width: 100%;
  padding: 6px 8px;
  border: 1px solid #b7caba;
  border-radius: 5px;
  background: #f1f5ed;
  color: var(--ink);
  font-size: 14px;
}
.routeList {
  padding-inline-start: 25px;
}
.routeList li {
  padding: 3px 0;
  overflow-wrap: anywhere;
  font-size: 14px;
}
.pathButton {
  font: inherit;
  text-align: left;
  color: var(--deep);
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0;
}
.routeList code {
  font-size: 12px;
}
.layerbox .evidenceField {
  align-items: flex-start;
  flex-direction: column;
  border-top: 1px solid #53655d;
  margin-top: 5px;
  padding-top: 8px;
}
.evidenceField select {
  color: #ecf5ef;
  background: #223731;
  border: 1px solid #728479;
  border-radius: 3px;
  padding: 4px 6px;
  width: 100%;
  font-size: 13px;
}

.layerbox { max-height: min(66dvh, 26rem); overflow-y: auto; overscroll-behavior: contain; }
