:root {
  --green: #174734;
  --good: #157347;
  --warn: #9a7600;
  --bad: #b42318;
  --bg: #f3f5f1;
  --card: #ffffff;
  --text: #17211c;
  --muted: #66756d;
  --danger: #9d2626;
  --border: #d9e0dc;
}

* { box-sizing: border-box; }

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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
}

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

.hamburger {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 20;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 16px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
  font-size: 1.55rem;
  font-weight: 900;
  cursor: pointer;
}
.logo-geolab {
  height: 24px;
  width: auto;
  display: block;
}
.gnss-box {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 20;
  min-width: 230px;
  max-width: calc(100vw - 84px);
  padding: .75rem .9rem;
  border-radius: 18px;
  color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  border: 1px solid rgba(255,255,255,.28);
}

.gnss-box strong,
.gnss-box span,
.gnss-box small {
  display: block;
}

.gnss-box strong { font-size: .92rem; }
.gnss-box span { font-size: 1.02rem; font-weight: 850; margin-top: .15rem; }
.gnss-box small { opacity: .94; margin-top: .15rem; }

.gnss-box.waiting { background: #475569; }
.gnss-box.good { background: var(--good); }
.gnss-box.warn { background: var(--warn); }
.gnss-box.bad { background: var(--bad); }

.quick-capture {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  gap: .5rem;
  padding: .45rem;
  border-radius: 20px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 10px 30px rgba(0,0,0,.24);
}

button {
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: .7rem .75rem;
  font-weight: 800;
  cursor: pointer;
  background: #f7faf8;
  color: var(--text);
}

button.primary {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

button.danger {
  background: #fff3f3;
  border-color: #efc5c5;
  color: var(--danger);
}

button.full {
  width: 100%;
}

.side-menu {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  width: min(390px, 92vw);
  height: 100%;
  padding: .9rem;
  background: rgba(255,255,255,.98);
  box-shadow: 12px 0 42px rgba(0,0,0,.24);
  overflow-y: auto;
  transform: translateX(-105%);
  transition: transform .18s ease;
}

.side-menu.open {
  transform: translateX(0);
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(0,0,0,.32);
  display: none;
}

.backdrop.open {
  display: block;
}

.menu-header {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: flex-start;
  margin-bottom: .9rem;
}

.menu-header h1 {
  margin: 0;
  color: var(--green);
  font-size: 1.2rem;
}

.menu-header p {
  margin: .2rem 0 0;
  color: var(--muted);
  font-size: .82rem;
}

#closeMenuBtn {
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 1.5rem;
  border-radius: 14px;
}

details {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fbfcfb;
  padding: .7rem;
  margin-bottom: .65rem;
}

summary {
  cursor: pointer;
  font-weight: 850;
  color: var(--green);
}

label {
  display: block;
  font-weight: 650;
  font-size: .84rem;
  margin: .65rem 0;
}

input, textarea, select {
  display: block;
  width: 100%;
  margin-top: .28rem;
  padding: .65rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  font: inherit;
  background: #fff;
}

textarea { resize: vertical; }

.export-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin-top: .65rem;
}

.category-editor {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .45rem;
  margin-top: .7rem;
}

.category-list {
  margin-top: .7rem;
}

.category-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: .35rem;
  align-items: center;
  padding: .35rem 0;
  border-bottom: 1px solid var(--border);
}

.category-row span {
  font-weight: 700;
}

.category-row button {
  padding: .45rem .55rem;
  font-size: .78rem;
}

.point-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: .75rem;
  margin: .6rem 0;
  background: #fff;
}

.point-card strong { display: block; }
.point-card small {
  display: block;
  color: var(--muted);
  line-height: 1.35;
}

.point-card .mini-buttons {
  display: flex;
  gap: .4rem;
  margin-top: .55rem;
}

.point-card .mini-buttons button {
  padding: .45rem .55rem;
  font-size: .8rem;
}

.gnss-dot {
  width: 18px;
  height: 18px;
  background: #1677ff;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(22,119,255,.35), 0 4px 16px rgba(0,0,0,.35);
}

.gnss-heading {
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 24px solid rgba(22,119,255,.75);
  transform-origin: center bottom;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.35));
}

.point-dot {
  width: 22px;
  height: 22px;
  background: #ffb000;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(0,0,0,.25), 0 4px 14px rgba(0,0,0,.25);
  cursor: grab;
}

.capture-flash {
  position: fixed;
  z-index: 40;
  left: 50%;
  top: 50%;
  width: 44px;
  height: 44px;
  border: 4px solid var(--green);
  border-radius: 999px;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.35);
  pointer-events: none;
}

.capture-flash.run {
  animation: capturePulse .42s ease-out;
}

@keyframes capturePulse {
  0% { opacity: .9; transform: translate(-50%, -50%) scale(.35); }
  70% { opacity: .35; transform: translate(-50%, -50%) scale(3.8); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(5.2); }
}

.help-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0,0,0,.55);
  display: grid;
  place-items: center;
  padding: 1rem;
}

.help-overlay.hidden {
  display: none;
}

.help-card {
  position: relative;
  width: min(620px, 96vw);
  max-height: 86vh;
  overflow: auto;
  background: white;
  border-radius: 22px;
  padding: 1.2rem;
  box-shadow: 0 24px 80px rgba(0,0,0,.35);
}

.help-card h2 {
  margin-top: 0;
  color: var(--green);
}

.help-close {
  position: absolute;
  top: .7rem;
  right: .7rem;
  width: 42px;
  height: 42px;
  padding: 0;
  font-size: 1.5rem;
}

dialog {
  border: none;
  border-radius: 18px;
  padding: 0;
  width: min(560px, calc(100vw - 1rem));
  box-shadow: 0 24px 80px rgba(0,0,0,.3);
}

dialog::backdrop { background: rgba(0,0,0,.45); }

#editForm { padding: 1rem; }
#editForm h2 { margin-top: 0; }

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  margin-top: 1rem;
}

@media (max-width: 760px) {
  .quick-capture {
    left: 10px;
    right: 10px;
    bottom: 10px;
    transform: none;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
  }

  .quick-capture button {
    padding: .65rem .35rem;
    font-size: .78rem;
  }

  .gnss-box {
    top: 12px;
    right: 10px;
    min-width: 190px;
    max-width: calc(100vw - 76px);
    padding: .62rem .7rem;
  }

  .gnss-box span {
    font-size: .92rem;
  }
}


/* ajuste-final-menu-zoom */
.maplibregl-ctrl-top-left {
  top: 68px;
  left: 10px;
}

.maplibregl-ctrl-top-left .maplibregl-ctrl {
  margin-top: 0;
}

.hamburger {
  z-index: 30;
}

@media (max-width: 760px) {
  .maplibregl-ctrl-top-left {
    top: 68px;
    left: 10px;
  }
}
