:root {
  --ink: #20342f;
  --muted: #596b64;
  --rule: #d5dcd0;
  --paper: #fbfcf6;
  --moss: #355b48;
  --lime: #e1f681;
  --teal: #347b7a;
  color: var(--ink);
  font:
    15px/1.5 "DM Sans",
    "Microsoft YaHei UI",
    "PingFang SC",
    sans-serif;
  font-variant-numeric: tabular-nums;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f3f5ef;
}
button,
select,
input {
  font: inherit;
}
button,
select {
  cursor: pointer;
  color: inherit;
}
button {
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
}
button:hover,
select:hover {
  background: #e8eee1;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 3px solid #889c46;
  outline-offset: 3px;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
header {
  height: 64px;
  background: #213b32;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(22px, calc((100vw - 1480px) / 2 + 32px));
}
.mast {
  display: flex;
  align-items: center;
  gap: 13px;
  white-space: nowrap;
}
.mast strong {
  font-size: 18px;
  letter-spacing: 1.5px;
}
.mast > span:last-child {
  color: #c7d5c9;
  font-size: 13px;
}
.mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-content: center;
  font: bold 40px/1 Georgia;
  background: var(--lime);
  border-radius: 8px;
  color: #2f4c3c;
  padding-bottom: 6px;
}
.divider {
  width: 1px;
  height: 16px;
  background: #5d7063;
}
header button {
  border-color: #62766b;
  color: #f0f5ed;
}
header button:hover {
  background: #365245;
}
main {
  max-width: 1480px;
  margin: auto;
  padding: 24px 32px 16px;
}
.page-title,
.viewbar,
.mapfoot,
.read-title,
.dialoghead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.page-title {
  margin-bottom: 22px;
}
.location {
  font-size: 12px;
  letter-spacing: 1.2px;
  font-weight: 550;
  color: var(--muted);
  margin: 0 0 3px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: clamp(26px, 3.1vw, 43px);
  font-family: "STIX Two Text", "Songti SC", SimSun, serif;
  letter-spacing: 1px;
  line-height: 1.35;
}
.datum {
  text-align: right;
  font-size: 11px;
  color: var(--muted);
}
.datum strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 0.3px;
}
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(284px, 30%);
  gap: 16px;
  align-items: start;
}
.leftcol,
aside {
  display: grid;
  gap: 16px;
  min-width: 0;
}
.frame {
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 10px;
}
h2 {
  font-size: 16px;
  letter-spacing: 0.5px;
}
.viewbar {
  min-height: 52px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--rule);
}
.switch {
  padding: 3px;
  display: flex;
  gap: 2px;
  background: #eaf0e6;
  border-radius: 6px;
}
.switch button {
  border: 0;
  padding: 4px 10px;
  font-size: 12px;
}
.switch button[aria-pressed="true"] {
  background: var(--moss);
  color: #fff;
}
.stage {
  height: clamp(330px, 47vh, 530px);
  position: relative;
  overflow: hidden;
  background-color: #e4e9dd;
  background-image:
    linear-gradient(#cad4c65c 1px, transparent 1px),
    linear-gradient(90deg, #cad4c65c 1px, transparent 1px);
  background-size: 25px 25px;
  isolation: isolate;
}
.stage > canvas,
.stage > #photoWrap,
#labels {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#terrain {
  touch-action: none;
  cursor: grab;
}
#terrain:active {
  cursor: grabbing;
}
#photoWrap {
  background: #dce2d7;
}
#photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
#tracing {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
#labels {
  pointer-events: none;
  overflow: hidden;
}
.tag {
  position: absolute;
  transform: translate(-50%, -100%);
  padding: 3px 7px;
  border-radius: 3px;
  background: rgba(26, 52, 43, 0.91);
  color: #f8fbf2;
  font-size: 11px;
  white-space: nowrap;
  line-height: 1.45;
  box-shadow: 0 1px 4px #142b2633;
}
.tag:after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: 8px;
  background: #fff;
}
.tag:before {
  content: "";
  position: absolute;
  left: calc(50% - 2px);
  top: calc(100% + 6px);
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #e1f681;
  border: 1px solid #334a36;
}
#stagecaption {
  position: absolute;
  left: 12px;
  top: 12px;
  font-size: 11px;
  letter-spacing: 0.3px;
  background: #f7f9edeb;
  border: 1px solid #cbd4c4;
  border-radius: 4px;
  padding: 3px 8px;
  color: #374f41;
}
.tools {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  gap: 4px;
}
.tools button {
  background: #f9fbf3f2;
  font-size: 12px;
  padding: 4px 9px;
}
.mapfoot {
  min-height: 39px;
  padding: 7px 16px;
  font-size: 12px;
  color: var(--muted);
}
label {
  cursor: pointer;
}
input {
  accent-color: #457859;
}
input[type="checkbox"] {
  vertical-align: middle;
}
.readout {
  background: #284b3d;
  color: #f4f7ed;
  padding: 17px 21px;
}
.read-title span {
  font-size: 11px;
  color: #deecbd;
  border: 1px solid #648065;
  padding: 2px 7px;
  border-radius: 20px;
}
.largeval {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 9px;
}
.largeval strong {
  font:
    500 clamp(43px, 4.2vw, 65px) / 1.12 "DM Sans",
    "Segoe UI",
    Arial,
    sans-serif;
  letter-spacing: -2.7px;
  color: var(--lime);
}
.largeval i {
  font-style: normal;
  color: #ccdec5;
}
.largecap {
  font-size: 12px;
  color: #c7d5c6;
}
.metrics {
  margin-top: 13px;
  border-top: 1px solid #526d5c;
  padding-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.metrics span {
  display: block;
  color: #ccdacb;
  font-size: 11px;
}
.metrics b {
  font-family: "Segoe UI", sans-serif;
  font-size: 21px;
  font-weight: 550;
}
.metrics small {
  font-size: 11px;
  color: #c7d5c6;
}
.config,
.budget {
  padding: 16px 19px;
}
.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 11px 0 16px;
}
.presets button {
  font-size: 12px;
  padding: 4px 10px;
}
.presets button[aria-pressed="true"] {
  background: #e0ead4;
  border-color: #8aa57a;
}
.param {
  display: block;
  margin: 10px 0;
}
.param .pline {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px;
  font-size: 13px;
}
.param output {
  font-weight: 650;
  color: #325d4c;
}
.param input {
  width: 100%;
  margin: 6px 0 0;
  height: 15px;
}
.notice {
  font-size: 11.5px;
  color: #5e6d63;
  border-top: 1px solid var(--rule);
  padding-top: 10px;
  margin-top: 11px;
}
.chartbox .viewbar {
  border: 0;
  min-height: 43px;
  padding-bottom: 0;
}
select {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 3px 6px;
  font-size: 12px;
}
#chart {
  width: 100%;
  height: 116px;
  display: block;
}
.timeline {
  display: flex;
  align-items: center;
  gap: 13px;
  border-top: 1px solid var(--rule);
  padding: 8px 18px;
}
.timeline input {
  flex: 1;
  min-width: 15px;
}
.timeline button {
  font-size: 12px;
  min-width: 70px;
}
.timeline output {
  min-width: 38px;
  text-align: right;
  font-size: 13px;
  font-weight: 600;
}
.budget summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}
.budget summary small {
  float: right;
  font-weight: 400;
  color: var(--muted);
}
dl {
  margin: 10px 0 12px;
}
dl > div {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  border-bottom: 1px solid var(--rule);
  padding: 4px 0;
}
dd {
  margin: 0;
}
.budget button {
  width: 100%;
}
footer {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  font-size: 11px;
  color: var(--muted);
}
dialog {
  width: min(540px, 92vw);
  max-height: 85vh;
  overflow: auto;
  border: 1px solid var(--rule);
  border-radius: 10px;
  color: var(--ink);
  padding: 24px;
  background: var(--paper);
}
dialog::backdrop {
  background: #152d258c;
}
dialog h3 {
  font-size: 15px;
  margin: 16px 0 4px;
}
dialog p,
.doclinks {
  font-size: 13px;
  line-height: 1.75;
}
.doclinks {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 15px;
  margin-top: 14px;
}
a {
  color: #325e49;
}
[hidden] {
  display: none !important;
}
@media (min-width: 1500px) {
  .stage {
    height: 520px;
  }
}
@media (max-width: 820px) {
  main {
    padding: 16px;
  }
  .layout {
    grid-template-columns: minmax(0, 1fr) minmax(245px, 33%);
    gap: 10px;
  }
  .config,
  .budget,
  .readout {
    padding: 13px;
  }
  .leftcol,
  aside {
    gap: 10px;
  }
  .datum {
    display: none;
  }
  .viewbar {
    padding: 8px 12px;
  }
  .stage {
    height: 330px;
  }
}
@media (max-width: 670px) {
  header {
    height: 50px;
    padding: 0 14px;
  }
  .mast {
    gap: 8px;
  }
  .mast > span:last-child,
  .divider {
    display: none;
  }
  main {
    padding: 14px 10px;
  }
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .page-title {
    margin: 2px 2px 13px;
  }
  .leftcol,
  aside {
    display: contents;
  }
  .layout > .leftcol > .frame:first-child {
    order: 0;
  }
  .readout {
    order: 1;
  }
  .config {
    order: 2;
  }
  .chartbox {
    order: 3;
  }
  .budget {
    order: 4;
  }
  .stage {
    height: clamp(295px, 68vw, 410px);
  }
  .mapfoot {
    font-size: 11px;
    padding: 7px 10px;
  }
  .readout {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
  }
  .read-title {
    grid-column: 1/-1;
  }
  .largeval {
    grid-row: 2;
    grid-column: 1;
  }
  .largecap {
    grid-row: 3;
    grid-column: 1;
  }
  .metrics {
    grid-column: 2;
    grid-row: 2/4;
    align-self: center;
    border-top: 0;
    padding-top: 0;
    margin: 8px 0 0;
  }
  .mark {
    width: 28px;
    height: 28px;
    font-size: 34px;
  }
}
.tag:before,
.tag:after {
  display: none;
}
.tools button[aria-pressed="true"] {
  background: var(--moss);
  color: white;
}
#parameters details > summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--moss);
  margin: 8px 0;
}
.metrics b {
  overflow-wrap: anywhere;
}

#meterScale {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: grid;
  justify-items: center;
  gap: 2px;
  background: #f8faf0e8;
  padding: 3px 6px 4px;
  border-radius: 3px;
  font:
    10px/1.2 "Segoe UI",
    "Microsoft YaHei UI",
    sans-serif;
}
#meterScale:after {
  content: "";
  width: var(--width);
  height: 4px;
  border: 1px solid #3f5848;
  border-top: 0;
}

#north {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  line-height: 1;
  font-size: 10px;
  color: #314839;
  background: #f8faf0e8;
  border-radius: 4px;
  padding: 4px 6px;
  gap: 2px;
}
#north i {
  display: inline-block;
  font:
    600 23px/21px Arial,
    sans-serif;
}

.normal-ref {
  grid-column: 1/-1;
  margin-top: 10px;
  color: #d7e5d3;
  font-size: 11px;
}
.normal-ref b {
  font-weight: 550;
  color: #f4f8e7;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
#jumpDispatch {
  background: #d9eab3;
  color: #253c30;
  border-color: #d9eab3;
}
#jumpDispatch:hover {
  background: #e7f4cd;
}
.release-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}
.outflow-parts {
  grid-column: 1/-1;
  font-size: 12px;
  color: #dce9d7;
  margin: 8px 0 0;
}
#state-card,
#dispatch-panel,
#gate-panel {
  scroll-margin: 10px;
}
@media (max-width: 420px) {
  .page-actions {
    gap: 4px;
  }
  .page-actions button {
    font-size: 11px;
    padding: 5px 7px;
  }
}

@media (max-width: 540px) {
  header {
    height: auto;
    min-height: 50px;
    gap: 4px 8px;
    flex-wrap: wrap;
    padding: 7px 10px;
  }
  .page-actions {
    gap: 4px;
    flex-wrap: wrap;
  }
  .page-actions button {
    font-size: 11px;
    padding: 5px 7px;
  }
}
