:root {
  --swamp-950: #0b1a12;
  --swamp-900: #10251a;
  --swamp-800: #16331f;
  --swamp-700: #1f4a2b;
  --moss: #4f8a3a;
  --lily: #9cc36b;
  --eye: #f2c230;
  --eye-deep: #d9a514;
  --water: #2b6f73;
  --mud: #7a5c3a;

  --c-alligator: #2f6b2a;
  --c-crocodile: #a88b2e;
  --c-caiman: #8a4f2b;
  --c-unknown: #5f6b66;

  --bg: #f3efe2;
  --surface: #fbf9f2;
  --surface-2: #ece6d3;
  --text: #1c261f;
  --muted: #5b665e;
  --border: #d8d0b8;
  --shadow: 0 10px 30px rgb(16 37 26 / 0.18);
  --danger: #b3261e;

  --radius: 14px;
  --font-body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Lilita One', 'Nunito', system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0d1c14;
    --surface: #132a1c;
    --surface-2: #1b3826;
    --text: #e7eee2;
    --muted: #9fb3a3;
    --border: #2a4a35;
    --shadow: 0 10px 30px rgb(0 0 0 / 0.45);
    --c-alligator: #5aa84f;
    --c-crocodile: #d2b24a;
    --c-caiman: #c27a4a;
    --c-unknown: #8d9a94;
    --danger: #ff8a80;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0d1c14;
  --surface: #132a1c;
  --surface-2: #1b3826;
  --text: #e7eee2;
  --muted: #9fb3a3;
  --border: #2a4a35;
  --shadow: 0 10px 30px rgb(0 0 0 / 0.45);
  --c-alligator: #5aa84f;
  --c-crocodile: #d2b24a;
  --c-caiman: #c27a4a;
  --c-unknown: #8d9a94;
  --danger: #ff8a80;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  display: flex;
  flex-direction: column;
}
a { color: var(--water); }
@media (prefers-color-scheme: dark) { a { color: #7fc3c0; } }
[hidden] { display: none !important; }

/* ---------- top bar: gator hide ---------- */
.topbar {
  position: relative;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  color: #f3efe2;
  background-color: var(--swamp-800);
  /* scute pattern */
  background-image:
    radial-gradient(ellipse 14px 10px at 50% 60%, rgb(255 255 255 / 0.05) 60%, transparent 62%),
    radial-gradient(ellipse 14px 10px at 0% 10%, rgb(0 0 0 / 0.18) 60%, transparent 62%);
  background-size: 28px 20px, 28px 20px;
  border-bottom: 4px solid var(--swamp-950);
  box-shadow: 0 2px 0 var(--moss);
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }
.brand img { border-radius: 10px; flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-family: var(--font-display); font-size: 26px; letter-spacing: 0.5px; line-height: 1; }
.brand-name::first-letter { color: var(--eye); }
.brand-tag { font-size: 12.5px; color: var(--lily); font-weight: 700; }

/* ---------- buttons ---------- */
.btn {
  font: 800 14.5px/1 var(--font-body);
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: transform 0.08s ease, filter 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn-primary { background: var(--eye); color: #1d1a08; box-shadow: 0 3px 0 var(--eye-deep); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: var(--surface-2); color: var(--text); }
.btn-ghost:hover { filter: brightness(0.97); }
.icon-btn { background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.icon-btn:hover { background: var(--surface-2); }
:focus-visible { outline: 3px solid var(--eye); outline-offset: 2px; }

/* ---------- layout ---------- */
.layout { flex: 1; display: grid; grid-template-columns: 1fr 360px; min-height: 0; }
.map-wrap { position: relative; min-height: 0; }
#map { position: absolute; inset: 0; background: var(--surface-2); }
.panel {
  background: var(--surface);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: 14px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

@media (max-width: 800px) {
  body { display: block; height: auto; }
  .layout { display: flex; flex-direction: column; }
  .map-wrap { height: 62vh; height: 62svh; }
  .panel { border-left: 0; border-top: 1px solid var(--border); overflow: visible; }
  .brand-tag { display: none; }
  .brand-name { font-size: 22px; }
  #reportBtn { padding: 10px 14px; }
}

/* ---------- filters ---------- */
.filters { display: flex; flex-direction: column; gap: 10px; }
.filter-group { display: flex; gap: 10px; align-items: baseline; }
.filter-label { font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); width: 38px; flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: 700 13px/1 var(--font-body);
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 7px 11px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip.is-on { background: var(--swamp-700); border-color: var(--swamp-700); color: #f3efe2; }
.chip:not(.is-on) .dot { opacity: 0.35; }

.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; box-shadow: 0 0 0 2px rgb(255 255 255 / 0.5); }
.dot-alligator { background: var(--c-alligator); }
.dot-crocodile { background: var(--c-crocodile); }
.dot-caiman { background: var(--c-caiman); }
.dot-unknown { background: var(--c-unknown); }

/* ---------- list ---------- */
.list-head h2 { font-family: var(--font-display); font-weight: 400; font-size: 20px; margin: 4px 0 0; letter-spacing: 0.3px; }
.sighting-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sighting-list button {
  width: 100%;
  text-align: left;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.sighting-list button:hover { border-color: var(--moss); }
.sighting-list .badge { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 20px; }
.sighting-list .title { font-weight: 800; }
.sighting-list .sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sighting-list .when { color: var(--muted); font-size: 12.5px; font-weight: 700; text-align: right; white-space: nowrap; }
.sighting-list .thumb { font-size: 12px; }
.empty { color: var(--muted); font-style: italic; margin: 0; }

/* ---------- safety ---------- */
.safety { background: var(--surface-2); border-radius: var(--radius); padding: 10px 14px; margin-top: auto; }
.safety summary { cursor: pointer; font-weight: 800; }
.safety ul { padding-left: 18px; margin: 10px 0; }
.safety li { margin-bottom: 4px; }
.hotline { background: var(--surface); border-left: 4px solid var(--eye); padding: 8px 10px; border-radius: 8px; margin: 8px 0; }
.fineprint { font-size: 12px; color: var(--muted); margin: 6px 0 0; }

/* ---------- map pins ---------- */
.gw-pin {
  width: 34px;
  height: 34px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  display: grid;
  place-items: center;
  border: 2.5px solid #fff;
  box-shadow: 0 3px 8px rgb(0 0 0 / 0.35);
}
.gw-pin span { transform: rotate(45deg); font-size: 17px; line-height: 1; }
.gw-pin.is-old { opacity: 0.72; }
.gw-alligator { background: var(--c-alligator); }
.gw-crocodile { background: var(--c-crocodile); }
.gw-caiman { background: var(--c-caiman); }
.gw-unknown { background: var(--c-unknown); }
.gw-pin.gw-new { background: var(--eye); animation: bob 1.4s ease-in-out infinite; }
@keyframes bob { 50% { translate: 0 -4px; } }
@media (prefers-reduced-motion: reduce) { .gw-pin.gw-new { animation: none; } }

.gw-cluster {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font: 800 14px/1 var(--font-body);
  background:
    radial-gradient(circle at 30% 30%, rgb(255 255 255 / 0.18), transparent 45%),
    var(--swamp-700);
  border: 3px solid var(--eye);
  box-shadow: 0 0 0 5px rgb(242 194 48 / 0.28), 0 4px 10px rgb(0 0 0 / 0.3);
}
.gw-cluster.big { width: 54px; height: 54px; font-size: 15px; }

/* ---------- popups ---------- */
.leaflet-popup-content-wrapper { border-radius: 14px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.leaflet-popup-tip { background: var(--surface); }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-popup-content { margin: 12px 14px; font: 14px/1.4 var(--font-body); min-width: 210px; }
.pop h3 { margin: 0 0 2px; font-family: var(--font-display); font-weight: 400; font-size: 19px; letter-spacing: 0.3px; }
.pop .meta { color: var(--muted); font-size: 13px; margin: 0 0 6px; }
.pop .tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.pop .tag { background: var(--surface-2); border-radius: 999px; padding: 2px 8px; font-size: 12px; font-weight: 700; }
.pop .tag.warn { background: #f8d7c4; color: #6b2a0a; }
.pop img { display: block; width: 100%; max-height: 190px; object-fit: cover; border-radius: 10px; margin: 6px 0; cursor: zoom-in; }
.pop .notes { margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.pop .by { font-size: 12.5px; color: var(--muted); }
.pop .flag { background: none; border: 0; padding: 0; color: var(--muted); font: 700 12px var(--font-body); text-decoration: underline; cursor: pointer; }
.pop-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.share-btn { font: 800 13px var(--font-body); background: var(--eye); color: #1d1a08; border: 0; border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.pop .flag-reasons { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.pop .flag-reasons button { font: 700 12px var(--font-body); border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 999px; padding: 3px 8px; cursor: pointer; }

/* ---------- place bar ---------- */
.place-bar {
  position: absolute;
  z-index: 800;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(560px, calc(100% - 32px));
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  border-top: 4px solid var(--eye);
}
.place-bar p { margin: 0 0 10px; }
.place-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.place-actions .btn { padding: 9px 14px; }
.placing #map { cursor: crosshair; }

/* ---------- dialog ---------- */
.report-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}
.report-dialog::backdrop { background: rgb(8 20 13 / 0.6); backdrop-filter: blur(2px); }
.report-dialog form { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: var(--swamp-800);
  color: #f3efe2;
}
.dialog-head h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 22px; letter-spacing: 0.3px; }
.dialog-head .icon-btn { color: #cfe0c9; }
.dialog-head .icon-btn:hover { background: rgb(255 255 255 / 0.1); }
.dialog-body { padding: 14px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.dialog-foot { display: flex; justify-content: space-between; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--border); }
.where { margin: 0; font-size: 13px; color: var(--muted); }

.species-pick { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.species-pick legend { font-weight: 800; margin-bottom: 6px; padding: 0; }
.species-pick label { position: relative; }
.species-pick input { position: absolute; opacity: 0; }
.species-pick span {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}
.species-pick input:checked + span { border-color: var(--moss); background: color-mix(in srgb, var(--moss) 14%, transparent); }
.species-pick input:focus-visible + span { outline: 3px solid var(--eye); outline-offset: 2px; }
.id-tip { font-size: 13px; color: var(--muted); margin-top: -4px; }
.id-tip summary { cursor: pointer; font-weight: 700; }
.id-tip p { margin: 6px 0 0; }

.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { font-weight: 800; font-size: 13.5px; }
.field em { font-weight: 600; color: var(--muted); font-style: normal; }
.field-narrow { flex: 0 0 96px; }
input[type='text'], input[type='email'], input[type='password'], input[type='number'], input[type='datetime-local'], select, textarea {
  font: 15px var(--font-body);
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 9px 10px;
  width: 100%;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--moss); box-shadow: 0 0 0 3px color-mix(in srgb, var(--moss) 30%, transparent); }

.photo-drop {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 2px dashed var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 700;
}
.photo-drop:hover { border-color: var(--moss); }
.photo-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.photo-drop img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.turnstile { min-height: 65px; }
.form-error { margin: 0; color: var(--danger); font-weight: 700; }

@media (max-width: 480px) {
  .row { flex-direction: column; }
  .field-narrow { flex: 1; }
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  z-index: 2000;
  left: 50%;
  top: 76px;
  transform: translateX(-50%);
  background: var(--swamp-800);
  color: #f3efe2;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 800;
  box-shadow: var(--shadow);
  border: 2px solid var(--eye);
  max-width: calc(100vw - 32px);
}

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 3000; background: rgb(0 0 0 / 0.85); display: grid; place-items: center; padding: 16px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* ---------- leaflet tweaks ---------- */
.leaflet-control-layers, .leaflet-bar a { background: var(--surface); color: var(--text); border-color: var(--border) !important; }
.leaflet-control-attribution { font-size: 10.5px; }

/* ---------- admin ---------- */
.admin-main { padding: 16px; max-width: 1200px; width: 100%; margin: 0 auto; }
.admin-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.admin-toolbar h1 { font-family: var(--font-display); font-weight: 400; margin: 0 auto 0 0; font-size: 24px; }
.admin-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.admin-table { width: 100%; min-width: 820px; border-collapse: collapse; font-size: 14px; }
.admin-table th, .admin-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.admin-table th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); background: var(--surface-2); }
.admin-table img { width: 72px; height: 54px; object-fit: cover; border-radius: 6px; cursor: zoom-in; }
.admin-table .notes { max-width: 280px; white-space: pre-wrap; overflow-wrap: anywhere; }
.admin-table .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-table .actions .btn { padding: 7px 11px; font-size: 13px; }
.btn-danger { background: var(--danger); color: #fff; }
.status { font-weight: 800; font-size: 12px; border-radius: 999px; padding: 2px 8px; }
.status.visible { background: color-mix(in srgb, var(--moss) 25%, transparent); }
.status.hidden { background: color-mix(in srgb, var(--danger) 25%, transparent); }
tr.is-hidden td { opacity: 0.75; }

/* ---------- header account ---------- */
.header-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.btn-account {
  background: rgb(255 255 255 / 0.08);
  color: #f3efe2;
  border: 1.5px solid rgb(255 255 255 / 0.22);
  box-shadow: none;
  max-width: 260px;
}
.btn-account:hover { background: rgb(255 255 255 / 0.14); }
.acct-name { overflow: hidden; text-overflow: ellipsis; }
.acct-pts { color: var(--eye); font-size: 12.5px; }
.report-label-short { display: none; }
@media (max-width: 800px) {
  .report-label { display: none; }
  .report-label-short { display: inline; }
}
@media (max-width: 480px) {
  .acct-pts, .acct-name { display: none; }
  .btn-account .acct-emoji { font-size: 18px; }
  .brand img { width: 34px; height: 34px; }
}

/* ---------- tabs ---------- */
.tabs { display: flex; background: var(--surface-2); border-radius: 999px; padding: 4px; gap: 4px; }
.tabs [role='tab'] {
  flex: 1;
  font: 800 14px/1 var(--font-body);
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 9px 10px;
  cursor: pointer;
}
.tabs [role='tab'][aria-selected='true'] { background: var(--swamp-700); color: #f3efe2; }
.sightings-tab, .leaders-tab { display: flex; flex-direction: column; gap: 14px; }

/* ---------- leaderboard ---------- */
.leaders { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.leaders button {
  width: 100%;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 9px 12px;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}
.leaders button:hover { border-color: var(--moss); }
.leaders .is-me button { border-color: var(--eye); box-shadow: 0 0 0 2px color-mix(in srgb, var(--eye) 35%, transparent); }
.leaders .pos { font-weight: 800; text-align: center; font-size: 17px; }
.leaders .who { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaders .pts { font-weight: 800; color: var(--muted); font-size: 13px; }
.join-cta { background: var(--surface-2); border-radius: var(--radius); padding: 12px 14px; border-left: 4px solid var(--eye); }
.join-cta p { margin: 0 0 10px; }

/* ---------- dialogs: auth / profile / reward ---------- */
.small-dialog { width: min(420px, calc(100vw - 32px)); }
.dialog-shell { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
.muted { color: var(--muted); }
.small { font-size: 13px; margin: 0; }
.posting-as { margin: 0; font-weight: 700; background: color-mix(in srgb, var(--moss) 14%, transparent); padding: 8px 10px; border-radius: 10px; }
.user-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 800; color: var(--water); cursor: pointer; text-decoration: underline; }

.prof-head { display: flex; gap: 14px; align-items: center; }
.prof-badge {
  width: 64px;
  height: 64px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 34px;
  background: radial-gradient(circle at 35% 30%, #fff6, transparent 50%), var(--swamp-700);
  border: 3px solid var(--eye);
}
.prof-rank { font-family: var(--font-display); font-size: 22px; letter-spacing: 0.3px; }
.rank-progress .bar { height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-bottom: 4px; }
.rank-progress .bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--moss), var(--eye)); border-radius: 999px; }
#profileBody h3, #rewardBody h3 { margin: 6px 0 0; font-family: var(--font-display); font-weight: 400; font-size: 18px; letter-spacing: 0.3px; }

.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.ach {
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
  opacity: 0.55;
  filter: grayscale(1);
}
.ach.is-on { opacity: 1; filter: none; border-style: solid; border-color: var(--eye); background: color-mix(in srgb, var(--eye) 10%, transparent); }
.ach-emoji { font-size: 28px; line-height: 1.1; }
.ach-name { font-weight: 800; font-size: 13.5px; margin-top: 4px; }
.ach-desc { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.ach-prog { font-size: 11.5px; font-weight: 800; margin-top: 4px; }

.prof-recent { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.prof-recent button { width: 100%; text-align: left; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; padding: 7px 10px; font: inherit; color: inherit; cursor: pointer; }
.prof-recent button:hover { border-color: var(--moss); }

.reward .dialog-body { align-items: center; text-align: center; }
.reward-pts { font-family: var(--font-display); font-size: 40px; color: var(--moss); letter-spacing: 0.5px; }
.reward-rank { display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 800; font-size: 17px; }
.reward .ach-grid { width: 100%; }
.reward .ach.is-on { animation: pop 0.5s ease-out both; }
@keyframes pop { from { transform: scale(0.6); opacity: 0; } 70% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .reward .ach.is-on { animation: none; } }

/* ---------- phones ---------- */
.topbar {
  padding-top: max(10px, env(safe-area-inset-top));
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}
@media (max-width: 800px) {
  /* iOS Safari zooms the page when focusing inputs smaller than 16px. */
  input[type='text'], input[type='email'], input[type='password'], input[type='number'], input[type='datetime-local'], select, textarea { font-size: 16px; }
  .panel { padding-bottom: max(24px, env(safe-area-inset-bottom)); }
  .toast { top: auto; bottom: max(20px, env(safe-area-inset-bottom)); }
  .place-bar { bottom: max(12px, env(safe-area-inset-bottom)); }
  .chip { padding: 9px 12px; }
  .report-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .report-dialog form, .dialog-shell { max-height: calc(100dvh - 16px); }
}
.logout { align-self: flex-start; }

.link-btn { align-self: flex-start; background: none; border: 0; padding: 0; font: 700 14px var(--font-body); color: var(--water); text-decoration: underline; cursor: pointer; }
.notice { margin: 0; font-weight: 700; background: color-mix(in srgb, var(--moss) 16%, transparent); padding: 10px 12px; border-radius: 10px; }
.email-box { display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); border-radius: 12px; padding: 12px; }
.email-box .row { align-items: stretch; }
.email-box .btn { flex: none; }
.email-status { font-weight: 700; font-size: 14px; }

/* ---------- patreon pill ---------- */
.patreon-pill {
  position: fixed;
  z-index: 1500;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  max-width: min(360px, calc(100vw - 32px));
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--swamp-800);
  color: #f3efe2;
  border: 2px solid var(--eye);
  border-radius: 999px;
  box-shadow: var(--shadow);
  padding: 4px 4px 4px 14px;
  animation: pill-in 0.4s ease-out both;
}
.patreon-link { color: inherit; text-decoration: none; font-size: 13.5px; line-height: 1.3; padding: 6px 0; display: flex; align-items: center; gap: 8px; }
.patreon-link strong { color: var(--eye); }
.patreon-link:hover strong { text-decoration: underline; }
.patreon-heart { font-size: 18px; }
.patreon-close { background: none; border: 0; color: #cfe0c9; font-size: 14px; cursor: pointer; border-radius: 50%; width: 30px; height: 30px; flex: none; }
.patreon-close:hover { background: rgb(255 255 255 / 0.12); }
.placing .patreon-pill { display: none; }
@keyframes pill-in { from { transform: translateY(20px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .patreon-pill { animation: none; } }
@media (max-width: 800px) { .patreon-pill { bottom: max(76px, env(safe-area-inset-bottom)); } }
.role-badge { display: inline-block; margin-left: 8px; vertical-align: middle; font: 800 12px var(--font-body); background: var(--swamp-700); color: #f3efe2; border-radius: 999px; padding: 3px 9px; letter-spacing: 0; }

/* ---------- moderation console ---------- */
.whoami { color: #cfe0c9; font-weight: 700; font-size: 13.5px; }
.admin-tabs { margin-bottom: 14px; max-width: 720px; }
.admin-tabs .count:not(:empty) { display: inline-block; min-width: 20px; padding: 1px 6px; margin-left: 4px; border-radius: 999px; background: var(--eye); color: #1d1a08; font-size: 12px; }
.admin-toolbar { gap: 10px; }
.admin-search { flex: 1; min-width: 200px; max-width: 360px; font: 15px var(--font-body); color: var(--text); background: var(--surface); border: 1.5px solid var(--border); border-radius: 999px; padding: 9px 14px; }
.scope-note { font-size: 14px; font-weight: 700; }
.user-line { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.user-name { font-weight: 800; font-size: 15px; }
.tag-warn { display: inline-block; font-weight: 800; font-size: 12px; color: #6b2a0a; background: #f8d7c4; border-radius: 999px; padding: 1px 8px; margin: 2px 0; }
.tag-bad { display: inline-block; font-weight: 800; font-size: 12px; color: #fff; background: var(--danger); border-radius: 999px; padding: 1px 8px; margin: 2px 0; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 700; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--moss); }
.admin-table code { font-size: 13px; background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
.admin-table .link-btn { font-size: 13.5px; display: block; }
@media (max-width: 800px) {
  .whoami { display: none; }
  .admin-tabs [role='tab'] { font-size: 12.5px; padding: 9px 4px; }
}
@media (max-width: 800px) {
  .admin-main { padding: 12px; }
  .admin-table-wrap { overflow: visible; border: 0; background: none; }
  .admin-table { min-width: 0; }
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; width: 100%; }
  .admin-table tr { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; margin-bottom: 10px; }
  .admin-table td { border: 0; padding: 5px 0; display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px; }
  .admin-table td::before { content: attr(data-label); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding-top: 2px; }
  .admin-table td[data-label=''] { grid-template-columns: minmax(0, 1fr); }
  .admin-table td[data-label='']::before { display: none; }
  .admin-table td:empty { display: none; }
  .admin-table .notes { max-width: none; }
  .admin-table .actions { padding-top: 4px; }
}
