:root {
  --forest-900: #1b3a2b;
  --forest-700: #2d6a4f;
  --forest-500: #40916c;
  --sage-400: #74c69d;
  --sage-200: #d8f3dc;
  --sun-500: #f4a533;
  --sun-400: #ffb703;
  --bark-800: #3a2e26;
  --paper-50: #faf7f0;
  --paper-100: #f3efe4;
  --ink-900: #1f2921;
  --ink-600: #4b5a51;
  --danger: #c1440e;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --shadow-soft: 0 10px 30px rgba(27, 58, 43, 0.08);
  --shadow-lift: 0 16px 40px rgba(27, 58, 43, 0.16);
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink-900);
  background:
    radial-gradient(circle at 100% 0%, var(--sage-200) 0%, transparent 45%),
    radial-gradient(circle at 0% 100%, #fff3d6 0%, transparent 40%),
    var(--paper-50);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

h1, h2, h3, .brand {
  font-family: 'Fraunces', Georgia, serif;
}

a { color: var(--forest-700); }

/* Decorative leaves */
.leaf-decor {
  position: fixed;
  width: 260px;
  height: 260px;
  color: var(--sage-400);
  pointer-events: none;
  z-index: 0;
}
.leaf-decor-tl { top: -60px; left: -70px; transform: rotate(-25deg); opacity: 0.35; }
.leaf-decor-br { bottom: -70px; right: -80px; transform: rotate(160deg); color: var(--sun-400); opacity: 0.25; }

/* Nav */
.topnav {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 18px 32px;
  background: rgba(250, 247, 240, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(45, 106, 79, 0.1);
}
.topnav-top {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 100%;
}
.topnav-right {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
}
.corn-balance {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: var(--forest-900);
  font-size: 0.95rem;
}
.profile-avatar-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--paper-100);
  border: 1px solid rgba(45, 106, 79, 0.2);
  color: inherit;
  text-decoration: none;
  transition: border-color .15s;
}
.profile-avatar-link:hover { border-color: var(--sun-500); }
.profile-avatar-link.active { border-color: var(--forest-900); border-width: 2px; }
.profile-avatar-img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar-fallback { font-size: 1.2rem; line-height: 1; }
.brand {
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--forest-900);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.brand-mark { font-size: 1.4rem; }
.brand-mark.large { font-size: 3rem; }
.nav-links { display: flex; align-items: flex-start; justify-content: center; flex-wrap: wrap; gap: 20px; }
.nav-links a {
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 8px;
  border-bottom: 2px solid transparent;
  transition: background .15s, border-color .15s;
  color: inherit;
}
.nav-links a:hover, .nav-links a.active {
  background: rgba(45, 106, 79, 0.08);
  border-bottom-color: var(--sun-500);
}
.logout-form { display: inline; margin: 0; }
.link-btn {
  background: none;
  border: none;
  font: inherit;
  color: var(--ink-600);
  cursor: pointer;
  padding: 6px 4px;
}
.link-btn:hover { color: var(--danger); }
.nav-links .link-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background .15s;
}
.nav-links .link-btn:hover { background: rgba(220, 38, 38, 0.08); }
.nav-icon { font-size: 1.35rem; line-height: 1; }
.nav-label {
  font-size: 0.62rem;
  font-weight: 600;
  line-height: 1;
  color: var(--ink-600);
  letter-spacing: 0.01em;
}
.nav-links a:hover .nav-label,
.nav-links a.active .nav-label { color: var(--forest-900); }
.nav-links .link-btn:hover .nav-label { color: var(--danger); }

.page {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* Auth pages */
.auth-page { max-width: 460px; padding-top: 48px; }
.auth-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 40px 36px;
}
.brand-hero { text-align: center; margin-bottom: 28px; }
.brand-hero h1 { margin: 8px 0 2px; color: var(--forest-900); font-size: 2rem; }
.tagline { color: var(--ink-600); margin: 0; }
.auth-card h2 { margin-top: 0; color: var(--forest-900); }
.signup-sent { text-align: center; padding: 8px 0 0; }
.signup-sent h2 { margin: 10px 0 12px; color: var(--forest-900); }
.signup-sent p { margin: 0 0 10px; color: var(--ink-600); }
.signup-sent-hint { font-size: 0.85rem; }

form label {
  display: block;
  font-weight: 500;
  margin-bottom: 16px;
  color: var(--ink-600);
  font-size: 0.9rem;
}
form input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1.5px solid #e2ddd0;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: var(--paper-100);
  transition: border-color .15s, background .15s;
}
form input:focus {
  outline: none;
  border-color: var(--sage-400);
  background: #fff;
}

.btn-primary, .btn-secondary {
  display: inline-block;
  width: 100%;
  padding: 13px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: transform .1s, box-shadow .15s, opacity .15s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--forest-500), var(--forest-700));
  color: #fff;
  box-shadow: 0 8px 20px rgba(45, 106, 79, 0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgba(45, 106, 79, 0.38); }
.btn-secondary {
  background: var(--sun-400);
  color: var(--forest-900);
  margin-top: 12px;
}
.btn-secondary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-secondary:not(:disabled):hover { transform: translateY(-1px); }

.switch-auth { text-align: center; margin-top: 22px; color: var(--ink-600); font-size: 0.92rem; }

.banner {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  margin-bottom: 18px;
}
.banner-success { background: var(--sage-200); color: var(--forest-900); }
.banner-error { background: #fbe4dd; color: var(--danger); }

/* Capture page */
.hero-capture { text-align: center; margin-bottom: 28px; }
.hero-capture h1 { color: var(--forest-900); margin-bottom: 6px; font-size: 2rem; }

.capture-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 28px;
  max-width: 460px;
  margin: 0 auto 40px;
  text-align: center;
}
.preview-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--paper-100);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  border: 2px dashed #dcd4c2;
}
.preview-wrap img { width: 100%; height: 100%; object-fit: cover; }
.preview-placeholder { color: #a49c88; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.preview-icon { font-size: 2.4rem; }
.capture-actions { display: flex; flex-direction: column; gap: 4px; }
.location-status { font-size: 0.85rem; color: var(--ink-600); margin: 14px 0 0; }

.queue-section { max-width: 700px; margin: 0 auto; }
.queue-section h2 { color: var(--forest-900); font-size: 1.3rem; }
.section-heading {
  max-width: 900px;
  margin: 32px auto 16px;
  color: var(--forest-900);
  font-size: 1.3rem;
}
.section-heading:first-of-type { margin-top: 0; }
.discoveries-list { display: flex; flex-direction: column; gap: 12px; }
.discovery-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #fff;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: var(--shadow-soft);
}
.discovery-row img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: var(--paper-100); }
.discovery-thumb-link { display: block; flex-shrink: 0; line-height: 0; }
.admin-thumb-link { display: inline-block; line-height: 0; }
.discovery-info { flex: 1; }
.discovery-name { font-weight: 600; color: var(--forest-900); }
.discovery-meta { font-size: 0.8rem; color: var(--ink-600); }
.status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 4px 10px;
  border-radius: 999px;
}
.status-pending, .status-uploaded { background: #fff3d6; color: var(--sun-500); }
.status-identified { background: var(--sage-200); color: var(--forest-700); }
.status-needs_review { background: #fde2c8; color: #b5651d; }
.status-failed { background: #fbe4dd; color: var(--danger); }
.status-disputed { background: #fde2c8; color: var(--danger); }
.status-open { background: var(--sage-200); color: var(--forest-700); }
.status-resolved { background: var(--sage-200); color: var(--forest-700); }
.status-expired { background: #fbe4dd; color: var(--danger); }
.status-cancelled { background: #fbe4dd; color: var(--danger); }

.empty-state { color: var(--ink-600); text-align: center; padding: 24px; }

/* Achievements */
.achievements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
}
.achievement-card {
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 20px 16px;
  text-align: center;
}
.achievement-icon { font-size: 2.2rem; display: block; margin-bottom: 8px; }
.achievement-name { font-weight: 700; color: var(--forest-900); }
.achievement-sci { font-size: 0.78rem; font-style: italic; color: var(--ink-600); margin: 2px 0 6px; }
.achievement-date { font-size: 0.72rem; color: #a49c88; }
.challenge-card { text-align: left; text-decoration: none; display: block; }
.challenge-pot { font-size: 0.85rem; color: var(--forest-700); margin: 6px 0; }

/* Leaderboard */
.leaderboard-list { display: flex; flex-direction: column; gap: 10px; max-width: 560px; margin: 0 auto; }
.leaderboard-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #fff;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: var(--shadow-soft);
}
.leaderboard-rank {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: var(--forest-700);
  width: 34px;
}
.leaderboard-row:nth-child(1) .leaderboard-rank { color: var(--sun-500); }
.leaderboard-name { flex: 1; font-weight: 600; }
.leaderboard-count { color: var(--ink-600); font-weight: 600; }
.leaderboard-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--paper-100);
}
.leaderboard-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: var(--sage-200);
}
a.leaderboard-row { text-decoration: none; color: inherit; }
.leaderboard-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.leaderboard-tab {
  background: #fff;
  border: 1px solid var(--sage-200);
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 600;
  color: var(--ink-600);
  cursor: pointer;
}
.leaderboard-tab.active {
  background: var(--forest-700);
  border-color: var(--forest-700);
  color: #fff;
}

/* Profile */
.profile-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 32px 36px;
  max-width: 520px;
  margin: 0 auto 24px;
}
.avatar-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 28px;
}
.avatar-preview-wrap {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--sage-200);
}
.avatar-preview { width: 100%; height: 100%; object-fit: cover; }
.avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}
.avatar-choose-btn { width: auto; padding: 9px 18px; }
.avatar-hint { font-size: 0.78rem; color: var(--ink-600); margin: 8px 0 0; }
.profile-card textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1.5px solid #e2ddd0;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: var(--paper-100);
  resize: vertical;
}
.profile-email { font-size: 0.85rem; color: var(--ink-600); margin: 18px 0 0; }
.gemini-key-status { font-size: 0.8rem; color: var(--ink-600); margin: -8px 0 10px; }
.gemini-key-hint { font-size: 0.8rem; color: var(--ink-600); margin: -6px 0 14px; }
.gemini-key-hint a { color: var(--forest-700); font-weight: 600; }
.danger-zone h2 { margin-top: 0; color: var(--danger); font-size: 1.1rem; }
.danger-zone p { color: var(--ink-600); font-size: 0.9rem; }
.delete-trigger-btn { width: auto; padding: 10px 20px; color: var(--danger); }
.danger-btn { background: var(--danger); }
.logout-form-page { display: block; max-width: 520px; margin: 24px auto 0; text-align: center; }
.logout-form-page .btn-secondary { width: auto; padding: 10px 24px; }

.checkbox-label {
  display: flex !important;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.85rem !important;
}
.checkbox-label input[type="checkbox"] {
  width: auto !important;
  margin-top: 3px;
  flex-shrink: 0;
}
.checkbox-label span { line-height: 1.4; }
.checkbox-label a { color: var(--forest-700); }

/* Legal pages (terms/privacy) */
.legal-doc {
  max-width: 760px;
  margin: 0 auto;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 40px 44px 56px;
}
.legal-doc h1 { color: var(--forest-900); margin-bottom: 4px; }
.legal-updated { color: var(--ink-600); font-size: 0.85rem; margin-top: 0; }
.legal-doc h2 { color: var(--forest-700); font-size: 1.15rem; margin-top: 32px; }
.legal-doc p, .legal-doc li { color: var(--ink-900); line-height: 1.6; }
.legal-doc ul { padding-left: 22px; }
.legal-doc a { color: var(--forest-700); }

.site-footer {
  text-align: center;
  padding: 24px 16px 90px;
  font-size: 0.8rem;
  color: var(--ink-600);
}
.site-footer a { color: var(--ink-600); text-decoration: underline; }

/* Admin */
.admin-tabs {
  display: flex;
  gap: 4px;
  max-width: 900px;
  margin: 0 auto 24px;
  border-bottom: 1.5px solid #e2ddd0;
}
.admin-tab {
  padding: 10px 18px;
  text-decoration: none;
  color: var(--ink-600);
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1.5px;
}
.admin-tab:hover { color: var(--forest-700); }
.admin-tab.active { color: var(--forest-700); border-bottom-color: var(--sun-500); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  max-width: 900px;
  margin: 0 auto 28px;
}
.stat-tile {
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 20px 16px;
  text-align: center;
}
.stat-value { font-family: 'Fraunces', serif; font-size: 2rem; font-weight: 700; color: var(--forest-700); }
.stat-label { font-size: 0.82rem; color: var(--ink-600); margin-top: 4px; }

.admin-panel {
  max-width: 900px;
  margin: 0 auto 28px;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 22px 26px;
}
.admin-panel h2 { margin-top: 0; color: var(--forest-900); font-size: 1.1rem; }
.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--paper-100);
}
.status-row:last-child { border-bottom: none; }

.admin-table-wrap {
  max-width: 1000px;
  margin: 0 auto;
  overflow-x: auto;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.admin-table th, .admin-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--paper-100);
  white-space: nowrap;
}
.admin-table th { color: var(--ink-600); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-actions { display: flex; gap: 10px; }
.admin-actions .link-btn { padding: 0; }
.link-btn.danger:hover { color: var(--danger); }
.admin-thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; display: block; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27, 58, 43, 0.45);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lift);
}
.modal-card h2 { margin-top: 0; color: var(--forest-900); }
.modal-actions { display: flex; gap: 12px; margin-top: 20px; }
.modal-actions .btn-primary, .modal-actions .btn-secondary { width: auto; flex: 1; margin-top: 0; }

/* Discovery detail */
.detail-card {
  max-width: 640px;
  margin: 0 auto 32px;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}
.detail-photo { width: 100%; max-height: 480px; object-fit: cover; display: block; background: var(--paper-100); }
.detail-body { padding: 24px 28px 28px; }
.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.detail-header h1 { margin: 0; color: var(--forest-900); font-size: 1.5rem; }
.detail-sci { margin: 2px 0 0; font-style: italic; color: var(--ink-600); }
.detail-tags { margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tag-chip {
  display: inline-block;
  background: var(--sage-200);
  color: var(--forest-700);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}
/* Like applies to the photo - sits right under the image, deliberately
   separate from the agree/disagree identification vote below. */
.photo-actions { display: flex; margin-bottom: 14px; }
.like-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--paper-100);
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-600);
  cursor: pointer;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.like-btn.liked { background: #fbe4dd; color: var(--danger); }
.like-btn:hover { background: var(--sage-200); }
.like-btn.liked:hover { background: #fbe4dd; }

/* Agree/disagree applies to the identification, not the photo - grouped
   with the identification-correction controls right under the species
   name/tags, distinct from the like button above. */
.id-actions { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.vote-group-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.id-actions-label { font-size: 0.85rem; font-weight: 600; color: var(--ink-600); }
.vote-group { display: flex; gap: 8px; }
.vote-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--paper-100);
  border: none;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink-600);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.vote-btn.active { background: var(--sage-200); color: var(--forest-700); }
.vote-btn:hover { background: var(--sage-200); }

/* "Identify with Gemini" - an icon-only button using Gemini's own
   sparkle-gradient branding instead of a plain text label. */
.gemini-identify-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #4285f4 0%, #9b72cb 50%, #d96570 100%);
  color: #fff;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
  box-shadow: 0 2px 8px rgba(155, 114, 203, 0.4);
  transition: transform .15s, box-shadow .15s, opacity .15s;
}
.gemini-identify-btn:hover { transform: translateY(-1px) scale(1.05); box-shadow: 0 4px 12px rgba(155, 114, 203, 0.5); }
.gemini-identify-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.gemini-key-hint-inline { font-size: 0.8rem; color: var(--ink-600); margin: 6px 0 0; }
.gemini-key-hint-inline a { color: var(--forest-700); font-weight: 600; }

.detail-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0;
  font-size: 0.85rem;
  color: var(--ink-600);
}
.detail-owner { display: flex; align-items: center; gap: 8px; }
.detail-owner-avatar { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; }

.detail-map { height: 220px; border-radius: var(--radius-md); overflow: hidden; margin-bottom: 16px; z-index: 1; }

.edit-id-form {
  margin-top: 10px;
  padding: 16px;
  background: var(--paper-100);
  border-radius: var(--radius-sm);
}
.edit-id-form select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 12px 14px;
  border: 1.5px solid #e2ddd0;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
}
.edit-id-save-btn { width: auto; padding: 9px 20px; }

.comments-section { max-width: 640px; margin: 0 auto 60px; }
.comment-form { display: flex; gap: 10px; margin-bottom: 20px; align-items: flex-start; }
.comment-form textarea {
  flex: 1;
  padding: 10px 12px;
  border: 1.5px solid #e2ddd0;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
  background: var(--paper-100);
}
.comment-submit-btn { width: auto; padding: 10px 18px; flex-shrink: 0; }

.comment {
  background: #fff;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-soft);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.comment-replies { margin-left: 28px; }
.comment-reply { background: var(--paper-100); box-shadow: none; }
.comment-header { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; }
.comment-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.comment-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--sage-200);
  font-size: 0.8rem;
}
.comment-date { color: #a49c88; margin-left: auto; font-size: 0.78rem; }
.comment-body { margin: 8px 0 4px; color: var(--ink-900); font-size: 0.92rem; line-height: 1.5; }
.reply-btn { font-size: 0.8rem; padding: 0; }
.reply-form { display: flex; gap: 8px; margin-top: 10px; align-items: flex-start; }
.reply-form textarea {
  flex: 1;
  padding: 8px 10px;
  border: 1.5px solid #e2ddd0;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  resize: vertical;
  background: #fff;
}
.reply-submit-btn { width: auto; padding: 8px 14px; flex-shrink: 0; font-size: 0.85rem; }

/* Cookie consent banner */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  padding: 16px 24px;
  background: var(--forest-900);
  color: var(--paper-50);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.15);
}
.cookie-banner p { margin: 0; max-width: 640px; font-size: 0.88rem; line-height: 1.4; }
.cookie-accept-btn { width: auto; padding: 10px 22px; flex-shrink: 0; }

/* User Discoveries page */
.back-btn { margin-bottom: 12px; display: inline-block; }
.user-header { display: flex; align-items: center; gap: 16px; justify-content: center; }
.user-header-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--paper-100);
}
.user-header-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  background: var(--sage-200);
}
.tag-filter-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 20px; }
.tag-filter-chip {
  background: #fff;
  border: 1px solid var(--sage-200);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-600);
  cursor: pointer;
}
.tag-filter-chip.active { background: var(--forest-700); border-color: var(--forest-700); color: #fff; }
a.discovery-row { text-decoration: none; color: inherit; }
.load-more-btn { display: block; margin: 20px auto 0; }
.section-link { font-size: 0.85rem; font-weight: 600; margin-left: 8px; }
.section-link-wrap { text-align: center; margin-top: -8px; }

/* Discovery search */
.search-filters {
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  padding: 20px;
  max-width: 640px;
  margin: 0 auto 24px;
}
.search-filters label { display: block; margin-bottom: 12px; }
.area-hint { font-size: 0.85rem; color: var(--ink-600); margin: 8px 0 6px; }
.search-map { height: 220px; border-radius: var(--radius-md); overflow: hidden; }
#radius-field { margin-top: 10px; max-width: 200px; }

/* Mobile: minimalistic but practical */
@media (max-width: 640px) {
  .topnav { padding: 14px 16px; }
  .topnav-right { gap: 8px; }
  .corn-balance { font-size: 0.8rem; }
  .profile-avatar-link { width: 28px; height: 28px; }
  .profile-avatar-fallback { font-size: 1rem; }
  .nav-links { gap: 8px; }
  .nav-links a, .nav-links .link-btn { padding: 6px 5px; }
  .nav-icon { font-size: 1.15rem; }
  .nav-label { font-size: 0.56rem; }
  .brand span:last-child { display: none; }
  .page { padding: 20px 14px 60px; }
  .auth-card { padding: 28px 22px; }
  .capture-card { padding: 20px; }
  .hero-capture h1 { font-size: 1.5rem; }
  .leaf-decor { width: 160px; height: 160px; }
  .achievements-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
}

.status-queued, .status-uploading { background: #fff3d6; color: var(--sun-500); }
.status-blocked_insufficient_corns, .status-blocked_session_expired { background: #fde2c8; color: #b5651d; }
.status-failed_permanent { background: #fbe4dd; color: var(--danger); }
