* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-main);
}

#toolbar {
  position: fixed;
  top: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  background: #2b2d31;
  border-bottom: 1px solid #3a3d44;
  z-index: 100;
}

#toolbar button,
#toolbar label {
  background: #3a3d44;
  color: white;
  border: none;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 13px;
}

#toolbar button {
  cursor: pointer;
}

#toolbar button.active {
  background: #6b8cff;
  color: black;
}

#toolbar input, #toolbar select {
  background: #1e1f22;
  color: white;
  border: 1px solid #555;
  border-radius: 4px;
}

#map-container {
  width: 100%;
  height: calc(100vh - 64px);
  background: #111;
}

#map-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.drawn {
  cursor: pointer;
}

text.drawn {
  cursor: move;
  user-select: none;
}

.tool-btn {
  width: 38px;
  height: 38px;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-btn img {
  width: 100%;
  height: 100%;
  filter: invert(90%);
  pointer-events: none;
}

/* активный инструмент */
.tool-btn.active {
  background: #6b8cff;
}

.tool-btn.active img {
  filter: invert(0%);
}

/* ===== TOOLBAR THEME OVERRIDE ===== */

#toolbar {
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border-gold);
  color: var(--text-main);
  font-family: var(--font-main);
}

#toolbar button,
#toolbar label {
  background: var(--bg-control);
  color: var(--text-main);
  font-family: inherit;
  border: 1px solid rgba(212,175,55,0.35);
}

#toolbar input,
#toolbar select {
  background: #000;
  color: var(--text-main);
  border: 1px solid rgba(212,175,55,0.35);
  font-family: inherit;
}

/* активный инструмент */
.tool-btn.active {
  background: var(--border-gold);
  color: #000;
}

.tool-btn.active img {
  filter: none;
}

/* подписи */
.tool-field span {
  color: var(--text-muted);
}
