:root {
  --bg: #e7ebe4;
  --ink: #14170f;
  --muted: #5c6558;
  --line: #c9d0c4;
  --signal: #c45c1a;
  --paper: #f6f7f2;
  --map: #d5ddd4;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "IBM Plex Sans", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
}

button, input {
  font: inherit;
}

.top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.brand {
  margin: 0;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--signal);
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
}

h1 {
  margin: 2px 0 0;
  font-size: 28px;
  line-height: 1.1;
}

.submit-open, .submit-send, .choice, .back {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  padding: 10px 16px;
  cursor: pointer;
}

.submit-open:hover, .submit-send:hover, .choice:hover, .back:hover {
  background: var(--signal);
  border-color: var(--signal);
}

.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  min-height: 0;
}

#map {
  height: 100%;
  min-height: 0;
  background: var(--map);
}

.panel {
  overflow: auto;
  background: var(--paper);
  border-left: 1px solid var(--line);
  padding: 22px 22px 40px;
}

.dek, .field-help, .meta, .empty, .place, .form-error {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.panel h2 {
  margin: 0 0 6px;
  font-size: 26px;
  line-height: 1.15;
}

.list {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
}

.list button {
  width: 100%;
  text-align: left;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  padding: 12px 0;
  cursor: pointer;
}

.list button strong {
  display: block;
  font-size: 16px;
}

.list button span, .status {
  color: var(--muted);
  font-size: 13px;
}

.back {
  margin-bottom: 16px;
  background: transparent;
  color: var(--ink);
}

.clips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.choice {
  background: transparent;
  color: var(--ink);
  padding: 6px 10px;
  font-size: 13px;
}

.choice.active {
  background: var(--ink);
  color: var(--paper);
}

.histogram {
  margin: 18px 0 8px;
}

.histogram h3 {
  margin: 0 0 8px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bar-row {
  display: grid;
  grid-template-columns: 92px 1fr 36px;
  gap: 8px;
  align-items: center;
  margin: 5px 0;
  font-size: 13px;
}

.track {
  height: 10px;
  background: #e4e8df;
  border-radius: 999px;
  overflow: hidden;
}

.track span {
  display: block;
  height: 100%;
  background: var(--ink);
  border-radius: inherit;
}

.possible .meta {
  margin: 0 0 8px;
}

.possible-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.possible-list li {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 8px;
  margin: 5px 0;
  font-size: 13px;
  color: var(--muted);
}

.possible-list li span:first-child {
  color: var(--ink);
}

.hours {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 3px;
  align-items: end;
  height: 88px;
}

.hours i {
  display: block;
  background: #c5cdc0;
  min-height: 2px;
  border-radius: 2px 2px 0 0;
}

.hours i.on {
  background: var(--signal);
}

.hour-labels {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}

.video-wrap {
  margin-top: 18px;
  background: #111;
  aspect-ratio: 16 / 9;
  display: grid;
  place-items: center;
}

.video-wrap iframe, .video-wrap video {
  width: 100%;
  height: 100%;
  border: 0;
}

.video-wrap a {
  color: white;
}

.stills {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.still {
  border: 1px solid var(--line);
  padding: 0;
  background: var(--paper);
  cursor: zoom-in;
  text-align: left;
}

.still img {
  display: block;
  width: 100%;
  height: 78px;
  object-fit: cover;
  background: #d7ddd4;
}

.still span {
  display: block;
  padding: 3px 6px 5px;
  color: var(--muted);
  font-size: 11px;
}

.still-viewer {
  width: min(720px, calc(100% - 28px));
  border: 0;
  border-radius: 12px;
  padding: 12px 12px 16px;
  background: var(--paper);
}

.still-viewer img {
  display: block;
  width: 100%;
  height: auto;
  background: #111;
}

.still-viewer p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.still-viewer::backdrop {
  background: rgba(20, 23, 15, 0.55);
}

.cloud-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--signal);
}

.submit {
  width: min(480px, calc(100% - 28px));
  border: 0;
  border-radius: 16px;
  padding: 0;
  background: var(--paper);
}

.submit::backdrop {
  background: rgba(20, 23, 15, 0.45);
}

.submit form {
  padding: 20px 22px 22px;
}

.submit-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.submit h2 {
  margin: 0;
  font-size: 28px;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

label {
  display: block;
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
}

input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.optional {
  font-weight: 400;
  color: var(--muted);
}

.submit-send {
  margin-top: 16px;
  width: 100%;
}

.submit-send:disabled {
  opacity: 0.6;
  cursor: progress;
}

.form-error {
  color: #8d2b12;
}

.pin {
  background: var(--ink);
  color: white;
  border-radius: 999px;
  min-width: 32px;
  height: 28px;
  padding: 0 9px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  border: 2px solid white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.pin-pending {
  background: transparent;
  color: var(--signal);
  border-color: var(--signal);
  box-shadow: none;
}

.maplibregl-map {
  font-family: var(--sans);
  background: var(--map);
}

.maplibregl-ctrl-attrib {
  font-size: 11px;
}

@media (max-width: 800px) {
  h1 { font-size: 22px; }
  body { height: auto; }
  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: 42vh auto;
    overflow: visible;
  }
  #map { height: 42vh; }
  .panel {
    border-left: 0;
    border-top: 1px solid var(--line);
    position: relative;
    z-index: 2;
  }
}
