/* Biodiversity page: primary nav uses the same .nav-link styles as TORI (style.css). */

.bio-auth-card {
  max-width: 440px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 28px 28px;
}

.bio-auth-card h2 {
  margin-bottom: 12px;
}

.bio-auth-lead {
  margin: 0 0 20px;
  line-height: 1.5;
}

.bio-auth-card .auth-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.bio-auth-card .input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bio-auth-card .auth-actions {
  margin-top: 8px;
}

.bio-access-hint {
  margin: 0 16px 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
  max-width: 1200px;
}

.bio-project-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.bio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid #d1d5db;
}

.bio-project-list {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.bio-project-list-header h1 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.bio-project-list-lead {
  margin: 0 0 24px;
  color: #4b5563;
  line-height: 1.5;
}

.bio-project-list-items {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.bio-project-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}

.bio-project-list-item:last-child {
  border-bottom: none;
}

.bio-project-list-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #111827;
  text-decoration: none;
  font-weight: 500;
}

.bio-project-list-link:hover {
  color: #2563eb;
}

.bio-project-list-role {
  font-size: 0.85rem;
  color: #6b7280;
  text-transform: capitalize;
}

.bio-project-list-empty {
  margin: 0;
  padding: 16px;
  border-radius: 8px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  color: #4b5563;
}

.bio-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
}

.bio-layer-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.bio-layer-toggle-label {
  font-size: 0.95rem;
  font-weight: 500;
}

.bio-layer-toggle-group {
  display: inline-flex;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  overflow: hidden;
}

.bio-layer-toggle-btn {
  margin: 0;
  padding: 6px 12px;
  border: none;
  border-right: 1px solid #d1d5db;
  background: #fff;
  color: #374151;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.bio-layer-toggle-btn:last-child {
  border-right: none;
}

.bio-layer-toggle-btn:hover {
  background: #f3f4f6;
}

.bio-layer-toggle-btn.is-active {
  background: #2563eb;
  color: #fff;
}

.bio-layer-toggle-btn.is-active:hover {
  background: #1d4ed8;
}

.bio-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
}

.bio-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
  padding: 0 16px 16px;
  align-items: start;
}

/* Natura2000-only view: map first row, data panel full-width below map. */
.bio-layout.bio-layout--natura-table {
  grid-template-columns: 1fr;
  position: relative;
}

/* Leaflet needs a definite block size; min-height alone breaks latLngToContainerPoint. */
.bio-map {
  width: 100%;
  height: 520px;
  min-height: 0;
  position: relative;
  z-index: 1;
  overflow: hidden;
  border: 1px solid #d1d5db;
  border-radius: 8px;
}

/* Defensive: global resets must not shrink tiles or vector tiles (Leaflet FAQ). */
.bio-map.leaflet-container img.leaflet-tile,
.bio-map.leaflet-container .leaflet-tile {
  max-width: none !important;
}

.bio-panel {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 12px;
  min-width: 0;
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bio-layout.bio-layout--natura-table .bio-panel {
  position: static;
  width: 100%;
  z-index: 1200;
  background: #fff;
  margin-top: 0;
  max-height: 180px;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.12);
  transition:
    max-height 260ms ease,
    margin-top 260ms ease,
    box-shadow 260ms ease;
}

.bio-layout.bio-layout--natura-table .bio-panel.bio-panel--expanded {
  max-height: 80vh;
  margin-top: calc(180px - 80vh);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.bio-panel-toggle {
  display: none;
  align-self: flex-end;
  width: 28px;
  height: 28px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #fff;
  color: #374151;
  cursor: pointer;
  line-height: 1;
  position: relative;
  z-index: 1201;
  transition: transform 220ms ease;
}

.bio-layout.bio-layout--natura-table .bio-panel.bio-panel--can-expand .bio-panel-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.bio-layout.bio-layout--natura-table .bio-panel.bio-panel--expanded .bio-panel-toggle {
  transform: rotate(180deg);
}

#bio-panel-content {
  position: relative;
  z-index: 4;
  white-space: normal;
  max-height: min(75vh, 720px);
  overflow-x: auto;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 8px;
  min-width: 0;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  align-self: center;
}

.bio-layout.bio-layout--natura-table .bio-panel #bio-panel-content {
  max-height: none;
  height: 100%;
  flex: 1 1 auto;
}

.bio-species-total {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: #374151;
}

.bio-square-panel h3.bio-square-code {
  margin: 0 0 6px;
  font-size: 1.125rem;
  font-weight: 600;
  white-space: normal;
}

.bio-square-panel .bio-square-name {
  margin: 0 0 10px;
  color: #4b5563;
  font-size: 0.9rem;
  white-space: normal;
}

.bio-square-panel h4 {
  margin: 12px 0 6px;
  font-size: 0.95rem;
  white-space: normal;
}

.bio-square-panel ul {
  margin: 0;
  padding-left: 1.25rem;
  white-space: normal;
}

.bio-panel-json {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.35;
}

.bio-data-table-wrap {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.bio-data-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  background: #fff;
  table-layout: auto;
  margin-bottom: 10px;
  margin-left: 0;
}

.bio-data-table th,
.bio-data-table td {
  border: 1px solid #e5e7eb;
  padding: 8px;
  text-align: left;
  vertical-align: top;
  font-size: 0.875rem;
  white-space: nowrap;
}

.bio-data-table thead th {
  background: #f3f4f6;
  cursor: pointer;
  user-select: none;
}

.bio-sortable {
  white-space: nowrap;
}

.bio-sortable-inner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.bio-sortable .bio-sort-icon {
  font-size: 0.8em;
  color: #6b7280;
}

.bio-sortable.is-active {
  color: #1d4ed8;
}

.bio-sortable.is-active .bio-sort-icon {
  color: #1d4ed8;
}

.bio-n2k-site-subtitle {
  margin: -2px 0 4px;
  color: #374151;
  font-weight: 500;
}

.bio-n2k-section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 10px;
}

.bio-n2k-section-tab {
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #fff;
  padding: 4px 10px;
  font-size: 0.82rem;
  cursor: pointer;
}

.bio-n2k-section-tab.is-active {
  background: #2563eb;
  color: #fff;
  border-color: #1d4ed8;
}

.bio-data-table--mono td {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.8rem;
  word-break: break-word;
}

.bio-no-intersection {
  margin: 12px 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fef9c3;
  color: #854d0e;
  border: 1px solid #fde047;
}

.bio-aggregated-species {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.bio-species-section {
  padding: 8px 0 8px 12px;
  background: #fafafa;
  border-radius: 0 8px 8px 0;
}

.bio-species-section h4 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.bio-combined-natura-top-tabs {
  margin-bottom: 0.5rem;
}

.bio-combined-natura-tab-body .bio-combined-natura-panel {
  margin-top: 0;
}

.bio-combined-dataset-error {
  color: #b91c1c;
}

.bio-combined-natura-panel .bio-n2k-site-code {
  margin: 0 0 4px;
}

.bio-n2k-square-group {
  margin: 8px 0;
}

.bio-combined-sec {
  margin: 16px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.bio-combined-sec:last-of-type {
  border-bottom: none;
}

.bio-gather-visits-sec {
  margin: 14px 0 0;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
}

.bio-gather-visits-table-wrap {
  margin-top: 8px;
}

.bio-gather-visits-table td {
  font-size: 0.88rem;
  vertical-align: top;
}

.bio-combined-sec--square-patrate .bio-combined-patrate-block {
  margin: 12px 0 0;
  padding-left: 8px;
  border-left: 2px solid #e5e7eb;
}

.bio-patrate-visible-layers-heading {
  margin: 10px 0 6px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #374151;
}

.bio-n2k-section-tab--readonly {
  cursor: default;
}

.bio-patrate-square-layer-note {
  margin: 6px 0 10px;
  font-size: 0.9rem;
  color: #4b5563;
}

.bio-combined-patrate-legacy-baseline {
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.bio-combined-patrate-species {
  scroll-margin-top: 12px;
}

.bio-combined-import-attrs {
  margin: 10px 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.bio-import-attrs-instance {
  margin: 0 0 12px;
}

.bio-import-attrs-instance:last-child {
  margin-bottom: 0;
}

.bio-import-attrs-instance-head {
  margin: 0 0 6px;
  font-size: 0.88rem;
  color: #374151;
}

.bio-import-attrs-group {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 8px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.78rem;
  font-weight: 600;
}

.bio-import-attrs-table {
  font-size: 0.85rem;
}

.bio-import-attrs-table--horizontal {
  width: 100%;
  table-layout: fixed;
}

.bio-import-attrs-table--horizontal th,
.bio-import-attrs-table--horizontal td {
  vertical-align: top;
  padding: 6px 8px;
}

.bio-import-attrs-table--horizontal th {
  font-weight: 600;
  font-size: 0.78rem;
  word-break: break-word;
}

.bio-import-attrs-value {
  word-break: break-word;
  max-width: 28rem;
}

.bio-import-attrs-table--horizontal .bio-import-attrs-value {
  max-width: none;
}

.bio-sec-heading {
  margin: 0 0 8px;
  font-size: 1rem;
  color: #111827;
}

.bio-n2k-site-block {
  margin: 12px 0 0;
  padding-left: 8px;
  border-left: 2px solid #e5e7eb;
}

.bio-n2k-site-sub {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 600;
}

#bio-status {
  padding: 0 16px 10px;
  color: #374151;
}

.bio-media-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* Biodiversity Gather page (TORI main-content-centered + project-box pattern) */
.bio-gather-page-wrap {
  padding: 16px 12px 48px;
}

.bio-gather-project-box {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 20px 28px;
}

.bio-gather-map-section .bio-gather-map-legend {
  margin: 0 0 8px;
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.45;
}

.bio-gather-map {
  width: 100%;
  height: min(42vh, 360px);
  min-height: 220px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #f3f4f6;
}

.bio-zone-selections .bio-zone-map {
  z-index: 0;
}

.bio-zone-selections .bio-zone-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bio-gather-subset-map-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 8px;
}

.bio-gather-taxon-layers {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fafafa;
  font-size: 0.85rem;
}

.bio-gather-taxon-layers__heading {
  margin: 0 0 8px;
  font-weight: 600;
  color: #374151;
}

.bio-gather-taxon-layers__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bio-gather-taxon-layers__label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.bio-gather-taxon-layers__swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgb(0 0 0 / 15%);
  flex-shrink: 0;
}

.bio-gather-taxon-layers__title {
  font-weight: 600;
}

.bio-gather-taxon-layers__meta {
  font-size: 0.8rem;
}

.bio-gather-taxon-layers__species {
  margin: 6px 0 0 28px;
  padding: 0;
  list-style: disc;
  color: #4b5563;
}

.bio-gather-page-header {
  margin-bottom: 16px;
}

.bio-gather-page-title {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 700;
}

.bio-gather-page-lead,
.bio-gather-page-meta {
  margin: 0 0 10px;
  color: #4b5563;
  line-height: 1.5;
  font-size: 0.95rem;
}

.bio-gather-page-meta a {
  color: #2563eb;
  font-weight: 500;
}

.bio-gather-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

.bio-gather-controls label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.875rem;
  color: #374151;
}

.bio-gather-status {
  min-height: 1.25rem;
  margin-bottom: 8px;
  color: #111827;
  font-size: 0.9rem;
}

.bio-gather-section {
  margin-top: 20px;
  scroll-margin-top: 96px;
}

.bio-gather-section-title {
  margin: 0 0 12px;
  font-size: 1.05rem;
  font-weight: 600;
}

.bio-gather-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bio-gather-form-hint {
  margin: 0;
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.45;
}

.bio-gather-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.875rem;
}

.bio-gather-field-meta {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 2px;
}

.bio-gather-subheading {
  margin: 0 0 4px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #1f2937;
}

.bio-gather-field-hint {
  margin: 0 0 8px;
  font-size: 0.8rem;
  color: #6b7280;
  line-height: 1.4;
}

.bio-gather-natura-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bio-gather-natura-multiselect-inner {
  min-height: 2rem;
}

.bio-gather-natura-multi {
  margin: 0;
  padding: 0;
  border: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bio-gather-natura-multi__item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.875rem;
  cursor: pointer;
}

.bio-gather-natura-multi__item input {
  margin-top: 3px;
  accent-color: #1e3a8a;
}

.bio-gather-natura-multi__label {
  flex: 1;
  line-height: 1.35;
}

.bio-gather-natura-multi__item:has(input:checked) .bio-gather-natura-multi__label,
.bio-gather-natura-multi__item:has(input:checked) .bio-gather-natura-multi__code {
  color: #1e3a8a;
}

.bio-gather-natura-multi__code {
  font-weight: 600;
}

.bio-gather-fieldset {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.bio-gather-fieldset legend {
  padding: 0 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
}

/* Gather weather: TORI-style pill radios (labels always visible) */
.bio-gather-meteo-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bio-gather-meteo-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bio-gather-meteo-legend {
  font-size: 0.8rem;
  font-weight: 600;
  color: #374151;
}

.bio-gather-meteo-radios {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.bio-gather-meteo-pill {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  margin: 0;
  cursor: pointer;
  font-size: 0.8125rem;
  color: #1f2937;
}

.bio-gather-meteo-pill__input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
  cursor: pointer;
}

.bio-gather-meteo-pill__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  line-height: 1.2;
  min-height: 36px;
  box-sizing: border-box;
  background: #fff;
  user-select: none;
}

.bio-gather-meteo-pill__input:hover + .bio-gather-meteo-pill__label {
  border-color: #9ca3af;
}

.bio-gather-meteo-pill__input:focus-visible + .bio-gather-meteo-pill__label {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.bio-gather-meteo-pill__input:checked + .bio-gather-meteo-pill__label {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1e3a8a;
  font-weight: 600;
}

.bio-gather-meteo-temp-label {
  font-size: 0.875rem;
  color: #374151;
}

.bio-gather-inline-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.bio-gather-inline-fields--stack {
  flex-direction: column;
  align-items: stretch;
}

.bio-gather-inline-fields > .bio-gather-meteo-group {
  flex: 1 1 220px;
  min-width: 0;
}

#bio-gather-species-section .bio-gather-meteo-group {
  margin-bottom: 12px;
}

#bio-gather-species-section .bio-gather-inline-fields {
  margin-bottom: 4px;
}

.bio-gather-readonly-block {
  margin-bottom: 12px;
}

.bio-gather-readonly-value {
  margin: 4px 0 0;
  font-size: 0.95rem;
}

.bio-gather-actions--inline {
  margin-bottom: 14px;
}

.bio-gather-species-footer-actions {
  margin-top: 8px;
  flex-wrap: wrap;
}

.bio-gather-observers-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 1rem;
}

.bio-gather-observers-block__cap--bottom {
  margin-top: 10px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.bio-gather-observers-block__cap--bottom .bio-gather-subheading {
  margin-top: 0;
}

.bio-gather-observers-multi {
  margin: 0;
  padding: 0;
  border: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bio-gather-observers-multi__item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.875rem;
  cursor: pointer;
}

.bio-gather-observers-multi__item input {
  margin-top: 3px;
  accent-color: #1e3a8a;
}

.bio-gather-observers-multi__label {
  flex: 1;
  line-height: 1.35;
}

.bio-gather-observers-multi__email {
  font-weight: 600;
  color: #1f2937;
}

.bio-gather-observers-multi__name {
  color: #4b5563;
  font-weight: 400;
}

.bio-gather-observers-multi__item:has(input:checked) .bio-gather-observers-multi__email {
  color: #1e3a8a;
}

.bio-gather-observers-multi__empty {
  margin: 0;
}

.bio-gather-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.bio-gather-actions--visit {
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.bio-gather-btn-primary {
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid #1e40af;
  background: #1e40af;
  color: #fff;
  cursor: pointer;
}

.bio-gather-btn-primary:hover:not(:disabled) {
  background: #1e3a8a;
}

.bio-gather-btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.bio-gather-btn-primary.bio-gather-save-visit--needs-data {
  opacity: 0.85;
  box-shadow: 0 0 0 2px #fbbf24;
}

.bio-gather-advanced {
  margin-top: 0.5rem;
  font-size: 0.875rem;
}

.bio-gather-advanced summary {
  cursor: pointer;
  color: #4b5563;
}

.bio-gather-form-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.bio-gather-form-footer .bio-gather-btn-primary {
  margin-top: 0.5rem;
}

.bio-gather-subsection {
  margin-top: 1rem;
}

.bio-gather-subheading-sm {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #374151;
  margin-top: 8px;
}

.bio-gather-checkbox-scroll {
  max-height: 11rem;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 6px 8px;
  margin: 4px 0 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.8125rem;
}

/* Species + measures: TORI gather-picker; viewport = 3 rows, scroll inside */
.biodiversity-gather-page .bio-gather-species-picker-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 4px;
}

.biodiversity-gather-page .bio-gather-measures-picker,
.biodiversity-gather-page .bio-gather-species-picker {
  margin: 4px 0 10px;
}

.biodiversity-gather-page .bio-gather-measures-picker .gather-picker__list-wrap,
.biodiversity-gather-page .bio-gather-species-picker .gather-picker__list-wrap {
  max-height: calc(3 * var(--ga-row-h));
  min-height: calc(3 * var(--ga-row-h));
  overflow-y: auto;
}

@media (max-width: 539.98px) {
  .biodiversity-gather-page .bio-gather-measures-picker:not(.gather-picker--open) .gather-picker__list-wrap,
  .biodiversity-gather-page .bio-gather-species-picker:not(.gather-picker--open) .gather-picker__list-wrap {
    min-height: calc(3 * var(--ga-row-h));
  }

  /* Search focus opens overlay (gather-picker.js): list fills remaining viewport under search */
  .biodiversity-gather-page #bio-gather-species-picker.gather-picker--open .gather-picker__list-wrap,
  .biodiversity-gather-page #bio-gather-measures-rec.gather-picker--open .gather-picker__list-wrap,
  .biodiversity-gather-page #bio-gather-measures-imp.gather-picker--open .gather-picker__list-wrap {
    max-height: none;
    min-height: 0;
    flex: 1 1 auto;
  }
}

.bio-gather-pressure-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 6px;
}

.bio-gather-pressure-line input[type="number"] {
  width: 6rem;
}

.bio-gather-btn-secondary {
  margin-top: 6px;
}

.biodiversity-gather-page .bio-media label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
  font-size: 0.875rem;
}

/* Biodiversity company page (TORI company-layout pattern) */
.bio-company-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

.bio-company-page-header h1 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.bio-company-page-lead,
.bio-company-page-meta {
  margin: 0 0 12px;
  color: #4b5563;
  line-height: 1.5;
}

.bio-company-page-meta a {
  color: #2563eb;
  font-weight: 500;
}

.bio-company-status {
  padding: 0 0 12px;
  color: #374151;
  min-height: 1.25rem;
}

.bio-company-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  align-items: start;
}

.bio-company-sidebar {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fafafa;
}

.bio-company-sidebar-title {
  margin: 0 0 4px;
  font-size: 1rem;
}

.bio-company-main {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.bio-company-section {
  scroll-margin-top: 96px;
}

.bio-company-section-title {
  margin: 0 0 12px;
  font-size: 1.15rem;
}

.bio-free-badge {
  margin: 0 0 12px;
  padding: 6px 10px;
  display: inline-block;
  border-radius: 6px;
  background: #ecfdf5;
  color: #065f46;
  font-size: 0.9rem;
  font-weight: 500;
}

.bio-company-json {
  margin-top: 12px;
  padding: 12px;
  max-height: 420px;
  overflow: auto;
  font-size: 0.8rem;
  background: #111827;
  color: #e5e7eb;
  border-radius: 8px;
}

.bio-company-actions,
.bio-company-profile {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 420px;
}

.bio-company-actions label,
.bio-company-profile label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.9rem;
}

.bio-company-tab-active {
  background: var(--text, #111827);
  color: var(--bg, #fff) !important;
}

@media (max-width: 900px) {
  .bio-company-layout {
    grid-template-columns: 1fr;
  }

  .bio-company-sidebar {
    position: static;
  }
}

/* Patrate layer manager (map app, admin) */
.bio-layer-list {
  margin: 0 16px 12px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
  max-width: 1200px;
}

.bio-layer-list-accordion {
  margin: 0;
}

.bio-layer-list-accordion > summary.bio-layer-list-heading {
  margin: 0 0 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.bio-layer-list-accordion:not([open]) > summary.bio-layer-list-heading {
  margin-bottom: 0;
}

.bio-layer-list-accordion > summary.bio-layer-list-heading::-webkit-details-marker {
  display: none;
}

.bio-layer-list-accordion > summary.bio-layer-list-heading::before {
  content: "▸";
  display: inline-block;
  margin-right: 0.35rem;
  transition: transform 0.15s ease;
}

.bio-layer-list-accordion[open] > summary.bio-layer-list-heading::before {
  transform: rotate(90deg);
}

.bio-layer-list-body {
  margin: 0;
}

.bio-layer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #e5e7eb;
}

.bio-layer-row:last-child {
  border-bottom: none;
}

.bio-layer-vis {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.bio-layer-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid #9ca3af;
  flex-shrink: 0;
}

.bio-layer-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bio-layer-label-input {
  flex: 1;
  min-width: 0;
  padding: 4px 6px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
}

.bio-btn-small {
  padding: 4px 8px;
  font-size: 0.85rem;
}

.bio-btn-danger {
  background: #b91c1c;
  color: #fff;
  border: none;
}

.bio-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.bio-modal {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  max-width: 420px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.bio-modal--wide {
  max-width: 520px;
}

.bio-form-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.bio-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* Project create: company users as visible multiselect (checkbox list) */
.bio-multi-select {
  width: 100%;
  max-width: 520px;
  max-height: 14rem;
  overflow-y: auto;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 4px 0;
  margin-bottom: 10px;
  background: #fff;
  box-sizing: border-box;
}

.bio-multi-select__empty {
  margin: 0;
  padding: 10px 12px;
  color: #6b7280;
  font-size: 0.9rem;
}

.bio-multi-select__row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 12px;
  margin: 0;
  cursor: pointer;
  font-weight: 400;
  line-height: 1.35;
}

.bio-multi-select__row:hover {
  background: #f3f4f6;
}

.bio-multi-select__check {
  margin-top: 2px;
  flex-shrink: 0;
}

.bio-multi-select__label-text {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

#bio-rospa-toggle-wrap[hidden] {
  display: none;
}

.leaflet-tooltip.n2k-map-label {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  padding: 2px 6px;
  text-align: center;
  pointer-events: none;
}

.n2k-map-label .n2k-map-label__code {
  font-weight: 600;
  font-size: 0.75rem;
  line-height: 1.2;
  margin: 0;
}

.n2k-map-label .n2k-map-label__name {
  font-weight: 400;
  font-size: 0.7rem;
  line-height: 1.2;
  margin: 0;
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
