@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600&display=swap");
@import url("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css");

:root {
  --bg: #f3f4ee;
  --fg: #1f2332;
  --muted: #5f6474;
  --border: #d4d9e5;
  --accent: #0f766e;
  --accent-strong: #0b5a54;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: #ffffff;
  --warn-bg: #fff4d7;
  --warn-fg: #6f5312;
  --err-bg: #fee6e4;
  --err-fg: #8b2d2a;
  --ok-bg: #d8efe7;
  --ok-fg: #185b49;
  --code-bg: #edf2f6;
  --shadow-soft: 0 12px 30px rgba(31, 35, 50, 0.08);
  --shadow-card: 0 20px 45px rgba(31, 35, 50, 0.1);
  --topbar-height: 56px;
  --footer-height: 86px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  color: var(--fg);
  background:
    radial-gradient(1200px 600px at -10% -15%, #d2efe8 0%, transparent 62%),
    radial-gradient(900px 500px at 110% 8%, #f5dbbc 0%, transparent 60%),
    linear-gradient(180deg, #f8f9f4 0%, var(--bg) 100%);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--footer-height) + 12px);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code,
pre {
  font-family: "JetBrains Mono", Consolas, monospace;
  background: var(--code-bg);
  padding: 1px 4px;
  border-radius: 3px;
}

pre {
  padding: 8px;
  overflow-x: auto;
}

.topbar {
  background: rgba(255, 255, 255, 0.68);
  border-bottom: 1px solid rgba(212, 217, 229, 0.8);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  font-size: 1.05rem;
}

.topbar .is-active {
  font-weight: 700;
}

.brand.is-active {
  color: #0b5a54;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
}

.topbar nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  flex-grow: 1;
}

.topbar nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 3px 10px;
  border: 1px solid rgba(196, 206, 221, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #2b394c;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.topbar nav a:hover {
  text-decoration: none;
  background: #edf7f5;
  border-color: rgba(129, 174, 168, 0.9);
}

.topbar nav a.is-active {
  background: linear-gradient(140deg, rgba(15, 118, 110, 0.94) 0%, rgba(13, 99, 93, 0.94) 100%);
  border-color: rgba(12, 92, 86, 0.95);
  color: #f6fffd;
  box-shadow: 0 6px 14px rgba(11, 90, 84, 0.28);
}

.topbar nav a.is-active:hover {
  background: linear-gradient(140deg, rgba(13, 99, 93, 0.96) 0%, rgba(10, 84, 79, 0.96) 100%);
  border-color: rgba(10, 84, 79, 0.98);
}

.topbar .logout {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}

.topbar-avatar-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(196, 206, 221, 0.9);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.72);
  text-decoration: none;
}

.topbar-avatar-link:hover {
  text-decoration: none;
  background: #edf7f5;
}

.topbar-avatar-link.is-active {
  border-color: rgba(12, 92, 86, 0.95);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.18);
}

.topbar-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(196, 206, 221, 0.9);
}

.profile-grid {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 16px;
}

.profile-card {
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  box-shadow: var(--shadow-soft);
}

.profile-avatar {
  width: 132px;
  height: 132px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(196, 206, 221, 0.9);
}

.profile-stack {
  display: grid;
  gap: 12px;
}

@media (max-width: 880px) {
  .profile-grid {
    grid-template-columns: 1fr;
  }
}

.container {
  max-width: 1180px;
  margin: 22px auto;
  padding: 0 16px 24px;
  flex: 1 0 auto;
  width: 100%;
}

.site-footer {
  border-top: 1px solid rgba(212, 217, 229, 0.9);
  background: linear-gradient(180deg, rgba(252, 253, 250, 0.8) 0%, rgba(242, 245, 238, 0.95) 100%);
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.site-footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  align-items: center;
}

.site-footer-brand {
  margin: 0;
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.site-footer-copy {
  margin: 0;
  color: #475062;
  font-size: 13px;
  grid-column: 1 / 2;
}

.site-footer-links {
  margin: 0;
  font-size: 13px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  grid-column: 2 / 3;
  grid-row: 1 / 3;
}

.about-card p,
.about-card ul {
  max-width: 90ch;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  margin: 8px 0;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

th,
td {
  border-bottom: 1px solid rgba(212, 217, 229, 0.7);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  background: #f4f7f8;
  font-weight: 600;
}

tr:last-child td {
  border-bottom: 0;
}

table.diff pre {
  white-space: pre-wrap;
  word-break: break-word;
  max-width: 360px;
}

.warn {
  background: var(--warn-bg);
  color: var(--warn-fg);
  padding: 4px 8px;
  border-radius: 4px;
  margin: 2px 0;
}

.err {
  background: var(--err-bg);
  color: var(--err-fg);
  padding: 4px 8px;
  border-radius: 4px;
}

.ok {
  background: var(--ok-bg);
  color: var(--ok-fg);
  padding: 4px 8px;
  border-radius: 4px;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

form .field {
  margin: 8px 0;
}

form label {
  display: block;
  font-weight: 600;
  margin: 4px 0;
}

form input[type=text],
form input[type=email],
form input[type=password],
form input[type=number],
form input[type=search],
form select,
form textarea {
  display: block;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #cfd6e3;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  font: inherit;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

form input[type=text]:focus,
form input[type=email]:focus,
form input[type=password]:focus,
form input[type=number]:focus,
form input[type=search]:focus,
form select:focus,
form textarea:focus {
  border-color: rgba(15, 118, 110, 0.65);
  outline: 0;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.14);
  background: #fff;
}

form textarea {
  font-family: inherit;
}

form button {
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

form .inline-form {
  display: inline-flex;
  align-items: end;
  gap: 6px;
  margin-right: 12px;
}

.inline-form {
  display: inline-flex;
  align-items: end;
  gap: 6px;
  margin-right: 12px;
}

form .inline-form label {
  font-weight: normal;
}

fieldset {
  border: 1px solid rgba(212, 217, 229, 0.85);
  border-radius: 16px;
  margin: 14px 0;
  padding: 14px 16px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

fieldset legend {
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0 8px;
}

.preview {
  margin-top: 4px;
}

.preview pre.tagged {
  background: #f0f6ff;
  border-left: 3px solid var(--accent);
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
  align-items: start;
}

.image-section-group {
  margin-top: 14px;
}

.image-section-group h3 {
  margin: 0 0 9px;
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-size: 1.03rem;
}

.image-grid figure {
  margin: 0;
  background: #fff;
  border: 1px solid rgba(186, 199, 218, 0.85);
  border-radius: 16px;
  padding: 11px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  min-width: 0;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.image-card:hover {
  border-color: rgba(15, 118, 110, 0.36);
  box-shadow: var(--shadow-card);
  transform: translateY(-1px);
}

.image-candidate {
  margin: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
}

.image-candidate:hover {
  border-color: rgba(15, 118, 110, 0.35);
  box-shadow: var(--shadow-card);
}

.image-candidate-select {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.image-candidate-select input[type=checkbox] {
  margin: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  flex: none;
}

.image-candidate-preview {
  width: 100%;
}

.image-candidate-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.image-candidate .badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
}

.image-card-preview {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(212, 217, 229, 0.85);
  background: linear-gradient(180deg, #f7f9fc 0%, #e9eff8 100%);
  padding: 0;
  cursor: zoom-in;
}

button.image-card-preview {
  border: 0;
}

.image-card-preview:hover img {
  transform: scale(1.03);
}

.image-card-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  transition: transform 180ms ease;
}

.image-card figcaption {
  min-width: 0;
}

.image-card-meta {
  display: grid;
  gap: 4px;
}

.image-card-filename {
  overflow-wrap: anywhere;
}

.image-card-path {
  overflow-wrap: anywhere;
  word-break: break-word;
  font-size: 11px;
}

.image-edit-form.inline-form {
  display: grid;
  gap: 8px;
  margin: 10px 0 8px;
}

.image-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.image-field {
  display: grid;
  gap: 4px;
  margin: 0;
}

.image-field-inline {
  min-width: 0;
}

.image-field-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #4a5568;
}

.image-edit-form.inline-form input,
.image-edit-form.inline-form select {
  min-height: 34px;
}

.image-field-sort input[type=number] {
  text-align: center;
}

.image-form-hidden-submit {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  border: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.image-form-actions {
  margin-top: 2px;
  align-items: stretch;
}

.image-form-actions .btn,
.image-form-actions .image-delete-form .btn,
.image-form-actions .image-delete-form {
  width: 100%;
}

.image-save-btn.is-dirty {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  color: #fff;
  border-color: #a44a08;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.22);
}

.image-delete-form.inline-form {
  display: block;
  margin: 0;
}

.image-edit-form .btn,
.image-delete-form .btn {
  width: 100%;
}

@media (max-width: 640px) {
  .image-grid {
    grid-template-columns: 1fr;
  }

  .image-grid figure {
    padding: 10px;
  }

  .image-form-row {
    grid-template-columns: 1fr;
  }
}

.section-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.section-images img {
  max-height: 120px;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.1s;
}

.section-images img:hover {
  opacity: 0.85;
}

/* ── Detail-panel image carousel ──────────────────────────────────── */
.section-carousel {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: #f0f3f8;
  user-select: none;
  touch-action: pan-y;
}

.sc-viewport {
  overflow: hidden;
  border-radius: 12px 12px 0 0;
}

.sc-track {
  display: flex;
  transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.sc-slide {
  flex: none;
  width: 100%;
  position: relative;
}

.sc-slide img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
}

.sc-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px 10px;
  background: rgba(0, 0, 0, 0.48);
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
}

.sc-btn {
  position: absolute;
  top: calc(50% - 18px);
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 22px;
  line-height: 32px;
  text-align: center;
  cursor: pointer;
  z-index: 2;
  padding: 0;
  opacity: 0;
  transition: opacity 150ms ease, background 120ms ease;
}

.section-carousel:hover .sc-btn,
.section-carousel:focus-within .sc-btn {
  opacity: 1;
}

.sc-btn:hover {
  background: rgba(0, 0, 0, 0.7);
}

.sc-prev {
  left: 8px;
}

.sc-next {
  right: 8px;
}

.sc-footer {
  display: flex;
  justify-content: center;
  padding: 7px 0 6px;
  background: #f0f3f8;
}

.sc-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}

.sc-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  transition: background 180ms ease, transform 180ms ease;
  cursor: pointer;
}

.sc-dot.active {
  background: var(--accent, #0f766e);
  transform: scale(1.35);
}

.pager {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 12px 0;
}

.matrix select {
  width: auto;
  min-width: 220px;
}

.search {
  margin: 10px 0;
  display: flex;
  gap: 8px;
  align-items: center;
}

.search input {
  flex-grow: 1;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 16px;
}

.admin-tabs a {
  border: 1px solid rgba(196, 206, 221, 0.9);
  background: rgba(255, 255, 255, 0.74);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #2b394c;
  letter-spacing: 0.01em;
  transition: background 120ms ease, border-color 120ms ease;
}

.admin-tabs a.active {
  background: linear-gradient(135deg, #0f766e 0%, #0e6861 100%);
  color: #fff;
  border-color: var(--accent);
}

.admin-tabs a:hover {
  text-decoration: none;
  border-color: rgba(129, 174, 168, 0.9);
  background: #edf7f5;
}

.section-drag-cell {
  width: 34px;
  text-align: center;
  cursor: grab;
}

.section-drag-handle {
  color: #567;
  font-weight: 700;
  letter-spacing: 1px;
  -webkit-user-select: none;
  user-select: none;
}

#sections-sortable [data-section-row].is-dragging {
  opacity: 0.58;
  background: #edf7f5;
}

#sections-sortable [data-section-row].drop-before {
  box-shadow: inset 0 3px 0 #0f766e;
}

#sections-sortable [data-section-row].drop-after {
  box-shadow: inset 0 -3px 0 #0f766e;
}

.section-reorder-actions {
  margin-top: 10px;
}

.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-card {
  background: #fff;
  padding: 24px;
  border-radius: 8px;
  border: 1px solid var(--border);
  width: 320px;
}

/* List view */
.flash {
  background: var(--ok-bg);
  color: var(--ok-fg);
  padding: 8px 12px;
  border-radius: 4px;
  margin: 8px 0;
}

table.entries-list .thumb-col {
  width: 64px;
  padding: 4px;
}

table.entries-list .actions-col {
  width: 1%;
  white-space: nowrap;
  font-size: 12px;
}

table.entries-list img.thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

table.entries-list a {
  color: inherit;
}

table.entries-list a:hover {
  color: var(--accent);
}

table.entries-list .actions-col a {
  color: var(--accent);
}

/* Detail view */
.detail-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
  font-size: 13px;
}

.detail-nav .spacer {
  flex-grow: 1;
}

.entry-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.entry-header h1 {
  margin: 0;
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-size: clamp(1.45rem, 2vw, 1.9rem);
  letter-spacing: 0.01em;
}

.entry-header .entry-id {
  font-size: 14px;
  font-family: "JetBrains Mono", Consolas, monospace;
  margin-right: 8px;
}

.entry-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.page-subheader {
  position: relative;
}

.page-subheader.is-pinnable {
  padding: 10px 44px 10px 0;
}

.page-subheader.is-fixed {
  position: sticky;
  top: calc(var(--topbar-height) + 10px);
  z-index: 19;
  padding: 10px 44px 10px 0;
}

.page-subheader.is-fixed::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc((100vw - 100%) / -2);
  right: calc((100vw - 100%) / -2);
  z-index: -1;
  border-top: 1px solid rgba(201, 210, 221, 0.92);
  border-bottom: 1px solid rgba(201, 210, 221, 0.92);
  background: rgba(248, 250, 245, 0.94);
  box-shadow: 0 14px 28px rgba(31, 35, 50, 0.12);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.page-subheader.is-fixed+* {
  margin-top: 14px;
}

.detail-subheader.is-pinnable .detail-nav,
.detail-subheader.is-fixed .detail-nav {
  margin-bottom: 10px;
}

.subheader-pin-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 32px;
  padding: 4px 8px;
  border: 1px solid rgba(183, 194, 208, 0.95);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #304050;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.subheader-pin-btn:hover {
  background: #edf7f5;
}

.subheader-pin-btn[aria-pressed="true"] {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.94) 0%, rgba(11, 90, 84, 0.94) 100%);
  border-color: rgba(11, 90, 84, 0.94);
  color: #f8fffe;
}

.edit-hero {
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid rgba(173, 201, 196, 0.8);
  border-radius: 14px;
  background: linear-gradient(120deg, rgba(230, 248, 244, 0.9) 0%, rgba(250, 245, 233, 0.84) 100%);
  box-shadow: var(--shadow-soft);
}

.edit-hero-kicker {
  margin: 0 0 4px;
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1e5f59;
  font-weight: 700;
}

.edit-hero-text {
  margin: 0;
  color: #2f4154;
}

.btn {
  display: inline-block;
  padding: 7px 13px;
  border: 1px solid #cfd6e3;
  border-radius: 999px;
  background: #fff;
  color: var(--fg);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.btn:hover {
  background: #f3f7f7;
  box-shadow: 0 6px 16px rgba(31, 35, 50, 0.1);
  transform: translateY(-1px);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, #0f766e 0%, #0f766e 45%, #0b5a54 100%);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #12867d 0%, #12867d 45%, #0e6660 100%);
  color: #fff;
}

.btn-danger {
  background: #fff;
  color: var(--err-fg);
  border-color: var(--err-fg);
}

.btn-danger:hover {
  background: var(--err-bg);
}

.inline-form {
  display: inline;
  margin: 0;
  padding: 0;
}

.entry-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  margin: 12px 0;
}

.entry-section h2 {
  margin: 0 0 8px;
  font-size: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.entry-section .field {
  margin: 8px 0;
}

.entry-section .field-label {
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.entry-section .text-field .field-label {
  display: block;
  margin-bottom: 2px;
}

.entry-section .numeric-field .field-label,
.entry-section .range-field .field-label {
  display: inline-block;
  min-width: 180px;
  margin-right: 8px;
}

.entry-section .field-value {
  font-size: 14px;
}

.name-combo-value {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  line-height: 1.25;
}

.name-main {
  font-weight: 700;
  font-size: 16px;
}

.name-scientific {
  display: block;
  font-style: italic;
  color: var(--muted);
  font-size: 13px;
}

.entry-section .section-content.has-images {
  display: block;
}

.entry-section .section-media {
  margin-top: 10px;
}

@media (min-width: 980px) {
  .entry-section .section-content.has-images {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 16px;
    align-items: start;
  }

  .entry-section .section-content.has-images .section-media {
    margin-top: 0;
  }

  .entry-section .section-content.has-images .section-carousel {
    width: 100%;
  }

  .entry-section .section-content.has-images .sc-slide img {
    aspect-ratio: 4 / 3;
  }
}

.entry-section .month-field .field-label {
  display: block;
  margin-bottom: 4px;
}

.month-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.month-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  padding: 2px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.month-badge.active {
  border-color: #8cb4ff;
  background: #eaf2ff;
  color: #1e4fa8;
}

.month-badge.inactive {
  border-color: #d8dee4;
  background: #f8fafc;
  color: #8a949f;
  border: none;
}

.month-badge.active.season-winter {
  border-color: #9fbfd9;
  background: #eaf4ff;
  color: #245076;
}

.month-badge.active.season-spring {
  border-color: #9dcfa8;
  background: #ebf8ee;
  color: #23603a;
}

.month-badge.active.season-summer {
  border-color: #e2ca8d;
  background: #fff6dc;
  color: #7f5a00;
}

.month-badge.active.season-autumn {
  border-color: #ddb28a;
  background: #fff0e5;
  color: #8b4e1f;
}

.month-badge.invalid {
  border-style: dashed;
}

.entry-section .long-text {
  white-space: normal;
  line-height: 1.55;
}

a.ref {
  background: #eef4ff;
  padding: 0 3px;
  border-radius: 3px;
}

a.ref:hover {
  text-decoration: none;
  background: #dde9ff;
}

a.ref-tiere {
  background: #fff0e0;
}

a.ref-pflanzen {
  background: #e8f6e0;
}

a.ref-pflanzgesellschaft {
  background: #efe6ff;
}

a.ref-glossar {
  background: #eef4ff;
}

.ref-broken {
  background: var(--err-bg);
  color: var(--err-fg);
  padding: 0 3px;
  border-radius: 3px;
  text-decoration: line-through;
}

/* Reference hover preview (Wikipedia-style hover card) */
.ref-popover {
  position: absolute;
  z-index: 1000;
  width: 360px;
  max-width: calc(100vw - 16px);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(20, 30, 50, 0.18), 0 2px 8px rgba(20, 30, 50, 0.08);
  font-size: 13px;
  line-height: 1.5;
  color: var(--fg);
  overflow: hidden;
}

.ref-popover[hidden] {
  display: none;
}

.ref-popover-arrow {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fff;
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  transform: rotate(45deg);
  pointer-events: none;
}

.ref-popover[data-placement="bottom"] .ref-popover-arrow {
  top: -7px;
}

.ref-popover[data-placement="top"] .ref-popover-arrow {
  bottom: -7px;
  transform: rotate(225deg);
}

.ref-popover-body {
  display: flex;
  flex-direction: column;
}

.ref-popover-image {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  display: block;
  background: var(--code-bg);
}

.ref-popover-text {
  padding: 10px 12px;
}

.ref-popover-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.ref-popover-title a {
  font-weight: 600;
  font-size: 14px;
  color: var(--fg);
}

.ref-popover-title a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.ref-popover-meta {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 3px;
  color: var(--muted);
  background: var(--code-bg);
}

.ref-popover-desc {
  margin: 0;
  white-space: normal;
}

.ref-popover-desc.muted {
  color: var(--muted);
  font-style: italic;
}

.ref-popover-loading,
.ref-popover-error {
  padding: 12px;
  color: var(--muted);
  font-style: italic;
}

.ref-popover-error {
  color: var(--err-fg);
}

/* ---- Month picker ---- */
.month-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.month-tile {
  width: 44px;
  padding: 5px 0;
  border: 1px solid #ccd4e2;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--fg);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.month-tile:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.month-tile.active {
  background: linear-gradient(145deg, #0f766e, #0d645e);
  border-color: #0f766e;
  color: #fff;
}

.month-tile:disabled {
  cursor: default;
  opacity: 0.7;
}

/* ---- Ordinal dot scale ---- */
.ordinal-scale {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

.ordinal-dot {
  width: 40px;
  height: 40px;
  border: 1px solid #ccd4e2;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s, border-color 0.1s;
  padding: 0;
}

.ordinal-dot:hover:not(:disabled) {
  border-color: var(--accent);
  background: #ecf7f5;
}

.ordinal-dot.filled {
  background: var(--accent);
  border-color: var(--accent);
}

.ordinal-dot:disabled {
  cursor: default;
  opacity: 0.7;
}

.ordinal-dot.readonly {
  cursor: default;
}

.ordinal-icon {
  width: 28px;
  height: 28px;
  background: #8a949f;
  display: inline-block;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  transform: scale(0.82);
  transform-origin: center;
}

.ordinal-icon--star {
  -webkit-mask-image: url("/static/icons/ordinal/star.svg");
  mask-image: url("/static/icons/ordinal/star.svg");
}

.ordinal-icon--nectar {
  -webkit-mask-image: url("/static/icons/ordinal/nectar.svg");
  mask-image: url("/static/icons/ordinal/nectar.svg");
}

.ordinal-icon--pollen {
  -webkit-mask-image: url("/static/icons/ordinal/pollen.svg");
  mask-image: url("/static/icons/ordinal/pollen.svg");
}

.ordinal-icon--shovel {
  -webkit-mask-image: url("/static/icons/ordinal/shovel.svg");
  mask-image: url("/static/icons/ordinal/shovel.svg");
}

.ordinal-dot.filled .ordinal-icon {
  background: #fff;
}

.ordinal-value {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.ordinal-count {
  font-size: 12px;
  color: var(--muted);
}

/* Image drop zone */
.drop-zone {
  border: 2px dashed #bfd2ce;
  border-radius: 14px;
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.86);
  transition: border-color .15s, background .15s;
  margin: 8px 0;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent);
  background: #edf8f6;
}

.drop-zone .drop-hint {
  color: var(--muted);
  font-size: 13px;
  pointer-events: none;
}

.drop-preview img {
  max-height: 120px;
  max-width: 100%;
  border-radius: 4px;
  display: block;
}

/* Status maps */
.status-map-section {
  border: 1px solid rgba(143, 157, 182, 0.45);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(241, 247, 250, 0.9) 100%);
}

.status-map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.status-map-card {
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 12px;
  background: #fff;
  padding: 10px;
}

.status-map-card h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.status-map-canvas {
  height: 320px;
  border-radius: 10px;
  border: 1px solid #d8e0ea;
  background: #f8fafc;
}

.status-map-message {
  margin: 6px 0 8px;
  font-size: 12px;
}

.status-map-legend {
  margin-bottom: 8px;
}

.status-map-legend-title {
  font-size: 12px;
  font-weight: 700;
  color: #344054;
  margin-bottom: 4px;
}

.status-map-selector {
  margin-bottom: 8px;
}

.status-map-selector label {
  display: block;
  font-size: 12px;
  margin-bottom: 4px;
  color: var(--muted);
}

.status-map-selector select {
  width: 100%;
}

.status-map-legend-list {
  list-style: none;
  padding: 0;
  margin: 0;
  column-count: 2;
  column-gap: 10px;
  font-size: 11px;
}

.status-map-legend-list li {
  break-inside: avoid;
  margin-bottom: 5px;
}

.status-chip {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  margin-right: 6px;
}

.status-map-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* Edit form polish */
.entry-form fieldset {
  background: #fff;
}

.entry-form .field-text textarea,
.entry-form textarea {
  min-height: 90px;
}

.entry-form .field-range-pair .range-pair-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.entry-form .field-range-pair .range-pair-input {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.entry-form .form-actions {
  display: flex;
  gap: 8px;
  margin: 20px 0;
}

.entry-form {
  animation: fade-slide-in 380ms ease;
}

@keyframes fade-slide-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 840px) {
  .status-map-grid {
    grid-template-columns: 1fr;
  }

  .status-map-canvas {
    height: 280px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar nav {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
    gap: 6px;
  }

  .topbar nav a {
    width: 100%;
    min-height: 32px;
    padding: 3px 8px;
    border-radius: 10px;
  }

  .entry-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .entry-actions {
    width: 100%;
  }

  .page-subheader.is-pinnable,
  .page-subheader.is-fixed {
    padding-right: 40px;
  }

  .site-footer-inner {
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: flex-start;
  }

  .site-footer-copy {
    grid-column: auto;
  }

  .site-footer-links {
    grid-column: auto;
    grid-row: auto;
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Lightbox */
#lb-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

#lb-overlay[hidden] {
  display: none;
}

#lb-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 1;
}

#lb-controls button {
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  color: #fff;
  border-radius: 4px;
  padding: 6px 11px;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

#lb-controls button:hover {
  background: rgba(255, 255, 255, 0.28);
}

#lb-stage {
  flex: 1;
  display: flex;
  align-items: center;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

#lb-img {
  max-width: calc(100% - 104px);
  max-height: 100%;
  object-fit: contain;
  display: block;
  margin: auto;
  border-radius: 4px;
}

.lb-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  color: #fff;
  font-size: 36px;
  line-height: 1;
  padding: 10px 14px;
  cursor: pointer;
  border-radius: 4px;
  -webkit-user-select: none;
  user-select: none;
  z-index: 1;
}

.lb-nav-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

#lb-prev {
  left: 12px;
}

#lb-next {
  right: 12px;
}

#lb-info {
  padding: 6px 16px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  text-align: center;
  min-height: 24px;
  flex-shrink: 0;
}

#lb-info a {
  color: rgba(140, 190, 255, 0.9);
}

#lb-strip {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  overflow-x: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  flex-shrink: 0;
}

.lb-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.45;
  border: 2px solid transparent;
  flex-shrink: 0;
  transition: opacity 0.12s;
}

.lb-thumb:hover {
  opacity: 0.75;
}

.lb-thumb.active {
  opacity: 1;
  border-color: #fff;
}

.entry-form .form-hint {
  margin: 0 0 12px;
}

.page-head {
  margin: 0 0 14px;
}

.page-head h1 {
  margin: 0;
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-size: clamp(1.35rem, 2.1vw, 1.95rem);
  letter-spacing: 0.01em;
}

.page-kicker {
  margin: 0 0 2px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #24635c;
}

.page-head-admin-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 2px;
}

.page-head-admin-row .page-kicker {
  margin: 0;
  flex-shrink: 0;
}

.page-head-admin-row .admin-tabs {
  margin: 0;
  justify-content: flex-end;
}

.page-subline {
  margin: 4px 0 0;
  color: #495063;
  max-width: 80ch;
}

.glass-card {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(208, 216, 229, 0.86);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.table-card {
  box-shadow: var(--shadow-card);
}

.search-bar {
  padding: 10px;
  align-items: center;
  border-radius: 16px;
}

.search-bar input {
  margin: 0;
}

.search-bar .btn {
  white-space: nowrap;
}

.entries-list tbody tr {
  transition: background 120ms ease;
}

.entries-list tbody tr:hover {
  background: #f4faf9;
}

.pager-info {
  color: var(--muted);
  font-weight: 600;
}

.detail-hero {
  margin: 0 0 14px;
  padding: 14px 16px;
  border: 1px solid rgba(173, 201, 196, 0.8);
  border-radius: 14px;
  background: linear-gradient(120deg, rgba(229, 246, 242, 0.92) 0%, rgba(251, 246, 235, 0.88) 100%);
  box-shadow: var(--shadow-soft);
}

.detail-hero-kicker {
  margin: 0 0 3px;
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #1f5f59;
}

.detail-hero-text,
.detail-hero-meta {
  margin: 0;
}

.admin-card {
  margin: 14px 0;
  padding: 14px 16px;
  border: 1px solid rgba(208, 216, 229, 0.86);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.admin-card h2 {
  margin: 0 0 8px;
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
  font-size: 1.1rem;
}

.admin-card p,
.admin-card ul,
.admin-card ol {
  margin: 8px 0;
}

.admin-danger-zone {
  border-color: rgba(197, 123, 121, 0.45);
  background: linear-gradient(135deg, rgba(255, 244, 244, 0.86) 0%, rgba(255, 250, 247, 0.86) 100%);
}

.utility-card {
  margin: 14px 0;
  padding: 14px 16px;
  border: 1px solid rgba(208, 216, 229, 0.86);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-soft);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.utility-card h2,
.utility-card h3 {
  margin-top: 0;
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
}

.utility-card h2 {
  margin-bottom: 8px;
  font-size: clamp(1.02rem, 1.2vw, 1.2rem);
}

.utility-card h3 {
  margin-bottom: 6px;
}

.utility-card p,
.utility-card ul,
.utility-card ol {
  margin: 8px 0;
}

.utility-card .table-card {
  margin-top: 10px;
}

.quick-links-list {
  margin: 0;
  padding-left: 20px;
  columns: 1;
}

.quick-links-list li {
  margin: 4px 0;
  break-inside: avoid;
}

.import-form,
.export-form,
.image-upload-form,
.section-create-form {
  display: grid;
  gap: 10px;
}

.section-create-form h3 {
  margin: 0;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.section-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2100;
  background: rgba(24, 28, 37, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity 180ms ease;
}

.section-modal-backdrop[hidden] {
  display: none !important;
}

.section-modal {
  width: min(520px, 100%);
  border-radius: 16px;
  border: 1px solid rgba(208, 216, 229, 0.9);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 24px 60px rgba(20, 28, 40, 0.24);
  padding: 14px 16px;
  opacity: 0;
  transform: translateY(8px) scale(0.985);
  transition: transform 220ms cubic-bezier(0.2, 0.9, 0.25, 1), opacity 220ms ease;
}

.section-modal-backdrop.is-open {
  opacity: 1;
}

.section-modal-backdrop.is-open .section-modal {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.section-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.section-modal-header h3 {
  margin: 0;
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
}

.section-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.utility-card .inline-form {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  margin: 8px 0;
}

.utility-card figcaption .inline-form {
  display: grid;
  width: 100%;
  min-width: 0;
}

.utility-card figcaption .inline-form input,
.utility-card figcaption .inline-form button {
  width: 100%;
}

.utility-card figcaption .inline-form input {
  min-width: 0;
}

.diff-details {
  margin-top: 8px;
  padding: 10px;
}

.diff-details summary {
  cursor: pointer;
  font-weight: 600;
  color: #244b56;
}

@media (max-width: 900px) {
  .search-bar {
    flex-wrap: wrap;
    gap: 6px;
  }

  .search-bar .btn {
    width: 100%;
    justify-content: center;
  }

  .search-bar input {
    min-width: 100%;
  }

  .admin-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(98px, 1fr));
    gap: 6px;
  }

  .admin-tabs a {
    width: 100%;
    text-align: center;
    border-radius: 10px;
  }

  .page-head-admin-row {
    display: block;
  }

  .page-head-admin-row .page-kicker {
    margin: 0 0 6px;
  }

  .page-head-admin-row .admin-tabs {
    margin: 0 0 6px;
  }

  .table-card {
    display: block;
    overflow-x: auto;
  }

  .table-card th,
  .table-card td {
    padding: 7px 8px;
    font-size: 13px;
  }

  .table-card th {
    white-space: nowrap;
  }

  .table-card code {
    font-size: 12px;
  }

  .admin-card form .inline-form {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin: 8px 0;
  }

  .utility-card {
    padding: 12px;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .section-head .btn {
    width: 100%;
    justify-content: center;
  }

  .section-modal {
    border-radius: 12px;
    padding: 12px;
  }

  .section-modal-actions {
    flex-direction: column;
  }

  .section-modal-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .quick-links-list {
    columns: 1;
  }
}

.ref-suggest {
  position: absolute;
  z-index: 1100;
  width: min(420px, calc(100vw - 24px));
  max-height: 280px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(20, 30, 50, 0.16), 0 2px 8px rgba(20, 30, 50, 0.08);
}

.ref-suggest[hidden] {
  display: none;
}

.ref-suggest-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}

.ref-suggest-item {
  margin: 0;
  padding: 0;
}

.ref-suggest-button {
  display: flex;
  width: 100%;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.ref-suggest-button:hover,
.ref-suggest-button.is-active {
  background: #eef4ff;
}

.ref-suggest-main {
  min-width: 0;
}

.ref-suggest-title {
  font-weight: 600;
  color: var(--fg);
}

.ref-suggest-subtitle {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ref-suggest-meta {
  flex-shrink: 0;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--code-bg);
  color: var(--muted);
}

.ref-suggest-empty {
  padding: 10px 12px;
  color: var(--muted);
  font-style: italic;
}

/* ---------- Inline glossary creation context menu + modal ---------- */

.context-menu {
  position: fixed;
  z-index: 1200;
  min-width: 220px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(20, 30, 50, 0.18);
  padding: 4px 0;
}

.context-menu[hidden] {
  display: none;
}

.context-menu-item {
  display: block;
  width: 100%;
  padding: 9px 14px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  color: var(--fg);
}

.context-menu-item:hover {
  background: #eef4ff;
}

dialog.modal {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 20px 60px rgba(20, 30, 50, 0.24);
  width: min(480px, calc(100vw - 32px));
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface-strong);
}

dialog.modal::backdrop {
  background: rgba(10, 15, 30, 0.45);
}

.modal-header {
  padding: 20px 24px 12px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-family: "Space Grotesk", "IBM Plex Sans", sans-serif;
}

.modal-body {
  padding: 16px 24px;
}

.modal-footer {
  padding: 12px 24px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 0;
}

/* ---------- Artenliste editor ---------- */

.artenliste-editor {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.artenliste-table {
  width: 100%;
  border-collapse: collapse;
}

.artenliste-table th,
.artenliste-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.artenliste-table th {
  font-weight: 600;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.artenliste-table .artenliste-actions-col {
  width: 1%;
  white-space: nowrap;
}

.artenliste-table .artenliste-actions-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.artenliste-table .artenliste-actions-cell .inline-form {
  margin: 0;
}

.artenliste-table input[type="number"] {
  width: 80px;
}

.artenliste-table .artenliste-group-header td {
  padding: 10px 10px 4px;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--code-bg, #f6f8fa);
  border-bottom: 1px solid var(--border);
}

.artenliste-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 16px 0 6px;
}

.artenliste-add {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-end;
  gap: 10px;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 1px dashed var(--border);
  position: relative;
}

.pflanze-picker {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 260px;
  min-width: 0;
}

.pflanze-picker-search {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding-right: 32px;
}

.pflanze-picker-search.is-selected {
  background: var(--code-bg);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 13px;
}

.pflanze-picker .pflanze-picker-clear,
form .pflanze-picker .pflanze-picker-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  padding: 0;
  margin: 0;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

.pflanze-picker .pflanze-picker-clear:hover,
form .pflanze-picker .pflanze-picker-clear:hover {
  background: var(--code-bg);
  color: inherit;
}

.pflanze-picker-suggest {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 1100;
  width: min(420px, 90vw);
  max-height: 280px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(20, 30, 50, 0.16), 0 2px 8px rgba(20, 30, 50, 0.08);
}

.pflanze-picker-qm {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
}

.pflanze-picker-qm input[type="number"] {
  width: 80px;
}

.artenliste-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 6px 18px;
}

.artenliste-list li {
  padding: 4px 0;
}

.artenliste-display .btn {
  margin-top: 10px;
}

.artenliste-section {
  margin-top: 24px;
}

/* ---------- Verbreitungskarte controls ---------- */
.verbreitung-controls {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafbfc;
}

.verbreitung-controls p {
  margin: 4px 0;
}

.verbreitung-controls .verbreitung-meta {
  font-size: 12px;
}

.verbreitung-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.verbreitung-status.err {
  color: var(--err, #b3261e);
}

.verbreitung-status.ok {
  color: #1a7f37;
}

.verbreitung-dialog {
  width: min(560px, 92vw);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.verbreitung-dialog header h3 {
  margin: 0 0 4px 0;
}

.verbreitung-search-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  margin: 12px 0;
}

.verbreitung-search-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  font-size: 13px;
}

.verbreitung-candidate-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
}

.verbreitung-candidate-list li {
  margin: 0;
  padding: 0;
}

.verbreitung-candidate {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 6px;
  cursor: pointer;
  font: inherit;
}

.verbreitung-candidate:hover,
.verbreitung-candidate:focus-visible {
  background: var(--code-bg);
  border-color: #888;
}

.verbreitung-dialog footer {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

/* Verbreitungskarte preview inside controls box (edit form) */
.verbreitung-preview {
  margin: 10px 0;
}

.verbreitung-preview img {
  display: block;
  max-width: 320px;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

/* ── Leichte Sprache ─────────────────────────────────────────────── */

.leicht-text {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1.25rem;
  line-height: 1.6;
  text-align: left;
  hyphens: none;
  max-width: 60ch;
}

.leicht-text p {
  margin: 0 0 1em 0;
}

.leicht-missing-hint {
  font-size: .85rem;
  color: var(--muted);
  font-style: italic;
  margin-top: .25rem;
}

/* Topbar toggle */
.ls-toggle {
  display: flex;
  align-items: center;
  margin-right: .5rem;
}

.ls-toggle button {
  background: var(--accent-soft, #e9f4ff);
  border: 1px solid var(--accent, #2563eb);
  color: var(--accent, #2563eb);
  border-radius: 999px;
  padding: .25rem .75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.ls-toggle button[aria-pressed="true"] {
  background: var(--accent, #2563eb);
  color: #fff;
}

/* Global LS mode: slightly larger base text */
body.ls-mode .field-value.long-text {
  font-size: 1.15rem;
  line-height: 1.55;
}

body.ls-mode .leicht-text {
  font-size: 1.35rem;
}

/* Editor stats bar */
.ls-editor-stats {
  font-size: .8rem;
  color: var(--muted);
  margin-top: .25rem;
  min-height: 1.2em;
}

.ls-editor-pill {
  display: inline-block;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 999px;
  padding: .1rem .5rem;
  margin-right: .35rem;
  cursor: pointer;
  font-size: .78rem;
}

.ls-editor-pill:hover {
  background: #ffe69c;
}