:root {
  color-scheme: dark;
  --bg: #101214;
  --panel: #1a2027;
  --panel-2: #222a34;
  --line: #3a4654;
  --text: #eef2f5;
  --muted: #a8b3bf;
  --accent: #75c7bd;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Segoe UI, system-ui, sans-serif;
}

button,
select,
input {
  font: inherit;
}

button,
select {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 6px;
}

button {
  min-height: 34px;
  padding: 0 12px;
  cursor: pointer;
}

select {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
}

.app {
  display: grid;
  grid-template-columns: 320px 1fr;
  height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  overflow: auto;
}

.topbar h1,
.panel h2,
.mapToolbar h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
}

.topbar {
  display: grid;
  gap: 10px;
}

.panel {
  display: grid;
  gap: 10px;
}

.panelHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panelHeader h2 {
  font-size: 14px;
  color: var(--muted);
  text-transform: uppercase;
}

.miniActions {
  display: flex;
  gap: 6px;
}

.miniActions button {
  min-height: 28px;
  padding: 0 9px;
}

.objectiveList {
  display: grid;
  gap: 6px;
}

.objectiveRow,
.toggleRow,
.fileRow {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
}

.fileRow {
  justify-content: space-between;
}

.fileRow input {
  max-width: 168px;
}

.captureNote {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.objectiveRow {
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
}

.swatch {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.objectiveName {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.objectiveCount {
  color: var(--muted);
  font-size: 12px;
}

.zoomRow {
  display: grid;
  grid-template-columns: 38px 1fr 38px;
  align-items: center;
  gap: 8px;
}

.mapShell {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  min-height: 0;
}

.mapToolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: #13171c;
}

.mapToolbar p {
  margin: 3px 0 0;
  color: var(--muted);
}

#detectSummary {
  color: var(--accent);
}

.mapScroller {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

.mapStage {
  position: relative;
  width: fit-content;
  margin: 0 auto;
  transform-origin: top center;
}

#mapImage {
  display: block;
  max-width: min(100%, 1600px);
  max-height: calc(100vh - 104px);
  width: auto;
  height: auto;
  user-select: none;
}

.dim #mapImage {
  filter: brightness(0.72) saturate(0.95);
}

.markerLayer {
  position: absolute;
  left: 0;
  top: 0;
  pointer-events: none;
}

.marker {
  position: absolute;
  width: 19px;
  height: 19px;
  transform: translate(-50%, -50%);
  border: 2px solid currentColor;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.42);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.62), 0 0 14px currentColor;
}

.marker::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: currentColor;
}

.markerLabel {
  position: absolute;
  left: 13px;
  top: -7px;
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 11px;
  line-height: 16px;
  white-space: nowrap;
}

.hideLabels .markerLabel {
  display: none;
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .sidebar {
    max-height: 38vh;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}
