:root {
  color-scheme: dark;
  --mint: #9be8c2;
  --ink: #102725;
  --line: rgba(174,212,198,.18);
  --muted: #aac0b8;
  --mono: ui-monospace,"SFMono-Regular",Menlo,monospace;
  font-family: -apple-system,BlinkMacSystemFont,"PingFang HK","Noto Sans TC",sans-serif;
  color: #f0f4ed;
  background: var(--ink);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

button {
  color: inherit;
  font: inherit;
  cursor: pointer;
  border: 0;
  background: none;
}

button:focus-visible,[tabindex]:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: -2px;
}

button:hover {
  color: var(--mint);
}

h1,h2 {
  margin: 0;
}

svg.icon {
  display: block;
  width: 17px;
  height: 17px;
  flex: none;
  stroke: currentColor;
  stroke-width: 1.55;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

small,.english,.live,.clock,#guide-count,.scene-caption b {
  font-family: var(--mono);
}

.mast {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 26px;
  height: 75px;
  flex: none;
  background: #122925;
  border-bottom: 1px solid #466156;
  position: relative;
  z-index: 3;
}

.brand-mark {
  height: 43px;
  width: 43px;
  background: #203d32;
  border: 1px solid #638875;
  border-radius: 6px;
  display: grid;
  place-items: center;
}

.brand-mark canvas {
  width: 36px;
  image-rendering: pixelated;
}

.brand h1 {
  font-size: 22px;
  letter-spacing: .09em;
  line-height: 1.4;
}

.brand h1 span {
  font-size: 16px;
  font-weight: 500;
  color: #dae3d7;
}

.english {
  font-size: 9px;
  letter-spacing: .19em;
  color: #a3c1ac;
  margin-top: 3px;
}

.english b {
  padding: 0 4px;
  font-weight: 400;
  color: #749585;
}

.head-right,.clock,.live {
  display: flex;
  align-items: center;
}

.head-right {
  margin-left: auto;
  gap: 18px;
}

.live {
  gap: 7px;
  color: #b3f0cc;
  border: 1px solid #486758;
  background: #233e32;
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 10px;
  letter-spacing: .09em;
}

.live i,.health i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #96e9b9;
}

.clock {
  gap: 8px;
  border-left: 1px solid var(--line);
  padding-left: 17px;
}

.clock small {
  font-size: 9px;
  letter-spacing: .08em;
  color: var(--muted);
}

.clock time {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

#map {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  background: #185869;
}

#viewer,.map-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.map-layer {
  pointer-events: none;
}

#viewer.pixelated canvas {
  image-rendering: pixelated;
}

#viewer {
  touch-action: none;
}

#viewer {
  background-color: #185869;
}

/* OpenSeadragon assigns its canvas a transparent inline background. */
#viewer canvas {
  background-color: #185869 !important;
}

.surface {
  background: rgba(16,37,33,.95);
  border: 1px solid rgba(184,213,189,.32);
  border-radius: 7px;
  box-shadow: 0 4px 16px #071c2240;
}

.scene-caption {
  position: absolute;
  left: 23px;
  top: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  background: #132922e8;
  border: 1px solid #d8ebd24d;
  border-radius: 4px;
  padding: 7px 10px;
  font-size: 12px;
  letter-spacing: .09em;
  pointer-events: none;
}

.scene-caption span:not(.section-line) {
  color: #87a995;
}

.scene-caption b {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: .12em;
  color: #c0dfcd;
}

.section-line {
  width: 15px;
  height: 3px;
  background: var(--mint);
  box-shadow: 3px -4px 0 -1px #9be8c2;
}

#layers,.panel-trigger {
  position: absolute;
  right: 20px;
  top: 20px;
}

#layers {
  width: 217px;
  padding: 16px 15px 13px;
}

.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}

.panel-title>.icon {
  width: 24px;
  height: 24px;
  color: var(--mint);
}

.panel-title h2,.guide h2 {
  font-size: 16px;
  letter-spacing: .08em;
}

.panel-title small {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: .16em;
  display: block;
  margin-top: 3px;
}

.panel-title button,.guide-nav button {
  margin-left: auto;
  display: grid;
  place-items: center;
  border-radius: 4px;
  border: 1px solid var(--line);
  width: 25px;
  height: 24px;
  color: #c0d4c8;
}

#switches {
  padding: 8px 0;
}

.switch {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  font-size: 13px;
  letter-spacing: .035em;
}

.switch .icon {
  color: #abc3b4;
  width: 16px;
}

.switch .track {
  margin-left: auto;
  width: 27px;
  height: 15px;
  border-radius: 9px;
  border: 1px solid #779083;
  background: #46554d;
  position: relative;
}

.track:after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #d4dfd7;
  transition: transform .15s;
}

.switch[aria-checked=true] .track {
  background: #9adbb6;
  border-color: #9adbb6;
}

.switch[aria-checked=true] .track:after {
  transform: translateX(12px);
  background: #244b3a;
}

.views {
  border-top: 1px solid var(--line);
  padding-top: 11px;
  display: grid;
  gap: 6px;
}

.views button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 4px;
  border: 1px solid var(--line);
  padding: 7px;
  font-size: 12px;
  font-weight: 600;
}

.views #core {
  background: #acdfbd;
  color: #183b2c;
  border-color: #acdfbd;
}

.views #core:hover {
  background: #c6eed4;
}

.views .icon {
  width: 14px;
  height: 14px;
}

.panel-trigger {
  display: none;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--mint);
}

.folded #layers {
  display: none;
}

.folded .panel-trigger {
  display: grid;
}

.overview {
  position: absolute;
  bottom: 16px;
  left: 22px;
  width: 132px;
  padding: 7px;
}

.overview>div {
  display: flex;
  gap: 5px;
  align-items: center;
  font-size: 10px;
  margin-bottom: 6px;
}

.overview small {
  font-size: 7px;
  letter-spacing: .08em;
  color: var(--muted);
  margin-left: auto;
}

.overview .icon {
  width: 12px;
  height: 12px;
  color: var(--mint);
}

.overview button {
  width: 100%;
  display: block;
  padding: 0;
}

.overview canvas {
  width: 100%;
  display: block;
  background: #185869;
  outline: 1px solid var(--line);
}

.map-tools {
  position: absolute;
  bottom: 16px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.zoom {
  display: flex;
  align-items: center;
  height: 34px;
}

.zoom button {
  display: grid;
  place-items: center;
  width: 32px;
  height: 100%;
}

.zoom output {
  font: 12px var(--mono);
  color: #c9ead5;
  padding: 0 7px;
  border-inline: 1px solid var(--line);
}

.ruler {
  text-align: center;
  color: white;
  text-shadow: 0 1px 3px #10221a;
  font: 10px var(--mono);
}

.ruler i {
  display: block;
  border: 1px solid white;
  border-top: 0;
  height: 5px;
  box-shadow: 0 1px 2px #18352e;
  margin-top: 3px;
}

#depth {
  --top: 22%;
  --bottom: 23%;
  --top-blur: 1.5px;
  --bottom-blur: 1.8px;
}

.blur {
  position: absolute;
  left: 0;
  right: 0;
  transform: translate3d(var(--nudge,0px),0,0);
  will-change: transform;
}

.blur.top {
  top: 0;
  height: var(--top);
  --b: var(--top-blur);
  --fade: linear-gradient(to bottom,#000,transparent);
}

.blur.bottom {
  bottom: 0;
  height: var(--bottom);
  --b: var(--bottom-blur);
  --fade: linear-gradient(to top,#000,transparent);
}

.blur {
  backdrop-filter: blur(var(--b));
  mask-image: var(--fade);
}

.blur {
  -webkit-backdrop-filter: blur(var(--b));
  -webkit-mask-image: var(--fade);
}

.pin {
  position: absolute;
  left: 0;
  top: 0;
  width: max-content;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  background: #112e29ec;
  color: #e8f9eb;
  border: 1px solid #aacbb5b3;
  border-radius: 4px;
  box-shadow: 0 2px 5px #0003;
  transform: translate(-50%,calc(-100% - 16px));
  pointer-events: auto;
}

.pin .icon {
  width: 13px;
  height: 13px;
  color: var(--mint);
}

.pin:before,.pin:after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  height: 12px;
  width: 1px;
  background: #ddffe7;
}

.pin:after {
  height: 5px;
  width: 5px;
  margin: 12px 0 0 -2px;
  transform: rotate(45deg);
  box-shadow: 0 0 0 2px #153b31;
}

.pin.selected {
  background: #a9e5be;
  color: #19372b;
}

.pin.selected .icon {
  color: inherit;
}

#problem {
  position: absolute;
  left: 50%;
  top: 40%;
  transform: translate(-50%);
  background: #352721;
  color: #ffe4ca;
  padding: 12px;
  border-radius: 5px;
}

.guide {
  flex: none;
  background: #132c28;
  border-top: 1px solid #536d5d;
  padding: 12px 23px 13px;
}

.guide-head,.guide-nav {
  display: flex;
  align-items: center;
}

.guide-head {
  gap: 9px;
  margin-bottom: 10px;
}

.guide-head>.icon {
  color: var(--mint);
}

.guide-head small {
  font-size: 9px;
  letter-spacing: .14em;
  color: #a5baaa;
}

.guide-nav {
  margin-left: auto;
  gap: 6px;
}

#guide-count {
  font-size: 10px;
  color: var(--muted);
  margin-right: 5px;
}

.guide-nav button {
  width: 25px;
  height: 21px;
}

.guide-nav button:disabled {
  opacity: .34;
  cursor: default;
}

.guide-nav .icon {
  width: 13px;
}

.guide h2 {
  font-size: 15px;
}

#landmarks {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

#landmarks::-webkit-scrollbar {
  display: none;
}

.place {
  padding: 0;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 clamp(169px,16.4vw,252px);
  min-width: 0;
  height: 54px;
  border: 1px solid #42594d;
  background: #213930;
  border-radius: 5px;
  overflow: hidden;
  scroll-snap-align: start;
}

.place:hover,.place[aria-current=true] {
  background: #2b493c;
  border-color: #94caa6;
}

.place canvas {
  height: 100%;
  width: 61px;
  object-fit: cover;
  border-right: 1px solid var(--line);
  image-rendering: pixelated;
}

.place strong,.place small {
  display: block;
}

.place strong {
  font-size: 13px;
  letter-spacing: .035em;
  font-weight: 580;
}

.place small {
  font: 10px/1.2 var(--mono);
  color: #b2c3b6;
  margin-top: 4px;
}

.place span {
  min-width: 0;
  padding-right: 4px;
}

.place strong,.place small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.telemetry {
  display: grid;
  gap: 6px;
  align-content: center;
  padding-left: 20px;
  margin-left: 10px;
  color: #bed1c4;
  font-size: 10px;
  border-left: 1px solid var(--line);
}

#header-zoom {
  font: 11px var(--mono);
  color: var(--mint);
  margin-right: 4px;
}

.health,#counts,.metric {
  display: flex;
  align-items: center;
}

.health {
  gap: 7px;
}

.health i {
  background: #e1be7e;
}

.health i.ready {
  background: #9ce7b6;
}

.slash {
  color: #637b6e;
}

#counts {
  gap: 15px;
}

.metric {
  gap: 4px;
}

.metric b {
  font: 11px var(--mono);
  color: #e1eae0;
}

.metric .icon {
  width: 13px;
  height: 13px;
}

@media(max-width:850px) {
  .clock small:first-child {
    display: none;
  }
  .mast {
    padding: 0 16px;
    height: 63px;
  }
  .guide {
    padding-inline: 14px;
  }
  .metric .label {
    display: none;
  }
  #counts {
    gap: 8px;
  }
  .telemetry {
    margin-left: 0;
    padding-left: 12px;
  }
  .overview {
    left: 14px;
  }
  .scene-caption {
    left: 14px;
  }
  #layers,.panel-trigger,.map-tools {
    right: 14px;
  }
}

@media(max-width:600px),(max-height:580px) {
  #layers {
    max-height: calc(100% - 16px);
    overflow: auto;
    z-index: 2;
    top: 8px;
  }
  .panel-trigger,.scene-caption {
    top: 12px;
  }
  .overview {
    display: none;
  }
  .map-tools {
    bottom: 12px;
  }
  .brand h1 {
    font-size: 17px;
  }
  .brand h1 span {
    font-size: 12px;
  }
  .mast {
    gap: 9px;
  }
  .head-right {
    gap: 5px;
  }
  .clock {
    border: 0;
    padding: 0;
  }
  .clock small,.clock time {
    display: none;
  }
  .english {
    font-size: 7px;
  }
  .brand-mark {
    width: 35px;
    height: 35px;
  }
  .brand-mark canvas {
    width: 30px;
  }
  .guide-head small {
    font-size: 8px;
  }
  .guide {
    padding-block: 9px;
  }
  .guide-head {
    margin-bottom: 7px;
  }
  .guide-nav {
    gap: 4px;
  }
  .place {
    height: 48px;
    flex-basis: 188px;
  }
  .place canvas {
    width: 53px;
  }
  .map-tools .ruler {
    margin-right: 2px;
  }
  .scene-caption {
    font-size: 10px;
  }
  .metric svg.icon {
    width: 11px;
  }
  .mast {
    flex-wrap: wrap;
    align-content: center;
    row-gap: 5px;
  }
  .telemetry {
    order: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    border: 0;
    gap: 2px;
    padding: 5px 0 0;
    margin: 0;
    width: 100%;
    border-top: 1px solid var(--line);
  }
  .health {
    gap: 4px;
    font-size: 9px;
  }
  #counts {
    gap: 5px;
  }
  .metric {
    gap: 2px;
  }
  .metric b {
    font-size: 10px;
  }
  .guide-nav button {
    height: 25px;
  }
  .overview,.panel-trigger {
    z-index: 1;
  }
  .pin {
    font-size: 10px;
  }
  .mast {
    height: 56px;
  }
}

@media(max-height:490px) {
  .guide {
    padding-block: 5px;
  }
  .place {
    height: 37px;
  }
  .mast {
    height: 42px;
  }
  .overview {
    display: none;
  }
  .guide-head {
    margin-bottom: 4px;
  }
}

[hidden] {
  display: none!important;
}

@media(max-width:600px) {
  .mast {
    min-height: 77px;
    height: auto;
    padding-block: 7px;
  }
  .brand h1 {
    letter-spacing: .06em;
  }
}

@media(max-height:490px) and (min-width:601px) {
  .mast {
    flex-wrap: nowrap;
  }
  .telemetry {
    order: 0;
    width: auto;
    border-top: 0;
    display: grid;
    padding-left: 12px;
  }
  .brand-mark {
    height: 29px;
    width: 29px;
  }
}

.share-fab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 33px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 600;
  color: var(--mint);
}

.share-fab:hover {
  background: #234237;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 132px;
  transform: translateX(-50%);
  z-index: 20;
  padding: 9px 18px;
  border-radius: 6px;
  background: rgba(16, 39, 37, .94);
  border: 1px solid var(--mint);
  color: #f0f4ed;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
  pointer-events: none;
}

@media(max-width:600px) {
  .share-fab span {
    display: none;
  }
  .share-fab {
    padding: 0 9px;
  }
}
