html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
  background: #eef6fb;
  color: #17212b;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

.app-navbar {
  background: #17212b;
}

.app-shell {
  max-width: 1320px;
}

.page-title {
  font-weight: 800;
  letter-spacing: 0;
}

.panel-card {
  background: #fff;
  border: 1px solid #d8e6ee;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(23, 33, 43, 0.08);
}

.metric {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: 1rem;
  border-radius: 8px;
  background: #f7fbfd;
  border: 1px solid #d8e6ee;
}

.metric-value {
  display: block;
  font-size: 1.5rem;
  font-weight: 800;
}

.json-editor {
  min-height: 480px;
  font-family: Consolas, Monaco, monospace;
  font-size: .9rem;
  line-height: 1.45;
}

.login-shell {
  min-height: calc(100vh - 160px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: min(460px, 100%);
}

.color-chip {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 1px solid #c8d6df;
  vertical-align: middle;
}

.level-editor {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1rem;
}

.toolbox,
.board-panel {
  border: 1px solid #d8e6ee;
  border-radius: 8px;
  background: #f7fbfd;
  padding: 1rem;
}

.tool-item {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: .6rem;
  border: 1px solid #c7d9e4;
  background: #fff;
  border-radius: 8px;
  margin-bottom: .5rem;
  padding: .4rem .55rem;
  cursor: grab;
  text-align: left;
}

.tool-item img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.editor-board {
  display: grid;
  gap: 4px;
  max-width: 720px;
  margin: 0 auto;
}

.editor-tile {
  position: relative;
  aspect-ratio: 1;
  border: 1px solid #a9d2e5;
  background: #eef8fd;
  border-radius: 8px;
  overflow: hidden;
}

.editor-tile.selected {
  outline: 3px solid #258cfb;
}

.tile-asset {
  position: absolute;
  left: 19%;
  top: 19%;
  width: 62%;
  height: 62%;
  object-fit: contain;
  z-index: 3;
  pointer-events: none;
}

.tile-label {
  position: absolute;
  left: 4px;
  bottom: 2px;
  z-index: 4;
  font-size: .62rem;
  color: #52636f;
}

.tile-lines {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.tile-line,
.tile-hub {
  position: absolute;
  background: #ffbf2f;
  border-radius: 999px;
}

.tile-hub {
  width: 18%;
  height: 18%;
  left: 41%;
  top: 41%;
}

.tile-line.north,
.tile-line.south {
  width: 12%;
  height: 50%;
  left: 44%;
}

.tile-line.north { top: 0; }
.tile-line.south { bottom: 0; }

.tile-line.east,
.tile-line.west {
  height: 12%;
  width: 50%;
  top: 44%;
}

.tile-line.east { right: 0; }
.tile-line.west { left: 0; }

.wire-demo {
  width: 34px;
  height: 34px;
  position: relative;
  display: inline-block;
  background: #eef8fd;
  border-radius: 6px;
}

.wire-demo::before,
.wire-demo::after {
  content: "";
  position: absolute;
  background: #ffbf2f;
  border-radius: 999px;
}

.wire-demo.horizontal::before {
  height: 7px;
  left: 3px;
  right: 3px;
  top: 14px;
}

.wire-demo.corner::before {
  width: 7px;
  height: 20px;
  left: 14px;
  top: 3px;
}

.wire-demo.corner::after {
  height: 7px;
  width: 20px;
  left: 14px;
  top: 14px;
}

.wire-demo.tee::before {
  height: 7px;
  left: 3px;
  right: 3px;
  top: 14px;
}

.wire-demo.tee::after {
  width: 7px;
  height: 20px;
  left: 14px;
  top: 3px;
}

.wire-demo.cross::before {
  height: 7px;
  left: 3px;
  right: 3px;
  top: 14px;
}

.wire-demo.cross::after {
  width: 7px;
  top: 3px;
  bottom: 3px;
  left: 14px;
}

.json-preview {
  max-height: 360px;
  overflow: auto;
  padding: 1rem;
  background: #17212b;
  color: #e8f5ff;
  border-radius: 8px;
}

@media (max-width: 900px) {
  .level-editor {
    grid-template-columns: 1fr;
  }
}
