:root {
  color-scheme: light;
  --bg: #efe6d6;
  --panel: #fffaf1;
  --ink: #2b241d;
  --muted: #75685a;
  --line: #d8c7b2;
  --accent: #6f4b2e;
  --accent-2: #b65f31;
  --accent-3: #456955;
  --soft: #eadcc8;
  --warn: #f5dea9;
  --shadow: 0 20px 55px rgba(68, 47, 29, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  padding-bottom: 38px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  appearance: none;
  -webkit-appearance: none;
}

.shell {
  display: grid;
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  min-height: calc(100vh - 38px);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 22px;
  border-right: 1px solid var(--line);
  background: #f7efe2;
  padding: 24px;
  overflow: auto;
}

.brand,
.topbar,
.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 1.45rem;
}

h2 {
  font-size: 1.2rem;
}

.icon-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
}

.drop-zone,
.sample-button {
  display: flex !important;
  align-items: center;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  border: 1px dashed #b9a58d;
  border-radius: 8px;
  background: var(--soft);
  color: var(--accent);
  font-weight: 800;
  cursor: pointer;
  text-align: center;
  padding: 18px;
}

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

.drop-zone {
  min-height: 132px;
}

.drop-zone.dragging {
  border-color: var(--accent-2);
  background: #f8e8d8;
}

.drop-zone input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}

.sample-button {
  appearance: none;
  -webkit-appearance: none;
  width: 100% !important;
  margin: 0;
  min-height: 88px;
  line-height: 1.2;
}

.sample-button:hover {
  border-color: var(--accent);
  background: #f8e8d8;
}

.sample-button:disabled {
  cursor: default;
  opacity: 0.6;
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-size: 1.5rem;
  line-height: 1;
}

.message {
  min-height: 20px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

label,
.notes-label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  padding: 10px 12px;
}

textarea {
  resize: vertical;
  line-height: 1.45;
}

.list-head span {
  min-width: 34px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  text-align: center;
  padding: 4px 8px;
}

.session-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.session-card {
  display: grid;
  gap: 8px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: inherit;
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.session-card:hover,
.session-card.active {
  border-color: var(--accent);
  box-shadow: 0 8px 22px rgba(111, 75, 46, 0.15);
}

.session-card strong {
  display: block;
  font-size: 1rem;
}

.session-card span {
  color: var(--muted);
  font-size: 0.85rem;
}

.badge {
  justify-self: start;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 8px;
  text-transform: uppercase;
}

.badge.flagged {
  background: var(--warn);
  color: #8a4f00;
}

.workspace {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 24px;
}

.status-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  border-top: 1px solid #bda88f;
  background: #3a2c20;
  color: #f7efe2;
  font-size: 0.84rem;
  padding: 8px 18px;
}

.status-bar strong {
  color: #ffffff;
}

.status-copyright {
  margin-left: auto;
  color: #d7c0a5;
  white-space: nowrap;
}

.status-label {
  border-radius: 999px;
  background: rgba(255, 250, 241, 0.12);
  color: #e6d2b9;
  font-size: 0.72rem;
  font-weight: 850;
  padding: 3px 8px;
  text-transform: uppercase;
}

.topbar {
  margin-bottom: 18px;
}

.status-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.status-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 800;
  padding: 9px 11px;
}

.status-button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.review-actions,
.export-actions {
  display: grid;
  gap: 10px;
}

.review-actions h3,
.export-actions h3 {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.export-button {
  display: flex !important;
  align-items: center;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
  width: 100% !important;
  min-height: 88px;
  border: 1px dashed #b9a58d;
  border-radius: 8px;
  background: var(--soft);
  color: var(--accent);
  cursor: pointer;
  font-weight: 800;
  padding: 18px;
  text-align: center;
}

.export-button:hover {
  border-color: var(--accent);
  background: #f8e8d8;
}

.export-button:disabled {
  border-color: var(--line);
  background: var(--soft);
  color: var(--muted);
  cursor: default;
  opacity: 0.65;
}

.review-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 18px;
  flex: 1;
  min-height: 0;
}

.map-panel,
.detail-panel {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.map-panel {
  position: relative;
  overflow: hidden;
}

.recenter-button {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 500;
  border: 1px solid rgba(32, 37, 39, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 18px rgba(32, 37, 39, 0.14);
  color: var(--ink);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 850;
  padding: 8px 10px;
}

.recenter-button:disabled {
  cursor: default;
  opacity: 0;
  pointer-events: none;
}

.map {
  position: relative;
  height: 100%;
  min-height: 560px;
  overflow: hidden;
  background: #dfe7dd;
  cursor: default;
  user-select: none;
}

.map-tile,
.trail-svg,
.map-attribution,
.point-tooltip {
  position: absolute;
}

.map.leaflet-container,
.map .leaflet-grab,
.map .leaflet-dragging .leaflet-grab,
.map .leaflet-interactive {
  cursor: default;
}

.trail-svg {
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.map-attribution {
  right: 8px;
  bottom: 8px;
  z-index: 2;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.88);
  color: #3f4945;
  font-size: 0.72rem;
  padding: 4px 6px;
  text-decoration: none;
}

.point-tooltip {
  z-index: 3;
  transform: translate(12px, -130%);
  border-radius: 6px;
  background: rgba(32, 37, 39, 0.92);
  color: white;
  font-size: 0.78rem;
  font-weight: 750;
  opacity: 0;
  padding: 6px 8px;
  pointer-events: none;
  transition: opacity 120ms ease;
  white-space: nowrap;
}

.point-tooltip.visible {
  opacity: 1;
}

.trail-line {
  fill: none;
  stroke: var(--accent-2);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 5;
}

.point-marker {
  display: block;
  height: 100%;
  position: relative;
  pointer-events: auto;
  width: 100%;
}

.point-marker-wrapper {
  background: transparent;
  border: 0;
}

.point-marker-wrapper:hover .marker-dot {
  box-shadow: 0 0 0 4px rgba(47, 95, 155, 0.18);
}

.marker-hit-area {
  background: transparent;
  border-radius: 50%;
  inset: 0;
  position: absolute;
}

.marker-dot {
  align-items: center;
  border: 3px solid var(--accent-3);
  border-radius: 50%;
  box-shadow: 0 1px 5px rgba(32, 37, 39, 0.24);
  color: white;
  display: flex;
  fill: white;
  font-size: 0.68rem;
  font-weight: 900;
  height: 22px;
  justify-content: center;
  left: 50%;
  line-height: 1;
  position: absolute;
  stroke: var(--accent-3);
  top: 50%;
  transform: translate(-50%, -50%);
  width: 22px;
}

.point-marker.midpoint .marker-dot {
  background: var(--accent-3);
  border: 2px solid white;
  fill: var(--accent-3);
  height: 10px;
  stroke: white;
  width: 10px;
}

.point-marker.endpoint .marker-dot {
  background: var(--accent);
  border: 3px solid white;
  fill: var(--accent);
  stroke: white;
}

.point-marker text {
  fill: white;
  font-size: 0.68rem;
  font-weight: 900;
  pointer-events: none;
}

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

.empty-map strong {
  color: var(--ink);
}

.detail-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 18px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.metrics article {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.metrics span,
dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.metrics strong {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
}

.metadata {
  display: grid;
  gap: 13px;
  margin: 0;
}

.metadata div {
  display: grid;
  gap: 4px;
}

dd {
  margin: 0;
}

@media (max-width: 980px) {
  .shell,
  .review-layout {
    grid-template-columns: 1fr;
  }

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

  .map {
    min-height: 430px;
  }
}

@media (max-width: 640px) {
  body {
    padding-bottom: 74px;
  }

  .shell {
    min-height: calc(100vh - 74px);
  }

  .sidebar,
  .workspace {
    padding: 16px;
  }

  .topbar,
  .brand {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-button {
    width: 100%;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .status-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
    padding: 7px 12px;
  }

  .status-copyright {
    margin-left: 0;
  }
}
