body {
  margin: 0;
  min-height: 100vh;
  background: rgb(6 9 19);
}

canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  touch-action: none;
}

canvas.node-hover {
  cursor: grab;
}

canvas.node-dragging {
  cursor: grabbing;
}

#fps {
  position: fixed;
  bottom: 12px;
  left: 12px;
  padding: 5px 7px;
  color: #d8e7ff;
  background: #06101ccc;
  font: 14px monospace;
  pointer-events: none;
}

.node-label-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.node-label {
  position: absolute;
  padding: 4px 8px;
  border: 1px solid rgb(218 223 232);
  border-radius: 7px;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 3px 10px rgb(0 0 0 / 16%);
  color: rgb(29 35 48);
  font: 20px/1.2 system-ui, sans-serif;
  transform: translate(-50%, calc(-100% - 7px));
  white-space: nowrap;
}

.node-label::after {
  position: absolute;
  bottom: -5px;
  left: 50%;
  width: 8px;
  height: 8px;
  border-right: 1px solid rgb(218 223 232);
  border-bottom: 1px solid rgb(218 223 232);
  background: rgb(255 255 255 / 94%);
  content: "";
  transform: translateX(-50%) rotate(45deg);
}

.level-top {
  position: fixed;
  top: 24px;
  left: 50%;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 12px;
  width: min(560px, calc(100vw - 48px));
  pointer-events: none;
  transform: translateX(-50%);
}

.level-prompt {
  width: 100%;
  padding: 12px 16px;
  color: white;
  font-family: system-ui, sans-serif;
  text-align: center;
  pointer-events: auto;
}

.level-pack-name {
  margin: 0 0 4px;
  color: rgb(184 192 207);
  font-size: 13px;
}

.level-sentence {
  margin: 0;
  font-size: 24px;
}

.level-context {
  margin: 8px 0 0;
  color: rgb(184 192 207);
  font-size: 18px;
}

.level-prompt button {
  min-height: 36px;
  margin-top: 12px;
  padding: 6px 10px;
  border: 1px solid rgb(218 223 232);
  border-radius: 7px;
  background: white;
  color: rgb(29 35 48);
  cursor: pointer;
  font: inherit;
}

.inspector {
  position: fixed;
  top: 24px;
  left: 24px;
  width: 280px;
  padding: 20px;
  border: 1px solid rgb(218 223 232);
  border-radius: 12px;
  background: white;
  box-shadow: 0 12px 32px rgb(0 0 0 / 20%);
  color: rgb(29 35 48);
  font-family: system-ui, sans-serif;
}

.inspector h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.inspector dl {
  margin: 0;
}

.inspector dt {
  color: rgb(87 96 115);
  font-size: 14px;
}

.inspector dd {
  margin: 2px 0 0;
  font-size: 16px;
}

.inspector dt:not(:first-child) {
  margin-top: 16px;
}

.inspector h3 {
  margin: 16px 0 4px;
  color: rgb(87 96 115);
  font-size: 14px;
  font-weight: 400;
}

.inspector ul {
  margin: 0;
  padding-left: 20px;
}

.inspector-input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.inspector fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.inspector button {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid rgb(87 96 115);
  border-radius: 7px;
  background: rgb(29 35 48);
  color: white;
  cursor: pointer;
  font: inherit;
}

.inspector button[aria-pressed="true"] {
  background: rgb(31 112 77);
}

.inspector .disconnect-input {
  min-height: 28px;
  padding: 3px 7px;
  border-color: rgb(184 192 207);
  background: white;
  color: rgb(29 35 48);
  font-size: 12px;
}

.inspector .delete-node {
  border-color: rgb(150 46 46);
  background: rgb(180 55 55);
}

.inspector legend {
  margin-bottom: 8px;
  font-size: 16px;
}

.configuration-options {
  display: grid;
  gap: 6px;
}

.configuration-option {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
}

.configuration-option input {
  width: 18px;
  height: 18px;
  margin: 0;
}

.palette-icon-definitions {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.palette-box-top {
  fill: var(--palette-box-top);
}

.palette-box-left {
  fill: var(--palette-box-left);
}

.palette-box-right {
  fill: var(--palette-box-right);
}

.palette-box-left-band {
  fill: var(--palette-box-left-band);
}

.palette-box-right-band {
  fill: var(--palette-box-right-band);
}

.palette {
  position: fixed;
  bottom: 24px;
  left: 50%;
  display: flex;
  max-width: calc(100vw - 48px);
  align-items: center;
  padding: 12px;
  border: 1px solid rgb(218 223 232);
  border-radius: 12px;
  background: white;
  box-shadow: 0 12px 32px rgb(0 0 0 / 20%);
  color: rgb(29 35 48);
  font-family: system-ui, sans-serif;
  transform: translateX(-50%);
}

.palette-items {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.palette-section {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.palette-divider {
  width: 1px;
  height: 56px;
  flex: 0 0 1px;
  background: rgb(218 223 232);
}

.palette button {
  display: grid;
  justify-items: center;
  gap: 3px;
  min-width: 72px;
  padding: 2px;
  border: 1px solid transparent;
  background: transparent;
  color: inherit;
  cursor: grab;
  font: inherit;
  touch-action: none;
}

.palette button:hover,
.palette button:focus-visible {
  outline: none;
}

.palette-item-icon {
  width: auto;
  height: 42px;
}

.palette-item-title {
  max-width: 104px;
  overflow-wrap: anywhere;
  color: rgb(87 96 115);
  font-size: 14px;
  line-height: 1.2;
  text-align: center;
}

.palette button:active {
  cursor: grabbing;
}

body.palette-dragging,
body.palette-dragging * {
  cursor: grabbing !important;
}

.palette-drag-ghost {
  position: fixed;
  z-index: 10;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  opacity: 1;
  pointer-events: none;
}
