/* ============================================================
   CRONAH — styles.css
   Token system: green + white, three type roles.
   Modes: body[data-mode="b2b"] / body[data-mode="b2c"]
   ============================================================ */

:root {
  /* Color tokens */
  --ink:   #0e2318;  /* near-black green — text */
  --pine:  #175236;  /* primary deep green */
  --leaf:  #2e9e63;  /* bright accent */
  --moss:  #4f7a63;  /* muted secondary text */
  --mist:  #eef6f0;  /* pale green wash */
  --paper: #ffffff;
  --line:  #d5e6da;  /* hairline borders */

  /* Per-mode accent (JS-free: driven by attribute selectors below) */
  --accent: var(--pine);

  /* Type roles */
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Public Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --radius: 14px;
  --maxw: 1120px;
}

body[data-mode="b2c"] { --accent: #217a4b; }

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
/* The hidden attribute must ALWAYS win, no matter what display
   value any other rule sets. Fixes modals/images appearing when
   they shouldn't. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
h3 { font-size: 1.2rem; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--moss);
  margin: 0 0 1rem;
}

/* Mode visibility — the whole switch mechanic in two rules */
body[data-mode="b2b"] [data-only="b2c"] { display: none !important; }
body[data-mode="b2c"] [data-only="b2b"] { display: none !important; }

/* Content cross-fade on mode change (added/removed by JS) */
main { transition: opacity 0.18s ease; }
main.is-switching { opacity: 0; }

/* Keyboard focus */
:focus-visible {
  outline: 3px solid var(--leaf);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.72rem 1.4rem;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--leaf); }
.btn-ghost { background: transparent; color: var(--accent); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--accent); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-wide { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1200;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.7rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.55rem; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 26px; height: 26px;
  border-radius: 50% 50% 50% 4px;   /* leaf-shaped dot */
  background: linear-gradient(135deg, var(--leaf), var(--pine));
}
.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
}

/* The B2B/B2C switch */
.mode-switch {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr; /* equal halves — the thumb is 50%, so they always align */
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px;
  margin-inline: auto;
}
.mode-btn {
  position: relative;
  z-index: 2;
  border: 0;
  background: transparent;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.45rem 1.2rem;
  border-radius: 999px;
  color: var(--moss);
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: color 0.2s ease;
}
.mode-btn[aria-selected="true"] { color: #fff; }
.mode-thumb {
  position: absolute;
  z-index: 1;
  top: 4px; bottom: 4px; left: 4px;
  width: calc(50% - 4px);
  background: var(--accent);
  border-radius: 999px;
  transition: transform 0.25s cubic-bezier(0.35, 0, 0.2, 1), background 0.25s ease;
}
body[data-mode="b2c"] .mode-thumb { transform: translateX(100%); }

.header-nav { display: flex; align-items: center; gap: 1.1rem; }
.header-nav a { color: var(--ink); font-weight: 500; font-size: 0.92rem; }
.header-nav a:hover { color: var(--accent); text-decoration: none; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1000px 420px at 85% -10%, rgba(46, 158, 99, 0.10), transparent 65%),
    var(--paper);
  border-bottom: 1px solid var(--line);
}
.hero-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 4.5rem 1.25rem 3.5rem;
}
.hero h1 { max-width: 17ch; }
.hero-lead { max-width: 56ch; font-size: 1.08rem; color: var(--moss); }
.hero-actions { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.6rem; }

/* ---------- Photo placeholders ---------- */
.photo {
  margin: 0;
  border: 2px dashed var(--leaf);
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(45deg, rgba(46,158,99,0.05) 0 12px, transparent 12px 24px),
    var(--mist);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  min-height: 220px;
}
.photo-note {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--pine);
  max-width: 46ch;
  text-align: center;
  line-height: 1.5;
}
.photo-hero { margin-top: 3rem; min-height: 320px; }
.photo-tall { min-height: 300px; margin-top: 1.6rem; }
.photo-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-top: 2.5rem;
}

/* ---------- Impact strip ---------- */
.impact { background: var(--pine); color: #fff; }
.impact-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.2rem 1.25rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.impact-num {
  display: block;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
}
.impact-label { font-size: 0.88rem; opacity: 0.85; }

/* ---------- Sections ---------- */
.section { padding: 4.5rem 0; }
.section-tinted { background: var(--mist); border-block: 1px solid var(--line); }
.section-inner { max-width: var(--maxw); margin: 0 auto; padding: 0 1.25rem; }
.section-lead { max-width: 58ch; color: var(--moss); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-top: 2rem;
}
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.card:hover { border-color: var(--leaf); transform: translateY(-2px); }
.card p { margin-bottom: 0; color: var(--moss); font-size: 0.95rem; }

.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}
.step { counter-increment: step; position: relative; padding-top: 2.4rem; }
.step::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  top: 0; left: 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--leaf);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  background: var(--paper);
}
.step p { color: var(--moss); font-size: 0.95rem; }

/* ---------- Heatmap placeholder ---------- */
.heatmap {
  position: relative;
  margin-top: 2rem;
  height: 420px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  background:
    radial-gradient(circle, rgba(23, 82, 54, 0.14) 1.2px, transparent 1.6px) 0 0 / 22px 22px,
    linear-gradient(180deg, #f7fbf8, #e9f4ec);
}
.heatmap-badge {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 3;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--pine);
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
}
.hm-marker {
  position: absolute;
  transform: translate(-50%, -50%);
  z-index: 2;
}
.hm-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--leaf);
  box-shadow: 0 0 0 6px rgba(46, 158, 99, 0.22);
  animation: pulse 2.4s ease-out infinite;
}
.hm-marker[data-intensity="high"] .hm-dot { background: var(--pine); box-shadow: 0 0 0 9px rgba(23, 82, 54, 0.25); }
.hm-label {
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--pine);
  background: rgba(255,255,255,0.85);
  border-radius: 4px;
  padding: 0 0.35rem;
  white-space: nowrap;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(46, 158, 99, 0.35); }
  70%  { box-shadow: 0 0 0 16px rgba(46, 158, 99, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 158, 99, 0); }
}
.heatmap-legend {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: 0;
  margin: 1rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--moss);
}
.heatmap-legend .swatch {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 0.4rem;
}

/* ---------- Action split & forms ---------- */
.section-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
}
.panel-form {
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
}
.panel-form h3 { margin-bottom: 1.2rem; }
.panel-form label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin: 1rem 0 0.35rem;
}
.panel-form input,
.panel-form select,
.panel-form textarea,
#auth-form input {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
}
.panel-form input:focus,
.panel-form select:focus,
.panel-form textarea:focus,
#auth-form input:focus {
  outline: none;
  border-color: var(--leaf);
}
.panel-form .btn { margin-top: 1.4rem; }
.optional { font-weight: 400; color: var(--moss); }
.field-hint { font-size: 0.8rem; color: var(--moss); margin: 0.3rem 0 0; }

/* Honeypot — visually removed, still in the DOM for bots */
.hp {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  opacity: 0;
}

.form-status { min-height: 1.2em; font-size: 0.88rem; margin: 0.8rem 0 0; }
.form-status.ok { color: var(--pine); font-weight: 600; }
.form-status.err { color: #a63a2b; font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer { background: var(--ink); color: #dfeee5; margin-top: 2rem; }
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  align-items: start;
}
.footer-tag { font-size: 0.9rem; opacity: 0.75; max-width: 34ch; }
.footer-nav { display: grid; gap: 0.5rem; }
.footer-nav a { color: #dfeee5; font-size: 0.9rem; }
.footer-legal { font-size: 0.8rem; opacity: 0.55; align-self: end; text-align: right; }

/* ---------- Account modal ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(14, 35, 24, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
/* The hidden attribute must always win, even over display:flex above */
.modal-backdrop[hidden] { display: none; }
/* Lock page scroll only while the modal is open (class set by JS) */
body.modal-open { overflow: hidden; }
.modal {
  position: relative;
  background: var(--paper);
  border-radius: var(--radius);
  padding: 2rem;
  width: min(420px, 100%);
  box-shadow: 0 24px 60px rgba(14, 35, 24, 0.3);
}
.modal-close {
  position: absolute;
  top: 0.8rem; right: 0.9rem;
  border: 0;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--moss);
  cursor: pointer;
}
.auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.auth-tab {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 999px;
  padding: 0.5rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--moss);
  cursor: pointer;
}
.auth-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
#auth-form label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin: 1rem 0 0.35rem;
}
.role-choice {
  border: 0;
  padding: 0;
  margin: 0.4rem 0 0;
}
.role-choice legend {
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0;
  margin-bottom: 0.4rem;
}
.role-options { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.role-option { position: relative; display: block; cursor: pointer; margin: 0; }
.role-option input {
  position: absolute;
  opacity: 0;
  width: 100%; height: 100%;
  margin: 0;
  cursor: pointer;
}
.role-option span {
  display: block;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  font-weight: 600;
  font-size: 0.88rem;
  text-align: center;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.role-option small {
  display: block;
  font-weight: 400;
  font-size: 0.72rem;
  color: var(--moss);
  margin-top: 0.15rem;
}
.role-option input:checked + span {
  border-color: var(--accent);
  background: var(--mist);
}
.role-option input:focus-visible + span {
  outline: 3px solid var(--leaf);
  outline-offset: 2px;
}
#auth-form .btn { margin-top: 1.4rem; }
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 1.2rem 0;
  color: var(--moss);
  font-size: 0.8rem;
}
.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--line);
}
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
}
.btn-google:hover { border-color: var(--accent); }

.auth-note { font-size: 0.8rem; color: var(--moss); margin-top: 1.2rem; }
.auth-note code { font-family: var(--font-mono); font-size: 0.78rem; }

/* ---------- Profile page ---------- */
.profile-page {
  max-width: 880px;
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}
.profile-state { text-align: center; padding: 4rem 0; }
.profile-state .btn { margin-top: 1rem; }
.profile-state .section-lead { margin-inline: auto; }
.profile-header-nav a { display: inline !important; } /* keep visible on mobile */

.profile-heading { margin-bottom: 2rem; }
.profile-heading h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: 0; }

.profile-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: start;
}
.profile-card {
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
}
.profile-card h2 { font-size: 1.25rem; }
.profile-identity { text-align: center; }

.avatar-wrap {
  width: 128px; height: 128px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--paper);
  box-shadow: 0 0 0 2px var(--line);
  background: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
}
.avatar-wrap img { width: 100%; height: 100%; object-fit: cover; }
.avatar-fallback {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 700;
  color: var(--leaf);
}
.profile-email {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--moss);
  margin: 0 0 0.6rem;
  word-break: break-all;
}
.role-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  margin-bottom: 1.2rem;
  background: var(--pine);
  color: #fff;
}
.role-badge[data-role="worker"] { background: var(--leaf); }
.role-badge:empty { display: none; }
.avatar-upload-label { display: inline-block; cursor: pointer; }

.profile-card form label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin: 1rem 0 0.35rem;
}
.profile-card form input,
.profile-card form textarea {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
}
.profile-card form input:focus,
.profile-card form textarea:focus {
  outline: none;
  border-color: var(--leaf);
}
.profile-card form .btn { margin-top: 1.2rem; }
.profile-divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

@media (max-width: 720px) {
  .profile-grid { grid-template-columns: 1fr; }
}

/* When Leaflet takes over the heatmap panel, drop the dot-grid bg */
.heatmap-live { background: #e9f4ec; }
.heatmap-live .heatmap-badge { z-index: 1000; }

/* CRITICAL: Leaflet uses internal z-indexes up to ~1000. Isolating
   each map's stacking context traps those values inside the panel,
   so maps can never float above the header, modal, or anything else. */
.heatmap, .event-map, .admin-map {
  position: relative;
  isolation: isolate;
  z-index: 0;
}
.hm-popup { font-family: var(--font-body); }
.hm-popup strong { display: block; margin-bottom: 0.2rem; }
.hm-popup-status {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--moss);
  margin-bottom: 0.3rem;
}
.hm-popup a { font-weight: 600; }

/* ---------- Event page ---------- */
.event-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}
.event-meta { display: flex; gap: 0.6rem; flex-wrap: wrap; margin: 1rem 0 1.5rem; }
.event-chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--pine);
  color: #fff;
}
.event-chip-quiet { background: var(--mist); color: var(--pine); border: 1px solid var(--line); }
.event-description {
  font-size: 1.05rem;
  color: var(--moss);
  max-width: 60ch;
  margin-bottom: 2rem;
  white-space: pre-line; /* respects paragraph breaks the team types */
}
.event-map {
  height: 320px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  margin-top: 1.5rem;
  background: #e9f4ec;
}
.event-cta {
  margin-top: 2.5rem;
  background: var(--mist);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2rem;
}
.event-cta h2 { font-size: 1.35rem; }
.event-cta .btn { margin-top: 0.6rem; }

/* ---------- Admin panel ---------- */
.admin-howto {
  background: var(--mist);
  border: 1px solid var(--line);
  border-left: 4px solid var(--leaf);
  border-radius: 10px;
  padding: 1.2rem 1.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.92rem;
}
.admin-howto ol { margin: 0.5rem 0; padding-left: 1.3rem; }
.admin-howto li { margin: 0.25rem 0; }
.admin-howto p { margin: 0.5rem 0 0; color: var(--moss); }
.place-search-row { display: flex; gap: 0.5rem; }
.place-search-row input { flex: 1; }
.place-search-row .btn { flex-shrink: 0; }

.admin-page {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 3rem 1.25rem 4rem;
}
.admin-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1.5rem;
  align-items: start;
}
.admin-map {
  height: 300px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  overflow: hidden;
  margin-top: 0.35rem;
  background: #e9f4ec;
  cursor: crosshair;
}
.coords-readout {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--pine);
  margin: 0.5rem 0 0;
}
.coords-label { color: var(--moss); }
.check-row {
  display: flex !important;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.2rem !important;
  cursor: pointer;
}
.check-row input {
  width: auto !important;
  accent-color: var(--pine);
  transform: scale(1.2);
}
.admin-form-actions { display: flex; gap: 0.6rem; align-items: center; }
.btn-small { padding: 0.35rem 0.85rem; font-size: 0.82rem; }
.btn-danger { color: #a63a2b; }
.btn-danger:hover { border-color: #a63a2b; color: #a63a2b; }

.event-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.event-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}
.event-list-item.is-inactive { opacity: 0.55; }
.event-list-meta {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--moss);
  margin-top: 0.15rem;
}
.event-list-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }
.event-list-empty { color: var(--moss); padding: 1rem 0; }

@media (max-width: 900px) {
  .admin-grid { grid-template-columns: 1fr; }
}

/* ---------- Admin panel: mobile optimization ---------- */
@media (max-width: 640px) {
  .admin-page { padding: 1.6rem 0.9rem 3rem; }
  .admin-howto { padding: 1rem 1.1rem; font-size: 0.88rem; }
  .admin-page .profile-card { padding: 1.3rem; }
  .admin-map { height: 260px; }

  /* Event rows stack: name on top, action buttons in a row below */
  .event-list-item {
    flex-direction: column;
    align-items: stretch;
    gap: 0.7rem;
  }
  .event-list-actions {
    width: 100%;
    flex-wrap: wrap;
  }
  .event-list-actions .btn {
    flex: 1 1 calc(50% - 0.4rem);
    text-align: center;
  }

  /* Finger-sized touch targets */
  .btn-small { padding: 0.55rem 0.9rem; font-size: 0.88rem; }
  .admin-form-actions { flex-wrap: wrap; }
  .admin-form-actions .btn { flex: 1 1 auto; text-align: center; }
  .place-search-row .btn { padding-inline: 1rem; }
  .coords-readout { font-size: 0.78rem; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .section-split, .card-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .impact-inner { grid-template-columns: 1fr; gap: 1.2rem; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-legal { text-align: left; }
}
@media (max-width: 640px) {
  .header-inner { justify-content: space-between; }
  .mode-switch { order: 3; width: 100%; }
  .header-nav a { display: none; }        /* keep only Account on tiny screens */
  .header-nav a#admin-link:not([hidden]) { display: inline-block; } /* admins always see it */
  .photo-row, .steps { grid-template-columns: 1fr; }
  .heatmap { height: 340px; }
}
