:root {
  --bg: #e9ebee;
  --panel: rgba(255, 255, 255, 0.86);
  --border: rgba(30, 40, 55, 0.12);
  --text: #1f2833;
  --muted: #6a7480;
  --accent: #2f6fd6;
  --confirmada: #2e9d5b;
  --inferida: #2f6fd6;
  --estimada: #e08a1e;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
}

#viewport {
  position: fixed;
  inset: 0;
}

#viewport canvas {
  display: block;
}

.toolbar {
  position: fixed;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toolbar > * {
  pointer-events: auto;
}

.brand {
  padding: 6px 10px;
  font-weight: 600;
  font-size: 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  backdrop-filter: blur(6px);
}

.brand span {
  font-weight: 400;
  color: var(--muted);
  margin-left: 4px;
}

.group {
  display: flex;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  backdrop-filter: blur(6px);
}

button {
  font: inherit;
  font-size: 13px;
  padding: 6px 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.group button + button {
  border-left: 1px solid var(--border);
}

button:hover {
  background: rgba(47, 111, 214, 0.08);
}

button.active,
button[aria-pressed='true'] {
  background: var(--accent);
  color: #fff;
}

.reset {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  backdrop-filter: blur(6px);
}

.hint,
.legend,
.avisos {
  position: fixed;
  font-size: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  backdrop-filter: blur(6px);
}

.hint {
  left: 10px;
  bottom: 10px;
  color: var(--muted);
}

.legend {
  right: 10px;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend[hidden],
.avisos[hidden] {
  display: none;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-left: 6px;
}

.dot--confirmada {
  background: var(--confirmada);
}
.dot--inferida {
  background: var(--inferida);
}
.dot--estimada {
  background: var(--estimada);
}

.avisos {
  top: 60px;
  right: 10px;
  max-width: 340px;
  color: #8a3b00;
  border-color: rgba(224, 138, 30, 0.6);
}

/* Etiquetas CSS2D */
.cota {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 4px;
  color: #fff;
  white-space: nowrap;
  pointer-events: auto;
  cursor: help;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.cota--confirmada {
  background: var(--confirmada);
}
.cota--inferida {
  background: var(--inferida);
}
.cota--estimada {
  background: var(--estimada);
}

.wall-label {
  font-size: 12px;
  font-weight: 600;
  color: #3b4652;
  background: rgba(255, 255, 255, 0.75);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.link {
  font-size: 13px;
  padding: 6px 10px;
  color: var(--accent);
  text-decoration: none;
}

.modulo-label {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  color: #fff;
  background: #3b4652;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.modulo-label--equipo {
  font-weight: 600;
  background: #1f5fa8;
}

@media (max-width: 760px) {
  .brand,
  .hint {
    display: none;
  }
  button {
    padding: 6px 7px;
    font-size: 12px;
  }
}
