:root {
  color-scheme: light;
  --bg: #f4f1ea;
  --ink: #171717;
  --muted: #66645d;
  --line: #ddd8cc;
  --panel: #fffdf7;
  --accent: #176b5b;
  --accent-strong: #0f4e42;
  --danger: #9b2c2c;
  --shadow: 0 18px 55px rgb(30 28 22 / 18%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

.app-shell {
  position: relative;
  min-height: 100vh;
}

.map-stage {
  min-height: 100vh;
  position: relative;
}

#map {
  position: absolute;
  inset: 0;
  background: #d6ded6;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
  position: fixed;
  top: 84px;
  right: 22px;
  width: min(380px, calc(100vw - 44px));
  max-height: calc(100vh - 106px);
  padding: 28px;
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  z-index: 700;
}

.side-panel[hidden] {
  display: none;
}

.panel-toggle {
  position: fixed;
  top: 22px;
  right: 22px;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  font-size: 2rem;
  line-height: 1;
  box-shadow: 0 12px 28px rgb(0 0 0 / 24%);
  cursor: pointer;
  z-index: 800;
}

.panel-toggle[aria-expanded="true"] {
  background: var(--ink);
  transform: rotate(45deg);
}

.panel-header {
  display: grid;
  gap: 4px;
}

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

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  font-size: 0.95rem;
}

.drop-zone {
  display: grid;
  gap: 8px;
  justify-items: start;
  padding: 22px;
  border: 1px dashed #b8b09d;
  border-radius: 8px;
  background: #faf6ec;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.password-field {
  display: grid;
  gap: 7px;
}

.password-field span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.password-field input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 11px;
  background: white;
  color: var(--ink);
}

.drop-zone:hover,
.drop-zone.dragging {
  border-color: var(--accent);
  background: #eef6ef;
  transform: translateY(-1px);
}

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

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

.drop-title {
  font-weight: 800;
}

.drop-copy {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.stats div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.stats strong {
  display: block;
  font-size: 1.65rem;
  line-height: 1;
}

.stats span {
  color: var(--muted);
  font-size: 0.8rem;
}

.photo-list-section {
  display: grid;
  gap: 12px;
  min-height: 0;
}

.list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.upload-status {
  color: var(--muted);
  font-size: 0.8rem;
  text-align: right;
}

.delete-button {
  display: grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--danger);
  cursor: pointer;
}

.delete-button:hover {
  border-color: #dca6a6;
  background: #fff4f4;
}

.photo-list {
  display: grid;
  gap: 10px;
}

.photo-list.empty {
  min-height: 140px;
  align-content: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: white;
  line-height: 1.45;
}

.photo-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 82px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.photo-open {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  padding: 0;
  cursor: pointer;
}

.photo-open img {
  width: 66px;
  height: 66px;
  object-fit: cover;
  border-radius: 6px;
  background: #ddd;
}

.photo-item strong,
.photo-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
}

.photo-item.skipped {
  grid-template-columns: 1fr;
  border-color: #ead2d2;
}

.photo-item.skipped span:last-child {
  color: var(--danger);
}

.thumb-marker {
  display: block;
  width: 50px;
  height: 50px;
  padding: 0;
  border: 3px solid white;
  border-radius: 8px;
  background: #111;
  box-shadow: 0 8px 22px rgb(0 0 0 / 30%);
  overflow: hidden;
  line-height: 0;
}

.thumb-marker img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-dialog {
  width: min(900px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  background: #111;
  color: white;
  box-shadow: var(--shadow);
}

.photo-dialog::backdrop {
  background: rgb(10 10 10 / 74%);
}

.photo-dialog img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 110px);
  object-fit: contain;
  background: #111;
}

.dialog-caption {
  display: grid;
  gap: 4px;
  padding: 14px 18px 18px;
}

.dialog-caption span {
  color: #d9d4ca;
  font-size: 0.9rem;
}

.icon-button {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgb(0 0 0 / 68%);
  color: white;
  cursor: pointer;
}

.leaflet-control-attribution {
  font-size: 10px;
}

@media (max-width: 860px) {
  .side-panel {
    top: 82px;
    right: 14px;
    width: calc(100vw - 28px);
    max-height: calc(100vh - 96px);
    padding: 22px;
  }

  .panel-toggle {
    top: 16px;
    right: 16px;
  }
}
