/* =========================================================
   Isopedia / Crested Critters
   Main stylesheet
   Save as: isopedia/assets/style.css
   ========================================================= */

/* ---------- Theme ---------- */

:root {
  --bg: #07130d;
  --bg-2: #0d2117;
  --bg-3: #143522;

  --card: rgba(255, 255, 255, 0.94);
  --card-soft: rgba(255, 255, 255, 0.86);
  --card-dark: rgba(9, 31, 20, 0.96);

  --text: #17231b;
  --text-soft: #4b5f51;
  --text-light: #edf8ef;
  --muted: #6e7c71;

  --green-dark: #063b22;
  --green: #0f6b3c;
  --green-2: #15824b;
  --green-light: #dff4e5;

  --gold: #d5a94f;
  --gold-light: #fff3cf;

  --red: #b13b30;
  --red-light: #ffe3df;

  --blue: #2d6f95;
  --blue-light: #e1f1fb;

  --border: rgba(18, 68, 41, 0.18);
  --border-dark: rgba(255, 255, 255, 0.12);

  --shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
  --shadow-soft: 0 10px 28px rgba(0, 0, 0, 0.13);

  --radius-lg: 28px;
  --radius: 18px;
  --radius-sm: 12px;

  --shell: 1120px;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ---------- Base reset ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(213, 169, 79, 0.18), transparent 30rem),
    radial-gradient(circle at top right, rgba(21, 130, 75, 0.22), transparent 28rem),
    linear-gradient(135deg, #06120c 0%, #0c2317 42%, #17391f 100%);
  line-height: 1.55;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 38px 38px;
  pointer-events: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

a {
  color: var(--green);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

p {
  margin: 0 0 0.9rem;
}

h1,
h2,
h3,
h4 {
  margin: 0 0 0.75rem;
  line-height: 1.12;
  color: var(--green-dark);
}

h1 {
  font-size: clamp(2rem, 4vw, 4rem);
  letter-spacing: -0.04em;
}

h2 {
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  letter-spacing: -0.025em;
}

h3 {
  font-size: 1.14rem;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

/* ---------- Layout ---------- */

.site-shell {
  width: min(var(--shell), calc(100% - 32px));
  margin: 0 auto;
}

.main {
  padding: 32px 0 54px;
}

.page-stack {
  display: grid;
  gap: 22px;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

/* ---------- Header / nav ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(4, 24, 13, 0.88);
  border-bottom: 1px solid var(--border-dark);
  backdrop-filter: blur(14px);
}

.nav {
  min-height: 74px;
  padding: 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.nav-stacked {
  min-height: auto;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 10px;
}

.nav-primary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-light);
  font-weight: 900;
  letter-spacing: -0.03em;
  text-decoration: none;
  white-space: nowrap;
}

.brand:hover {
  text-decoration: none;
}

.brand-logo {
  width: 52px;
  height: 52px;
  max-width: 52px;
  max-height: 52px;
  object-fit: contain;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 2px rgba(213, 169, 79, 0.32);
}

.brand-title {
  font-size: 1.16rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  color: #062115;
  background: linear-gradient(135deg, var(--gold), #f2dc98);
  font-size: 0.82rem;
  font-weight: 950;
  box-shadow: 0 0 0 3px rgba(213, 169, 79, 0.25);
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.92rem;
  font-weight: 750;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-links a:hover {
  color: #ffffff;
  background: rgba(213, 169, 79, 0.18);
  border-color: rgba(213, 169, 79, 0.32);
  text-decoration: none;
}

.isopedia-links {
  justify-content: center;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.isopedia-links a {
  background: rgba(255, 255, 255, 0.075);
}

.main-site-links a[href="index.html"],
.isopedia-links a[href="index.html"] {
  border-color: rgba(213, 169, 79, 0.34);
}

/* ---------- Cards ---------- */

.content-card,
.hero-card,
.search-card,
.form-card,
.empty-state,
.species-hero,
.account-card,
.verify-card,
.review-card,
.contribution-card,
.dispute-card,
.donator-card,
.profile-card,
.changelog-card,
.admin-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.content-card,
.search-card,
.form-card,
.empty-state,
.account-card,
.verify-card,
.review-card,
.contribution-card,
.dispute-card,
.donator-card,
.profile-card,
.changelog-card,
.admin-card {
  padding: clamp(18px, 3vw, 30px);
}

.content-card + .content-card,
.content-card + .form-card,
.form-card + .content-card {
  margin-top: 20px;
}

.card-highlight {
  border-color: rgba(213, 169, 79, 0.75) !important;
  box-shadow:
    var(--shadow),
    0 0 0 4px rgba(213, 169, 79, 0.18) !important;
}

.card-topline {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

/* ---------- Home hero ---------- */

.hero {
  padding: clamp(24px, 5vw, 58px);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  align-items: center;
  gap: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(229, 246, 233, 0.91)),
    radial-gradient(circle at right, rgba(213, 169, 79, 0.22), transparent 24rem);
  border-radius: calc(var(--radius-lg) + 8px);
  border: 1px solid rgba(213, 169, 79, 0.3);
  box-shadow: var(--shadow);
}

.hero h1 {
  margin-bottom: 0.9rem;
}

.hero p {
  color: var(--text-soft);
  font-size: 1.08rem;
  max-width: 680px;
}

.hero-actions,
.action-row,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-logo,
.hero-image {
  width: min(100%, 310px);
  margin-inline: auto;
  border-radius: 999px;
  background: rgba(6, 59, 34, 0.08);
  box-shadow: 0 18px 46px rgba(6, 59, 34, 0.18);
}

/* ---------- Stats ---------- */

.stats-grid,
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.stat-card,
.stat {
  padding: 18px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.stat-number,
.stat-value,
.stat strong {
  display: block;
  margin-top: 3px;
  color: var(--green-dark);
  font-size: clamp(1.5rem, 3vw, 2.3rem);
  font-weight: 950;
  letter-spacing: -0.04em;
}

/* ---------- Search / filters ---------- */

.search-card {
  margin: 22px 0;
}

.search-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-row input,
.search-input,
#searchInput {
  width: 100%;
  min-height: 46px;
  padding: 12px 15px;
  border-radius: 999px;
  border: 1px solid rgba(6, 59, 34, 0.18);
  background: #ffffff;
  color: var(--text);
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.9);
}

.search-row input:focus,
.search-input:focus,
#searchInput:focus {
  border-color: rgba(21, 130, 75, 0.62);
  box-shadow: 0 0 0 4px rgba(21, 130, 75, 0.14);
}

.genus-filter,
.genus-list,
.filter-row,
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.genus-btn,
.filter-pill {
  border: 1px solid rgba(6, 59, 34, 0.18);
  background: #ffffff;
  color: var(--green-dark);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 850;
  font-size: 0.88rem;
}

.genus-btn:hover,
.filter-pill:hover,
.genus-btn.active,
.filter-pill.active {
  background: var(--green);
  border-color: var(--green);
  color: #ffffff;
}

/* ---------- Entry grids / cards ---------- */

.grid,
.results-grid,
.card-grid,
#resultsGrid,
#recentGrid,
.recent-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.species-card,
.isopod-card,
.entry-card,
.result-card {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  color: var(--text);
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.species-card:hover,
.isopod-card:hover,
.entry-card:hover,
.result-card:hover {
  transform: translateY(-3px);
  border-color: rgba(213, 169, 79, 0.65);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.card-image,
.entry-image,
.isopod-image,
.species-card img,
.result-card img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  background: var(--green-light);
}

.card-body,
.entry-card-body,
.isopod-card-body {
  padding: 17px;
  display: grid;
  gap: 9px;
}

.card-body h3,
.entry-card-body h3,
.isopod-card-body h3 {
  margin: 0;
  color: var(--green-dark);
}

.card-meta,
.entry-meta,
.isopod-meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.card-footer {
  margin-top: auto;
  padding: 0 17px 17px;
}

/* ---------- Badges / pills ---------- */

.badge,
.status-badge,
.genus-pill,
.type-pill,
.tag,
.user-pill,
.role-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
}

.badge,
.status-badge {
  color: var(--green-dark);
  background: var(--green-light);
  border: 1px solid rgba(21, 130, 75, 0.18);
}

.badge.verified,
.status-verified,
.verified {
  color: #064321;
  background: #dff5e6;
  border-color: rgba(21, 130, 75, 0.25);
}

.badge.pending,
.status-pending,
.pending {
  color: #654308;
  background: #fff0c4;
  border-color: rgba(213, 169, 79, 0.35);
}

.badge.contested,
.status-contested,
.contested,
.badge.warning {
  color: #76271f;
  background: var(--red-light);
  border-color: rgba(177, 59, 48, 0.25);
}

.badge.info {
  color: #164d6d;
  background: var(--blue-light);
  border-color: rgba(45, 111, 149, 0.25);
}

.genus-pill,
.type-pill,
.user-pill,
.role-pill {
  color: var(--green-dark);
  background: rgba(6, 59, 34, 0.08);
  border: 1px solid rgba(6, 59, 34, 0.14);
}

.type-pill {
  color: #5f4312;
  background: var(--gold-light);
  border-color: rgba(213, 169, 79, 0.28);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-row.large {
  gap: 9px;
  margin-top: 14px;
}

.tag {
  color: #24442d;
  background: rgba(15, 107, 60, 0.1);
  border: 1px solid rgba(15, 107, 60, 0.15);
}

/* ---------- Species page ---------- */

.species-hero {
  display: grid;
  grid-template-columns: minmax(260px, 380px) minmax(0, 1fr);
  gap: clamp(18px, 4vw, 34px);
  align-items: center;
  padding: clamp(18px, 3vw, 32px);
  margin-bottom: 22px;
}

.species-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 24px;
  background: var(--green-light);
  border: 1px solid rgba(6, 59, 34, 0.16);
  box-shadow: var(--shadow-soft);
}

.care-grid,
.detail-grid,
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.care-item,
.detail-item,
.profile-stat {
  padding: 14px;
  border-radius: var(--radius);
  background: rgba(6, 59, 34, 0.055);
  border: 1px solid rgba(6, 59, 34, 0.1);
}

.care-item strong,
.detail-item strong,
.profile-stat strong {
  display: block;
  margin-bottom: 4px;
  color: var(--green-dark);
}

.photo-gallery {
  margin-bottom: 22px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.photo-card,
.photo-thumb-card {
  overflow: hidden;
  border-radius: var(--radius);
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.photo-thumb,
.photo-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  cursor: zoom-in;
}

.photo-credit,
.photo-meta {
  padding: 9px 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.photo-upload-box {
  margin-top: 16px;
  padding: 16px;
  border-radius: var(--radius);
  background: rgba(6, 59, 34, 0.055);
  border: 1px dashed rgba(6, 59, 34, 0.22);
}

/* ---------- Forms ---------- */

.form-card {
  max-width: 860px;
  margin-inline: auto;
}

form {
  display: grid;
  gap: 14px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field,
.form-field {
  display: grid;
  gap: 7px;
}

label {
  color: var(--green-dark);
  font-weight: 850;
}

.help-text,
.form-help {
  color: var(--muted);
  font-size: 0.88rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(6, 59, 34, 0.18);
  border-radius: var(--radius-sm);
  background: #ffffff;
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto;
  accent-color: var(--green);
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(21, 130, 75, 0.62);
  box-shadow: 0 0 0 4px rgba(21, 130, 75, 0.14);
}

.checkbox-row,
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.checkbox-row label,
.check-row label {
  font-weight: 700;
}

.form-section {
  padding: 16px;
  border-radius: var(--radius);
  background: rgba(6, 59, 34, 0.045);
  border: 1px solid rgba(6, 59, 34, 0.1);
}

.form-section h3 {
  margin-bottom: 10px;
}

/* ---------- Buttons ---------- */

.button,
button.button,
input[type="submit"],
button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: fit-content;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #ffffff;
  color: var(--green-dark);
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  box-shadow: none;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.button:hover,
input[type="submit"]:hover,
button[type="submit"]:hover {
  transform: translateY(-1px);
  text-decoration: none;
  box-shadow: var(--shadow-soft);
}

.button.primary,
input[type="submit"],
button[type="submit"] {
  background: linear-gradient(135deg, var(--green), var(--green-2));
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.15);
}

.button.secondary {
  background: var(--gold-light);
  color: #573b07;
  border-color: rgba(213, 169, 79, 0.32);
}

.button.warning {
  background: #fff0c4;
  color: #6b4707;
  border-color: rgba(213, 169, 79, 0.35);
}

.button.danger {
  background: var(--red-light);
  color: #76271f;
  border-color: rgba(177, 59, 48, 0.25);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(6, 59, 34, 0.14);
}

.button.small {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 0.84rem;
}

.button.full {
  width: 100%;
}

/* ---------- Notices ---------- */

.notice,
.form-notice,
#formNotice,
.message,
.alert {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(6, 59, 34, 0.12);
  background: rgba(6, 59, 34, 0.06);
  color: var(--green-dark);
  font-weight: 750;
}

.notice.success,
.form-notice.success,
#formNotice.success,
.message.success,
.alert.success,
.success {
  background: #e2f8e8;
  color: #064321;
  border-color: rgba(21, 130, 75, 0.26);
}

.notice.error,
.form-notice.error,
#formNotice.error,
.message.error,
.alert.error,
.error {
  background: var(--red-light);
  color: #76271f;
  border-color: rgba(177, 59, 48, 0.25);
}

.notice.info,
.form-notice.info,
#formNotice.info,
.message.info,
.alert.info,
.info {
  background: var(--blue-light);
  color: #164d6d;
  border-color: rgba(45, 111, 149, 0.24);
}

.notice.warning,
.form-notice.warning,
#formNotice.warning,
.message.warning,
.alert.warning {
  background: #fff0c4;
  color: #654308;
  border-color: rgba(213, 169, 79, 0.35);
}

/* ---------- Verify / review pages ---------- */

.review-list,
.pending-list,
.dispute-list,
.contribution-list,
.admin-list,
.changelog-list {
  display: grid;
  gap: 16px;
}

.review-card,
.contribution-card,
.dispute-card {
  display: grid;
  gap: 12px;
}

.review-header,
.contribution-header,
.dispute-header,
.admin-card-header,
.changelog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.review-actions,
.admin-actions,
.contribution-actions,
.dispute-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.compare-box,
.proposed-box,
.original-box,
.json-box {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(6, 59, 34, 0.055);
  border: 1px solid rgba(6, 59, 34, 0.1);
  overflow-wrap: anywhere;
}

.proposed-box {
  background: rgba(213, 169, 79, 0.12);
  border-color: rgba(213, 169, 79, 0.26);
}

pre,
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

pre {
  margin: 0;
  white-space: pre-wrap;
}

/* ---------- Account / profile ---------- */

.account-grid,
.admin-grid,
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--green), var(--gold));
  color: #ffffff;
  font-weight: 950;
  font-size: 1.4rem;
}

.reputation-score {
  font-size: 2.4rem;
  line-height: 1;
  font-weight: 950;
  color: var(--green-dark);
}

.leaderboard,
.reputation-list {
  display: grid;
  gap: 10px;
}

.leaderboard-row,
.reputation-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(6, 59, 34, 0.055);
  border: 1px solid rgba(6, 59, 34, 0.1);
}

/* ---------- FAQ / details ---------- */

.faq-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

details {
  border: 1px solid rgba(6, 59, 34, 0.12);
  border-radius: var(--radius);
  background: rgba(6, 59, 34, 0.045);
  overflow: hidden;
}

summary {
  cursor: pointer;
  padding: 14px 16px;
  color: var(--green-dark);
  font-weight: 900;
}

details p,
details ul,
details ol {
  padding: 0 16px;
}

details p:last-child,
details ul:last-child,
details ol:last-child {
  padding-bottom: 16px;
}

/* ---------- Donators ---------- */

.donator-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.donator-card {
  text-align: center;
}

.donator-name {
  color: var(--green-dark);
  font-weight: 950;
  font-size: 1.15rem;
}

.donator-amount {
  color: #6b4707;
  font-weight: 900;
}

/* ---------- Tables ---------- */

.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid rgba(6, 59, 34, 0.12);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(6, 59, 34, 0.1);
  vertical-align: top;
}

th {
  color: var(--green-dark);
  background: rgba(6, 59, 34, 0.065);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

tr:last-child td {
  border-bottom: 0;
}

/* ---------- Modals / photo lightbox ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
}

.modal-panel {
  position: relative;
  width: min(760px, 100%);
  max-height: 90vh;
  overflow: auto;
  border-radius: var(--radius-lg);
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.4);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #ffffff;
  font-size: 1.4rem;
  line-height: 1;
}

.photo-lightbox-panel {
  width: min(980px, 100%);
  padding: 10px;
  background: rgba(7, 19, 13, 0.96);
}

.photo-lightbox-image {
  width: 100%;
  max-height: 82vh;
  object-fit: contain;
  border-radius: var(--radius);
}

/* ---------- Utility ---------- */

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.88rem;
}

.center {
  text-align: center;
}

.right {
  text-align: right;
}

.soft-box {
  padding: 14px;
  border-radius: var(--radius);
  background: rgba(6, 59, 34, 0.055);
  border: 1px solid rgba(6, 59, 34, 0.1);
}

.divider {
  height: 1px;
  margin: 18px 0;
  background: rgba(6, 59, 34, 0.12);
}

.footer {
  padding: 28px 0 42px;
  color: rgba(255, 255, 255, 0.74);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer p {
  margin: 0;
}

/* ---------- Loading / empty states ---------- */

.empty-state {
  text-align: center;
}

.empty-state h2 {
  margin-bottom: 7px;
}

.loading {
  opacity: 0.72;
  pointer-events: none;
}

/* ---------- Public changelog / admin extras ---------- */

.change-item,
.log-item {
  padding: 14px;
  border-radius: var(--radius);
  background: rgba(6, 59, 34, 0.055);
  border: 1px solid rgba(6, 59, 34, 0.1);
}

.change-meta,
.log-meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.points-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  background: var(--gold-light);
  color: #5d3f0a;
  border: 1px solid rgba(213, 169, 79, 0.32);
  font-size: 0.8rem;
  font-weight: 950;
}

/* ---------- Mobile ---------- */

@media (max-width: 900px) {
  .site-shell {
    width: min(100% - 24px, var(--shell));
  }

  .nav-primary-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .hero {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .hero-logo,
  .hero-image {
    width: 220px;
  }

  .grid,
  .results-grid,
  .card-grid,
  #resultsGrid,
  #recentGrid,
  .recent-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .species-hero {
    grid-template-columns: 1fr;
  }

  .species-image {
    max-width: 440px;
  }

  .photo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .two-col,
  .three-col,
  .form-grid,
  .care-grid,
  .detail-grid,
  .profile-grid,
  .compare-grid,
  .account-grid,
  .admin-grid,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .donator-grid,
  .stats-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .main {
    padding-top: 20px;
  }

  .brand-logo {
    width: 44px;
    height: 44px;
    max-width: 44px;
    max-height: 44px;
  }

  .brand-title {
    font-size: 1rem;
  }

  .nav-links a {
    min-height: 32px;
    padding: 6px 9px;
    font-size: 0.82rem;
  }

  .content-card,
  .search-card,
  .form-card,
  .empty-state,
  .account-card,
  .verify-card,
  .review-card,
  .contribution-card,
  .dispute-card,
  .donator-card,
  .profile-card,
  .changelog-card,
  .admin-card {
    border-radius: 20px;
    padding: 17px;
  }

  .hero {
    border-radius: 24px;
    padding: 22px;
  }

  .grid,
  .results-grid,
  .card-grid,
  #resultsGrid,
  #recentGrid,
  .recent-grid {
    grid-template-columns: 1fr;
  }

  .card-image,
  .entry-image,
  .isopod-image,
  .species-card img,
  .result-card img {
    height: 230px;
  }

  .photo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-row {
    flex-direction: column;
    align-items: stretch;
  }

  .button,
  button.button,
  input[type="submit"],
  button[type="submit"] {
    width: 100%;
  }

  .hero-actions .button,
  .action-row .button,
  .button-row .button,
  .review-actions .button,
  .admin-actions .button,
  .contribution-actions .button,
  .dispute-actions .button {
    width: 100%;
  }
}