@font-face {
  font-family: "CNDC Scanner";
  src: url("./cndc-scanner.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: block;
}
:root {
  color-scheme: light;
  --blue: #000080;
  --chrome: #c0c0c0;
  --white: #fff;
  --shade: #808080;
  --ink: #111;
  font-family: "CNDC Scanner", monospace;
  font-synthesis: none;
  color: var(--ink);
  background: #fff;
  font-size: 16px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  padding: 12px;
  height: 100dvh;
  overflow: hidden;
}
button,
input,
textarea {
  font: inherit;
  color: inherit;
}
button {
  min-height: 36px;
  background: var(--chrome);
  border: 2px solid;
  border-color: #fff #404040 #404040 #fff;
  padding: 6px 10px;
  cursor: pointer;
  white-space: nowrap;
}
button:hover {
  background: #d4d4d4;
}
button:active,
button[aria-pressed="true"] {
  border-color: #404040 #fff #fff #404040;
  background: #dedede;
}
button:disabled {
  color: #555;
  cursor: not-allowed;
  background: #c0c0c0;
}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
canvas:focus-visible {
  outline: 2px solid #0000ff;
  outline-offset: 2px;
}
input,
textarea {
  border: 2px solid;
  border-color: #808080 #fff #fff #808080;
  background: #fff;
  border-radius: 0;
  padding: 8px;
  caret-color: var(--blue);
}
::selection {
  background: var(--blue);
  color: #fff;
}
::placeholder {
  color: #595959;
}
* {
  scrollbar-color: #808080 #dedede;
  scrollbar-width: thin;
}
button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: #000080;
  stroke-width: 1.5;
  stroke-linejoin: miter;
  flex: none;
}
.station {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--chrome);
  border: 2px solid;
  border-color: #fff #404040 #404040 #fff;
  padding: 3px;
  min-width: 0;
}
.titlebar {
  background: var(--blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 8px 10px;
}
.titlebar h1 {
  margin: 0;
  min-width: 0;
  font-size: 18px;
}
.titlebar canvas {
  display: block;
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
}
.titlebar #connection {
  font-size: 12px;
  white-space: nowrap;
}
.telemetry {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 13px 10px;
  border-bottom: 1px solid #808080;
  font-variant-numeric: tabular-nums;
}
.progress-label {
  display: flex;
  gap: 9px;
  align-items: baseline;
}
.progress-label span {
  font-size: 12px;
  color: #333;
}
progress {
  appearance: none;
  flex: 1;
  height: 18px;
  min-width: 20px;
  border: 2px solid;
  border-color: #808080 #fff #fff #808080;
  background: #fff;
}
progress::-webkit-progress-bar {
  background: #fff;
}
progress::-webkit-progress-value {
  background: var(--blue);
}
progress::-moz-progress-bar {
  background: var(--blue);
}
.online {
  display: flex;
  align-items: center;
  gap: 6px;
  border-left: 1px solid #808080;
  padding-left: 14px;
  white-space: nowrap;
}
.online i {
  width: 7px;
  height: 7px;
  background: #006000;
}
.toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 6px;
  flex-wrap: wrap;
}
.toolgroup {
  display: flex;
  gap: 3px;
  align-items: center;
  margin-right: 5px;
}
.toolgroup button {
  display: flex;
  gap: 7px;
  align-items: center;
}
.toolgroup output {
  width: 48px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.work-area {
  display: flex;
  flex: 1;
  min-height: 0;
  gap: 7px;
}
.viewport {
  position: relative;
  flex: 1;
  min-width: 0;
  background: #e7e7e7;
  border: 2px solid;
  border-color: #808080 #fff #fff #808080;
  overflow: hidden;
}
#board {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}
#board.dragging {
  cursor: grabbing;
}
#board.selecting {
  cursor: crosshair;
}
#notice {
  position: absolute;
  left: 12px;
  bottom: 12px;
  max-width: calc(100% - 24px);
  padding: 8px 12px;
  background: #fff;
  border: 1px solid #808080;
  pointer-events: none;
  font-size: 13px;
}
#notice:empty {
  display: none;
}
#help {
  position: absolute;
  top: 12px;
  left: 12px;
  width: min(410px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  overflow: auto;
  background: #fff;
  border: 2px solid #000080;
  padding: 18px;
  line-height: 1.5;
}
#help p:last-child {
  margin-bottom: 0;
}
#completion {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  background: #000080;
  color: #fff;
  padding: 12px 20px;
  text-align: center;
  width: max-content;
  max-width: 90%;
}
#completion span {
  display: block;
  margin-top: 6px;
  font-size: 13px;
}
aside {
  width: 280px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 2px solid;
  border-color: #fff #808080 #808080 #fff;
  padding: 3px;
}
.reference h2,
.chat h2,
dialog h2 {
  margin: 0;
  padding: 9px 7px;
  background: #000080;
  color: white;
  font-weight: normal;
  line-height: 1;
}
h2 canvas {
  display: block;
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
}
.reference {
  flex: none;
  padding-bottom: 10px;
  border-bottom: 1px solid #808080;
}
.reference > button {
  margin: 9px 7px 0;
}
.reference img {
  max-height: 190px;
  max-width: calc(100% - 14px);
  margin: 8px auto 0;
  object-fit: contain;
}
.reference img:not([hidden]) {
  display: block;
}
.reference p {
  font-size: 11px;
  color: #333;
  margin: 8px 7px 0;
}
.chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding-top: 10px;
}
.chat-retention {
  font-size: 11px;
  color: #333;
  padding: 0 7px;
  margin: 9px 0;
}
#messages {
  list-style: none;
  margin: 0 5px 9px;
  padding: 8px;
  flex: 1;
  min-height: 60px;
  background: #fff;
  border: 2px solid;
  border-color: #808080 #fff #fff #808080;
  overflow: auto;
  overflow-wrap: anywhere;
}
#messages li {
  margin-bottom: 14px;
  line-height: 1.4;
}
#messages li:last-child {
  margin-bottom: 0;
}
#messages header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: #000080;
}
#messages time {
  color: #555;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
#messages p {
  margin: 4px 0 0;
}
#empty-chat {
  color: #555;
  font-size: 13px;
}
#chat-form {
  padding: 0 5px 5px;
}
#chat-input {
  width: 100%;
  resize: none;
  line-height: 1.4;
}
#chat-form > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 5px;
}
#nickname {
  font-size: 12px;
  max-width: 125px;
  overflow: hidden;
  text-overflow: ellipsis;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 5px 3px;
  font-size: 11px;
  min-height: 24px;
}
#identity {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
#activity {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#chat-toggle {
  display: none;
}
dialog {
  padding: 3px;
  width: min(430px, calc(100vw - 24px));
  border: 2px solid;
  border-color: #fff #404040 #404040 #fff;
  background: #c0c0c0;
  box-shadow: 6px 9px 22px #0005;
}
dialog::backdrop {
  background: #1118;
}
.entry-content {
  padding: 20px;
}
.entry-content h3 {
  font-size: 22px;
  margin: 0 0 12px;
}
.entry-content p {
  line-height: 1.5;
  margin: 0 0 18px;
}
.entry-content label {
  display: block;
  margin-bottom: 6px;
}
.entry-content input {
  width: 100%;
}
.entry-content button {
  width: 100%;
  background: #dedede;
  margin: 0 0 14px;
  min-height: 42px;
}
.entry-content small {
  display: block;
  font-size: 12px;
  line-height: 1.5;
  color: #333;
}
#entry-error {
  color: #800000;
  font-size: 13px;
  min-height: 0;
  margin: 9px 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
[hidden] {
  display: none !important;
}
@media (max-width: 850px) {
  body {
    padding: 5px;
  }
  .titlebar {
    min-height: 39px;
    padding: 7px;
  }
  .titlebar #connection {
    font-size: 10px;
  }
  .telemetry {
    gap: 8px;
    padding: 10px 6px;
  }
  .progress-label {
    gap: 5px;
  }
  .progress-label span {
    display: none;
  }
  .online {
    padding-left: 8px;
    font-size: 12px;
  }
  .toolbar {
    gap: 5px;
    padding: 6px 3px;
  }
  .toolbar button {
    min-height: 40px;
    font-size: 12px;
    padding: 7px;
  }
  .toolgroup {
    margin-right: 0;
  }
  .toolgroup button {
    gap: 4px;
  }
  .toolgroup output {
    width: 41px;
    font-size: 12px;
  }
  #chat-toggle {
    display: block;
  }
  aside {
    display: none;
    position: absolute;
    right: 8px;
    top: 162px;
    bottom: 34px;
    z-index: 3;
    width: min(320px, calc(100vw - 16px));
    background: #c0c0c0;
    box-shadow: 3px 5px 16px #0004;
  }
  aside.open {
    display: flex;
  }
  footer {
    font-size: 10px;
  }
  .titlebar h1 {
    max-width: calc(100% - 90px);
  }
  #notice {
    font-size: 12px;
    left: 8px;
    bottom: 8px;
    max-width: calc(100% - 16px);
  }
}
@media (max-width: 450px) {
  .toolgroup button span {
    display: none;
  }
  #help-toggle {
    font-size: 11px;
  }
  .titlebar h1 {
    max-width: calc(100% - 78px);
  }
  .online {
    gap: 4px;
  }
  #identity {
    display: none;
  }
}
