:root {
  --bg: #07100d;
  --panel: #101817;
  --panel-soft: #17211f;
  --line: rgba(232, 245, 237, 0.12);
  --text: #eef8f2;
  --muted: #95aaa0;
  --green: #48bb78;
  --gold: #c8963e;
  --danger: #ff6b5f;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body, #app {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

button, input, select {
  border: 0;
  border-radius: 8px;
  font: inherit;
  min-height: 38px;
}

button {
  background: rgba(72, 187, 120, 0.14);
  color: var(--green);
  cursor: pointer;
  font-weight: 900;
  padding: 0 12px;
}

input, select {
  background: #0b1210;
  border: 1px solid var(--line);
  color: var(--text);
  padding: 0 10px;
  width: 100%;
}

.shell {
  height: 100%;
}

.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  left: 50%;
  padding: 28px;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, calc(100vw - 32px));
}

.login-panel h1,
.sidebar h1 {
  font-size: 2rem;
  line-height: 1;
  margin: 0;
}

.login-panel form {
  display: grid;
  gap: 12px;
}

.login-panel label,
.coords-form label {
  color: var(--muted);
  display: grid;
  gap: 7px;
  font-size: 0.82rem;
  font-weight: 900;
}

.eyebrow {
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0;
  margin: 0;
  text-transform: uppercase;
}

.error {
  color: var(--danger);
  font-weight: 850;
  margin: 0;
}

.atlas {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  height: 100%;
}

.sidebar {
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: grid;
  gap: 18px;
  grid-template-rows: auto auto auto minmax(0, 0.7fr) minmax(0, 1fr) auto;
  min-height: 0;
  padding: 18px;
}

.dimension-tabs,
.coords-form,
.marker-form {
  display: grid;
  gap: 8px;
}

.dimension-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dimension-tabs button.active {
  background: var(--green);
  color: #07100d;
}

.coords-form {
  grid-template-columns: 1fr 1fr;
}

.coords-form button {
  grid-column: 1 / -1;
}

.section-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.section-header h2 {
  font-size: 1rem;
  margin: 0;
}

.list {
  display: grid;
  gap: 8px;
  max-height: 100%;
  overflow: auto;
  padding-right: 2px;
}

.item {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 3px;
  padding: 10px;
}

.item span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

footer {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  padding-top: 12px;
}

footer small,
#status-text,
#zoom-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.map-wrap {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
}

.map-toolbar {
  align-items: center;
  background: rgba(7, 16, 13, 0.9);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
}

.map {
  background:
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px),
    #0a1411;
  background-size: 64px 64px;
  overflow: hidden;
  position: relative;
}

#rendered-map {
  background: #0a1411;
  border: 0;
  height: 100%;
  inset: 0;
  position: absolute;
  width: 100%;
}

.map-empty {
  align-content: center;
  color: var(--muted);
  display: grid;
  gap: 8px;
  height: 100%;
  justify-items: center;
  padding: 24px;
  text-align: center;
}

.map-empty strong {
  color: var(--text);
  font-size: 1.1rem;
}

.crosshair {
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: 999px;
  height: 18px;
  left: 50%;
  pointer-events: none;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 18px;
}

@media (max-width: 860px) {
  .atlas {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-bottom: 1px solid var(--line);
    border-right: 0;
    grid-template-rows: none;
    max-height: 46vh;
    overflow: auto;
  }
}
