/* Heart Shaped Sightings
 *
 * Four seasonal palettes. The admin picks one and it applies site-wide; the
 * season lands on <html data-season="..."> and everything below reads tokens,
 * never literals. The accent stays in the red family in every season, because
 * the pins are hearts and an olive heart stops being one.
 *
 * JS reads these same tokens with getComputedStyle, so the canvas heart icon
 * and the map cluster colours cannot drift out of step with the CSS. */

/* Spring: new growth, not blossom. The neutrals lean green so the rose
   accent is the only warm thing on screen and reads as a pop rather than as
   more of the same. Pink on pink was the mistake first time round. */
:root,
:root[data-season="spring"] {
  --ink:          #22281f;
  --ink-soft:     #5f6b5a;
  --line:         #e3ead8;
  --bg:           #fafcf6;
  --card:         #ffffff;
  --accent:       #e8427e;
  --accent-deep:  #c22a62;
  --accent-pale:  #fdeaf2;
  --photo:        #e9f0e1;
  --cluster-1:    #f9c6d8;
  --cluster-2:    #f083ae;
  --cluster-3:    #e04a85;
}

:root[data-season="summer"] {
  --ink:          #1b2616;
  --ink-soft:     #5d6d53;
  --line:         #e9e8cf;
  --bg:           #fffdf3;
  --card:         #ffffff;
  --accent:       #f0513c;
  --accent-deep:  #c83b28;
  --accent-pale:  #fdece8;
  --photo:        #f7ecd9;
  --cluster-1:    #f8b49f;
  --cluster-2:    #f27a5e;
  --cluster-3:    #e04a2e;
}

:root[data-season="autumn"] {
  --ink:          #241a12;
  --ink-soft:     #6f5a46;
  --line:         #ebdecd;
  --bg:           #fdf8f1;
  --card:         #fffdfa;
  --accent:       #c8431f;
  --accent-deep:  #9c3314;
  --accent-pale:  #fae9e0;
  --photo:        #f3e4d2;
  --cluster-1:    #e8b08c;
  --cluster-2:    #d9793f;
  --cluster-3:    #b9521f;
}

/* Winter: cold blues carrying everything, one crimson for the hearts. The
   blue has to stay in the neutrals and the clusters, or the season stops
   being winter and turns into a second spring. */
:root[data-season="winter"] {
  --ink:          #16222e;
  --ink-soft:     #5c6e7e;
  --line:         #dde8f0;
  --bg:           #f7fafd;
  --card:         #ffffff;
  --accent:       #d2335a;
  --accent-deep:  #a51f41;
  --accent-pale:  #fbe9ed;
  --photo:        #e6eef5;
  --cluster-1:    #d2e2ee;
  --cluster-2:    #9cbdd6;
  --cluster-3:    #6792b3;
}

:root {
  --radius:     14px;
  --gutter:     16px;
  --shadow:     0 1px 2px rgba(27, 20, 24, .06), 0 8px 24px rgba(27, 20, 24, .07);
  --topbar-h:   56px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body { display: flex; flex-direction: column; }
body.no-scroll { overflow: hidden; }

a { color: inherit; }

/* --- Top bar ------------------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--topbar-h);
  padding: 0 16px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
/* The mark is a photographic cutout now, not a drawn path, so it takes a
   size rather than a fill. It keeps its own deep red in every season,
   which is correct: it is the logo, not a themed element. */
.brand-mark { width: 26px; height: 23px; object-fit: contain; flex: 0 0 auto; }
.brand-name { font-weight: 650; letter-spacing: -.01em; white-space: nowrap; }

.tabs { display: flex; gap: 4px; margin-left: auto; background: var(--accent-pale); padding: 3px; border-radius: 999px; }

.tab {
  border: 0;
  background: transparent;
  padding: 6px 18px;
  border-radius: 999px;
  font: inherit;
  font-weight: 550;
  color: var(--ink-soft);
  cursor: pointer;
}
.tab.is-on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(27,20,24,.1); }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  padding: 8px 16px;
  border-radius: 999px;
  font: inherit;
  font-weight: 550;
  text-decoration: none;
  cursor: pointer;
}
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }

main { flex: 1 1 auto; min-height: 0; position: relative; }
.view { position: absolute; inset: 0; }
.view[hidden] { display: none; }

/* --- Map ----------------------------------------------------------------- */

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

.map-chrome {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
  z-index: 10;
}
.map-chrome > * { pointer-events: auto; }

.count-pill {
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 550;
  color: var(--ink-soft);
  box-shadow: var(--shadow);
}

.surprise { box-shadow: var(--shadow); }

.map-status {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(255, 250, 251, .9);
  text-align: center;
  padding: 24px;
  z-index: 15;
}
.map-status[hidden] { display: none; }

/* Popup ------------------------------------------------------------------- */

.maplibregl-popup-content {
  padding: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  /* No max-height and no scrolling here. A scrollable box sitting over the
     map swallows the wheel, so scrolling to zoom with a popup open scrolled
     the popup instead and the map stuttered. The image cap below keeps the
     popup short enough that it never needed to scroll anyway. */
  overflow: hidden;
}
.maplibregl-popup-close-button { font-size: 20px; padding: 2px 8px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.5); }

.pop { width: 300px; }
.pop-img {
  display: block;
  width: 100%;
  /* home.js sets aspect-ratio inline from the stored dimensions. This caps
     how tall that can get: a 9:16 photo would run to 530px here, which leaves
     no room for anything underneath. Cropped in the popup, full shape in the
     lightbox. */
  max-height: 280px;
  object-fit: cover;
  cursor: zoom-in;
  background: var(--accent-pale);
}
.pop-caption { margin: 12px 14px 5px; font-size: 14.5px; line-height: 1.42; }
.pop-sub { display: flex; flex-wrap: wrap; gap: 9px; margin: 0 14px 10px; font-size: 12.5px; color: var(--ink-soft); }
.pop .heart-btn { margin: 0 14px 14px; }

@media (max-width: 640px) {
  /* Leave room for the map either side, so it still reads as a pin on a map
     rather than a card covering one. */
  .pop { width: min(300px, calc(100vw - 72px)); }
  .pop-img { max-height: 240px; }
}

/* --- Feed ---------------------------------------------------------------- */

.view-feed { overflow-y: auto; -webkit-overflow-scrolling: touch; }

.feed-head {
  position: sticky;
  top: 0;
  background: var(--bg);
  box-shadow: 0 8px 12px -8px var(--bg);
  padding: 16px 16px 12px;
  z-index: 5;
}

.sorts { display: flex; gap: 4px; background: var(--accent-pale); padding: 3px; border-radius: 999px; width: fit-content; margin: 0 auto; }
.sort-btn { border: 0; background: transparent; padding: 5px 18px; border-radius: 999px; font: inherit; font-weight: 550; font-size: 14px; color: var(--ink-soft); cursor: pointer; }
.sort-btn.is-on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(27,20,24,.1); }

/* Masonry. Columns are real elements and home.js drops each card into the
   shortest one, so cards never reshuffle as more pages load. */
.feed-list {
  display: flex;
  align-items: flex-start;
  gap: var(--gutter);
  padding: 0 16px 48px;
}

.masonry-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gutter);
}

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }

.card-img {
  display: block;
  width: 100%;
  height: auto;
  cursor: zoom-in;
  background: var(--accent-pale);
}

.card-body { padding: 14px 16px 16px; }
.card-caption { margin: 0 0 8px; line-height: 1.45; overflow-wrap: anywhere; }
.card-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-soft); }
.card-handle { color: var(--accent); text-decoration: none; font-weight: 550; }
.card-handle:hover { text-decoration: underline; }
.card-actions { margin-top: 12px; }

.feed-note { text-align: center; color: var(--ink-soft); padding: 24px 16px 48px; margin: 0; }
.feed-note[hidden] { display: none; }
#feed-sentinel { height: 1px; }

/* --- Heart button -------------------------------------------------------- */

.heart-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 6px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.heart-btn svg { fill: none; stroke: currentColor; stroke-width: 2; transition: fill .15s; }
.heart-btn:hover { border-color: var(--accent); color: var(--accent); }
.heart-btn.is-on { color: var(--accent); border-color: var(--accent); background: var(--photo); }
.heart-btn.is-on svg { fill: var(--accent); stroke: var(--accent); }
.heart-btn:disabled { opacity: .75; cursor: default; }
.heart-btn.is-pulsing svg { animation: pop .4s ease; }

@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .heart-btn.is-pulsing svg { animation: none; } }

/* --- Lightbox ------------------------------------------------------------ */
/* The photo is the point. No card, no border, no second background: the image
   sits on the dark backdrop and the caption floats beneath it. */

.lb {
  position: fixed;
  inset: 0;
  background: rgba(14, 10, 13, .9);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 48px);
  z-index: 100;
  overflow-y: auto;
  animation: lb-in .18s ease-out;
}
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .lb { animation: none; } }

.lb-figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  max-width: min(1100px, 100%);
  margin: auto;
}

.lb-img {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  width: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
  /* The thumbnail paints first and is upscaled, so it is blurred until the
     full image lands. Without this the swap is a visible jolt. */
  filter: blur(6px);
  transition: filter .25s ease-out;
}
.lb-img.is-sharp { filter: none; }
@media (prefers-reduced-motion: reduce) { .lb-img { transition: none; } }

.lb-meta { max-width: 640px; text-align: center; color: #fff; }
.lb-caption {
  margin: 0 0 8px;
  font-size: 16.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.lb-sub {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  font-size: 13px;
  color: rgba(255, 255, 255, .62);
  margin-bottom: 14px;
}
.lb-handle { color: #fff; text-decoration: none; font-weight: 550; }
.lb-handle:hover { text-decoration: underline; }
.lb-handle.is-anon { color: rgba(255, 255, 255, .62); font-weight: 400; }

.lb-actions { display: flex; justify-content: center; }
/* The heart has to read against the dark, not against a card. */
.lb .heart-btn {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .25);
  color: #fff;
}
.lb .heart-btn:hover { border-color: #fff; background: rgba(255, 255, 255, .18); }
.lb .heart-btn.is-on { background: var(--accent); border-color: var(--accent); color: #fff; }
.lb .heart-btn.is-on svg { fill: #fff; stroke: #fff; }

.lb-close {
  position: fixed;
  top: max(14px, env(safe-area-inset-top, 0px));
  right: max(14px, env(safe-area-inset-right, 0px));
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.lb-close:hover { background: rgba(255, 255, 255, .22); }

@media (max-width: 640px) {
  .lb { padding: 14px; }
  .lb-img { max-height: 64vh; }
  .lb-caption { font-size: 15px; }
}

/* --- Footer -------------------------------------------------------------- */

.footer {
  flex: 0 0 auto;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  background: var(--card);
}
.footer a { color: var(--ink-soft); text-decoration: none; }
.footer a:hover { color: var(--accent); }
.dot { margin: 0 8px; opacity: .5; }

/* --- Small screens ------------------------------------------------------- */

@media (max-width: 640px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .brand-name { display: none; }
  .add-btn { padding: 8px 12px; font-size: 14px; }
  .tabs { margin-left: 0; }
  .map-chrome { left: 12px; right: 12px; }

  /* Two narrow columns on a phone, so everything inside a card has to shrink
     with them or the text crowds the image out. */
  .feed-list { padding: 0 10px 40px; gap: 10px; }
  .masonry-col { gap: 10px; }
  .card { border-radius: 10px; }
  .card-body { padding: 9px 10px 11px; }
  .card-caption { font-size: 13px; line-height: 1.35; margin-bottom: 5px; }
  .card-sub { font-size: 11px; gap: 6px; }
  .card-actions { margin-top: 8px; }
  .heart-btn { padding: 4px 10px; font-size: 12px; gap: 5px; }
  .feed-head { padding: 12px 10px 10px; }
  /* Thumb reach: Surprise me sits bottom right. */
  .surprise { margin-left: auto; }
  .footer { display: none; }
}

/* =========================================================================
   Submission form (submit.html)
   ========================================================================= */

/* index.html pins the map to the viewport. This page scrolls normally. */
.page-form { height: auto; min-height: 100%; }
.page-form main { position: static; flex: 1 1 auto; }

.back-btn { margin-left: auto; }

.form-wrap { max-width: 620px; margin: 0 auto; padding: 28px 16px 64px; }
.form-title { margin: 0 0 4px; font-size: 26px; letter-spacing: -.02em; }
.form-intro { margin: 0 0 28px; color: var(--ink-soft); }

.field { margin-bottom: 28px; }

.label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}
.sublabel {
  display: block;
  font-size: 13px;
  font-weight: 550;
  color: var(--ink-soft);
  margin: 16px 0 6px;
}
.optional { font-weight: 400; color: var(--ink-soft); font-size: 13px; }

.input {
  display: block;
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}
.input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-pale);
}
textarea.input { resize: vertical; min-height: 78px; line-height: 1.45; }

.field-foot { display: flex; justify-content: space-between; gap: 12px; margin-top: 6px; }
.hint { font-size: 12.5px; color: var(--ink-soft); margin: 6px 0 0; }
.hint.center { text-align: center; }
.counter { font-size: 12.5px; color: var(--ink-soft); flex: 0 0 auto; font-variant-numeric: tabular-nums; }

.err { color: var(--accent-deep); font-size: 13px; margin: 8px 0 0; font-weight: 550; }
.err[hidden] { display: none; }
.err.center { text-align: center; }

.linkish {
  border: 0; background: none; padding: 0;
  font: inherit; font-weight: 600; color: var(--accent);
  text-decoration: underline; cursor: pointer;
}

/* --- Photo --------------------------------------------------------------- */

.drop {
  border: 1.5px dashed var(--line);
  border-radius: var(--radius);
  background: var(--card);
  padding: 26px 20px;
  text-align: center;
  transition: border-color .15s, background .15s;
}
.drop.is-over { border-color: var(--accent); background: var(--photo); }

.drop-icon { width: 30px; height: 30px; color: var(--accent); margin-bottom: 6px; }
.drop-text { margin: 0; font-size: 15px; }
.drop-empty[hidden], .drop-preview[hidden] { display: none; }

.preview-img {
  display: block;
  max-width: 100%;
  max-height: 320px;
  margin: 0 auto 12px;
  border-radius: 10px;
  background: var(--accent-pale);
}
.btn-small { padding: 5px 12px; font-size: 13px; }

/* --- Location ------------------------------------------------------------ */

.loc-actions { display: flex; }
.loc-actions .btn { width: 100%; justify-content: center; }
.btn-icon { flex: 0 0 auto; }

/* A rule with the word sitting in the gap. */
.loc-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 4px;
  color: var(--ink-soft);
  font-size: 13px;
}
.loc-or::before, .loc-or::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--line);
}

.search-wrap { position: relative; }

.results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 30;
  max-height: 260px;
  overflow-y: auto;
}
.results[hidden] { display: none; }
.result { padding: 9px 11px; border-radius: 7px; cursor: pointer; font-size: 14px; }
.result:hover { background: var(--photo); }

.paste-row { display: flex; gap: 8px; }
.paste-row .input { flex: 1 1 auto; }
.paste-row .btn { flex: 0 0 auto; }

.pin-hint { margin-top: 18px; }

.mini-map {
  height: 280px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  margin-top: 8px;
}
/* Until a location is chosen the pin is parked at the default centre and means
   nothing, so it is dimmed to avoid reading as a real choice. */
.pin-marker { opacity: .4; transition: opacity .2s; cursor: grab; }
.mini-map.is-set .pin-marker { opacity: 1; }
.pin-marker:active { cursor: grabbing; }

/* --- Handle -------------------------------------------------------------- */

.handle-wrap { position: relative; }
.handle-at {
  position: absolute;
  left: 13px; top: 50%;
  transform: translateY(-50%);
  color: var(--ink-soft);
  pointer-events: none;
}
.input-handle { padding-left: 27px; }

/* --- Consent, honeypot, submit ------------------------------------------ */

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.45; cursor: pointer; }
.check input { margin-top: 3px; flex: 0 0 auto; width: 17px; height: 17px; accent-color: var(--accent); }

/* Off-screen rather than display:none. A bot that skips hidden inputs would
   skip the trap, which defeats the point. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

.turnstile { margin: 0 0 16px; min-height: 65px; }

.btn-go {
  width: 100%;
  justify-content: center;
  padding: 13px;
  font-size: 16px;
}
.btn-go:disabled { opacity: .45; cursor: not-allowed; }
.btn-go:disabled:hover { background: var(--accent); border-color: var(--accent); }

/* --- Done ---------------------------------------------------------------- */

.done { text-align: center; padding: 56px 16px; }
.done[hidden] { display: none; }
.done-mark { width: 50px; height: 50px; fill: var(--accent); }
.done h2 { margin: 14px 0 8px; font-size: 24px; }
.done p { color: var(--ink-soft); margin: 0 auto 26px; max-width: 420px; }
.done-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 640px) {
  .form-wrap { padding: 20px 14px 48px; }
  .form-title { font-size: 22px; }
  .mini-map { height: 240px; }
  .page-form .footer { display: block; }
}

/* =========================================================================
   Admin panel (admin.html)
   ========================================================================= */

.page-admin { height: auto; min-height: 100%; }
.page-admin main { position: static; flex: 1 1 auto; }

.admin-head-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.who { font-size: 13px; color: var(--ink-soft); }

.admin-wrap { max-width: 780px; margin: 0 auto; padding: 24px 16px 64px; width: 100%; }

/* --- Sign in ------------------------------------------------------------- */

.auth { max-width: 380px; margin: 48px auto; }
.auth[hidden] { display: none; }
.auth-form { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.auth-form .btn { justify-content: center; }

/* --- Tabs ---------------------------------------------------------------- */

.admin-tabs { margin: 0 auto 22px; width: fit-content; }
.tab-count {
  display: inline-block;
  min-width: 19px;
  padding: 0 5px;
  margin-left: 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  line-height: 19px;
  text-align: center;
  vertical-align: 1px;
}
.tab-count:empty { display: none; }

/* --- Toolbar ------------------------------------------------------------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 18px;
}

.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; flex: 1 1 420px; }
.f-field { display: flex; flex-direction: column; gap: 4px; }
.f-grow { flex: 1 1 180px; min-width: 0; }
.f-label {
  font-size: 11px; font-weight: 650; letter-spacing: .06em;
  text-transform: uppercase; color: var(--ink-soft);
}
.input-sm { padding: 6px 10px; font-size: 13.5px; border-radius: 8px; }
select.input-sm { padding-right: 26px; }
.f-clear { align-self: flex-end; }

.views { display: flex; gap: 3px; background: var(--accent-pale); padding: 3px; border-radius: 999px; }
.view-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: transparent; color: var(--ink-soft);
  border-radius: 999px; padding: 5px 12px;
  font: inherit; font-size: 13px; font-weight: 550; cursor: pointer;
}
.view-btn svg { width: 14px; height: 14px; fill: currentColor; }
.view-btn.is-on { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(27,20,24,.1); }

/* --- One post ------------------------------------------------------------ */
/* One card builder, three presentations. The list carries data-view and the
   rules below reshape the same markup, so there is no second render path to
   keep in step. */

.admin-list { display: grid; gap: 18px; }

.adm {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.adm-head { display: flex; flex-direction: column; }
.adm-thumb { background: var(--photo); }
.adm-img { display: block; width: 100%; height: 100%; object-fit: contain; }
.adm-img.is-missing { min-height: 120px; }

.adm-sum { padding: 12px 15px 0; }
.adm-sum-cap { margin: 0 0 7px; line-height: 1.4; overflow-wrap: anywhere; }

.adm-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 9px;
  font-size: 12.5px; color: var(--ink-soft);
}
.adm-pill {
  padding: 2px 9px; border-radius: 999px;
  background: var(--accent-pale); color: var(--accent-deep);
  font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: .04em;
}
.adm-pill[data-status="published"] { background: #e7f3ea; color: #2c6b41; }
.adm-pill[data-status="rejected"]  { background: #f2eeec; color: #70605a; }

.adm-detail { padding: 4px 15px 16px; }
.adm-coords {
  font-size: 12px; color: var(--ink-soft);
  font-variant-numeric: tabular-nums; margin: 8px 0 2px;
}
.adm .sublabel { margin: 12px 0 5px; }
.adm .input { font-size: 14px; }
.adm-save { margin-top: 10px; }

.adm-map {
  height: 260px; margin-top: 14px;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
.adm-map[hidden] { display: none; }
/* The form dims its pin until a location is chosen. Here it is always real. */
.adm-map .pin-marker { opacity: 1; }

.input-reason { margin-top: 14px; font-size: 13px; }

.adm-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--line);
}

.btn-danger { color: var(--accent-deep); border-color: var(--line); }
.btn-danger:hover { background: var(--accent-pale); border-color: var(--accent); }

/* Second click of a two-step confirm. Loud on purpose. */
.btn.is-armed { background: var(--accent-deep); border-color: var(--accent-deep); color: #fff; }

.adm-status { margin-top: 10px; font-size: 13px; color: var(--ink-soft); min-height: 18px; }
.adm-status.is-bad { color: var(--accent-deep); font-weight: 550; }

/* Detail: everything open, photo big enough to actually judge. */
.admin-list[data-view="detail"] .adm-img { max-height: 440px; }

/* Grid: tiles to scan. The body opens on click. */
.admin-list[data-view="grid"] {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  align-items: start;
}
.admin-list[data-view="grid"] .adm-head { cursor: pointer; }
.admin-list[data-view="grid"] .adm-thumb { aspect-ratio: 4 / 3; }
.admin-list[data-view="grid"] .adm-img { object-fit: cover; }
.admin-list[data-view="grid"] .adm-sum { padding: 10px 12px 12px; }
.admin-list[data-view="grid"] .adm-sum-cap {
  font-size: 13.5px;
  /* Two lines, so tiles stay the same height and the grid reads as a grid. */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.admin-list[data-view="grid"] .adm-meta { font-size: 11.5px; gap: 7px; }
.admin-list[data-view="grid"] .adm-detail { display: none; padding: 0 12px 14px; }
.admin-list[data-view="grid"] .adm.is-open .adm-detail { display: block; }

/* Rows: the densest view, for working through a long queue. */
.admin-list[data-view="rows"] { gap: 9px; }
.admin-list[data-view="rows"] .adm-head { flex-direction: row; align-items: center; gap: 13px; cursor: pointer; }
.admin-list[data-view="rows"] .adm-thumb {
  width: 74px; height: 74px; flex: 0 0 auto;
  border-radius: 9px; overflow: hidden; margin: 9px 0 9px 10px;
}
.admin-list[data-view="rows"] .adm-img { object-fit: cover; }
.admin-list[data-view="rows"] .adm-sum { padding: 0 14px 0 0; min-width: 0; flex: 1 1 auto; }
.admin-list[data-view="rows"] .adm-sum-cap {
  margin-bottom: 5px; font-size: 14px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.admin-list[data-view="rows"] .adm-detail { display: none; }
.admin-list[data-view="rows"] .adm.is-open .adm-detail { display: block; }

/* --- Season picker (admin) ----------------------------------------------- */

.season-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.ctl-label {
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.season-row { display: flex; flex-wrap: wrap; gap: 6px; }

.season-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 5px 13px 5px 7px;
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  text-transform: capitalize;
  cursor: pointer;
}
.season-btn:hover { border-color: var(--accent); color: var(--ink); }
.season-btn.is-on { border-color: var(--accent); color: var(--ink); background: var(--accent-pale); }

/* Each swatch shows its own season's accent, not the active one, so the row
   reads as four choices rather than four copies of the current palette. */
.season-swatch {
  width: 15px; height: 15px;
  border-radius: 50%;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.season-swatch[data-season="spring"] { background: #e8427e; }
.season-swatch[data-season="summer"] { background: #f0513c; }
.season-swatch[data-season="autumn"] { background: #c8431f; }
.season-swatch[data-season="winter"] { background: #d2335a; }

.season-note { font-size: 12.5px; color: var(--ink-soft); margin-left: auto; }
.season-note.is-bad { color: var(--accent-deep); font-weight: 550; }

@media (max-width: 640px) {
  .season-note { margin-left: 0; width: 100%; }
}

/* =========================================================================
   Plain document pages (privacy.html)
   ========================================================================= */

.page-doc { height: auto; min-height: 100%; }
.page-doc main { position: static; flex: 1 1 auto; }

.doc {
  max-width: 660px;
  margin: 0 auto;
  padding: 32px 18px 72px;
  font-size: 15.5px;
  line-height: 1.62;
}
.doc h1 { font-size: 28px; letter-spacing: -.02em; margin: 0 0 6px; }
.doc-lede { color: var(--ink-soft); margin: 0 0 30px; }

.doc h2 {
  font-size: 18px;
  letter-spacing: -.01em;
  margin: 34px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.doc h3 { font-size: 15px; margin: 22px 0 6px; }
.doc p { margin: 0 0 13px; }
.doc ul { margin: 0 0 13px; padding-left: 20px; }
.doc li { margin-bottom: 7px; }
.doc strong { font-weight: 650; }

/* The unfilled-placeholders warning. Deliberately hard to miss, and meant to
   be deleted along with the placeholders. */
.doc-flag {
  background: var(--accent-pale);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 11px 14px;
  margin-bottom: 26px;
}

.doc-date { color: var(--ink-soft); font-size: 14px; margin-top: 18px; }

@media (max-width: 640px) {
  .doc { padding: 24px 16px 56px; font-size: 15px; }
  .doc h1 { font-size: 24px; }
  .page-doc .footer { display: block; }
}

/* The line under the submit button doubles as the reason it is disabled. */
.hint.is-blocking { color: var(--accent-deep); font-weight: 550; }
.turnstile.is-failed { min-height: 0; }
.turnstile.is-failed .err { margin: 0 0 4px; }

/* Sign-in alternatives under the password form. */
.auth .sublabel:first-of-type { margin-top: 0; }
.auth-alt {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 14px;
  font-size: 13.5px;
  color: var(--ink-soft);
}
.auth-alt .linkish { font-weight: 550; font-size: 13.5px; }

/* =========================================================================
   Heart spray and welcome
   ========================================================================= */

.heart-host { position: relative; display: inline-flex; }

/* The hearts sit in a layer that ignores the mouse, so they can never block
   the click they are decorating. overflow stays visible because they travel
   well outside the button's box. */
.spray { position: absolute; inset: 0; pointer-events: none; }

.spray i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--s);
  height: var(--s);
  margin: calc(var(--s) / -2);
  opacity: 0;
  will-change: transform, opacity;
}
.spray i img { width: 100%; height: 100%; display: block; object-fit: contain; }

/* Hover: drift up and hold. */
.heart-host.is-hover .spray i {
  animation: spray-rise .42s cubic-bezier(.22, 1, .36, 1) forwards;
  animation-delay: var(--d);
}
@keyframes spray-rise {
  0%   { opacity: 0; transform: translate(0, 10px) scale(.4) rotate(0deg); }
  60%  { opacity: 1; }
  100% { opacity: 1; transform: translate(var(--x), var(--y)) scale(1) rotate(var(--r)); }
}

/* Click: let go and fall. */
.heart-host.is-drop .spray i {
  animation: spray-fall .6s cubic-bezier(.4, 0, .8, 1) forwards;
  animation-delay: var(--d2);
}
@keyframes spray-fall {
  0%   { opacity: 1; transform: translate(var(--x), var(--y)) scale(1) rotate(var(--r)); }
  100% { opacity: 0; transform: translate(calc(var(--x) * 1.25), 76px) scale(.65)
                               rotate(calc(var(--r) + 50deg)); }
}

@media (prefers-reduced-motion: reduce) {
  .heart-host.is-hover .spray i,
  .heart-host.is-drop .spray i { animation: none; opacity: 0; }
}

/* --- Welcome ------------------------------------------------------------- */

.welcome {
  position: fixed;
  inset: 0;
  background: rgba(14, 10, 13, .5);
  backdrop-filter: blur(3px);
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-left, 0px));
  z-index: 200;
  animation: welcome-in .2s ease-out;
}
@keyframes welcome-in { from { opacity: 0; } to { opacity: 1; } }

.welcome-card {
  background: var(--card);
  border-radius: 18px;
  padding: 32px 26px 24px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .3);
  animation: welcome-pop .26s cubic-bezier(.22, 1, .36, 1);
}
@keyframes welcome-pop {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .welcome, .welcome-card { animation: none; }
}

.welcome-logo { width: 78px; height: 69px; object-fit: contain; margin-bottom: 12px; }
.welcome-title { font-size: 21px; letter-spacing: -.01em; margin: 0 0 6px; }
.welcome-sub { margin: 0 0 20px; color: var(--ink-soft); font-size: 14.5px; line-height: 1.5; }

.welcome-actions { display: flex; flex-direction: column; gap: 9px; }
.welcome-actions .btn { justify-content: center; width: 100%; }

.welcome-ig {
  display: inline-block;
  margin-top: 16px;
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: none;
}
.welcome-ig b { color: var(--accent); font-weight: 600; }
.welcome-ig:hover b { text-decoration: underline; }

/* The spray wraps the button, so layout rules that positioned the button now
   have to act on the wrapper instead. */
.map-chrome > .heart-host { pointer-events: auto; }
@media (max-width: 640px) {
  .map-chrome .heart-host { margin-left: auto; }
  .surprise { margin-left: 0; }
  .welcome-card { padding: 26px 20px 20px; }
  .welcome-logo { width: 66px; height: 58px; }
}

/* Wrapping a button changes who the layout rules apply to, so the full-width
   and flex cases have to be handed down to the wrapper. */
.form > .heart-host { width: 100%; }          /* Send it in */
.loc-actions > .heart-host { flex: 1 1 auto; } /* Use my current location */
.done-actions > .heart-host { display: inline-flex; }

/* --- Admin counters ------------------------------------------------------ */

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}
.stat {
  flex: 1 1 150px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 16px;
}
.stat-n {
  display: block;
  font-size: 26px;
  font-weight: 650;
  letter-spacing: -.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--accent-deep);
}
.stat-l {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* --- Custom palette editor ----------------------------------------------- */

/* The custom swatch cannot show one colour, so it shows the idea of choosing
   one. */
.season-swatch[data-season="custom"] {
  background: conic-gradient(#e8427e, #f0513c, #c8431f, #d2335a, #6792b3, #e8427e);
}

.custom-editor {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}
.custom-editor[hidden] { display: none; }

.custom-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.custom-title { font-size: 16px; margin: 0; margin-right: auto; }

.custom-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.sw-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 9px;
  border: 1px solid var(--line);
}

/* Browsers draw their own chrome on a colour input; strip it back to a chip. */
.sw-color {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: none;
  cursor: pointer;
}
.sw-color::-webkit-color-swatch-wrapper { padding: 2px; }
.sw-color::-webkit-color-swatch { border: 0; border-radius: 6px; }
.sw-color::-moz-color-swatch { border: 0; border-radius: 6px; }

.sw-text { flex: 1 1 auto; min-width: 0; }
.sw-label { display: block; font-size: 13px; font-weight: 600; }
.sw-hint { display: block; font-size: 11px; color: var(--ink-soft); }

.sw-hex-in {
  width: 88px;
  flex: 0 0 auto;
  font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace;
  text-transform: lowercase;
}

.sw-divider {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.custom-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.custom-actions .season-note { margin-left: auto; }

@media (max-width: 640px) {
  .custom-grid { grid-template-columns: 1fr; }
  .custom-actions .season-note { margin-left: 0; width: 100%; }
}
