:root {
  --bg: #eef2f0;
  --ink: #1a2420;
  --muted: #5a6860;
  --accent: #1f6b4a;
  --card: #fbfcfb;
  --line: #c9d4cd;
  --splitter: #d7dbe0;
  --splitter-hover: #8fb39a;
  --app-right-panel-width: 320px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, #dfe8e2 0%, var(--bg) 40%, #e7ebe8 100%);
  color: var(--ink);
  line-height: 1.45;
  min-height: 100vh;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  padding: 0.28rem 0.7rem;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 252, 251, 0.92);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-start {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  min-width: 0;
}

.brand { font-weight: 700; letter-spacing: -0.03em; font-size: 0.98rem; }
.brand a { color: var(--ink); text-decoration: none; }

.nav-divider {
  width: 1px;
  height: 17px;
  background: #9aada2;
  display: inline-block;
  flex: 0 0 auto;
}

.page-title-chip {
  background: #d5e8dc;
  color: #174532;
  font-weight: 650;
  font-size: 0.88rem;
  padding: 0.12rem 0.45rem;
  border-radius: 3px;
  border: 1px solid #9fc2ad;
  line-height: 1.15;
  white-space: nowrap;
}

nav { display: flex; flex-wrap: wrap; gap: 0.1rem 0.55rem; align-items: center; }
nav a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.1rem 0;
  border-bottom: 1px solid transparent;
}
nav a:hover, nav a.is-active { border-bottom-color: var(--accent); }
.nav-dropdown {
  position: relative;
}
.nav-dropdown-toggle {
  font: inherit;
  font-size: 0.9rem;
  color: var(--accent);
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  padding: 0.1rem 0;
  cursor: pointer;
}
.nav-dropdown.is-active .nav-dropdown-toggle,
.nav-dropdown-toggle:hover {
  border-bottom-color: var(--accent);
}
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  min-width: 11rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  padding: 0.35rem;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.nav-dropdown-menu[hidden] {
  display: none !important;
}
.nav-dropdown-menu a {
  border-bottom: 0;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
}
.nav-dropdown-menu a:hover,
.nav-dropdown-menu a.is-active {
  background: #f1f5f9;
  border-bottom-color: transparent;
}
.settings-users-page,
.settings-page {
  padding: 0.5rem 0.75rem 1rem;
}
.settings-queue-section {
  margin: 0 0 1.25rem;
}
.settings-queue-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.45rem;
}
.settings-queue-section-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
  color: #0f172a;
}
.settings-queue-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.settings-queue-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.settings-queue-table th,
.settings-queue-table td {
  padding: 0.4rem 0.55rem;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}
.settings-queue-table th {
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.settings-queue-table tbody tr:last-child td {
  border-bottom: 0;
}
.settings-queue-table tr.is-running td {
  background: #eff6ff;
}
.settings-queue-table tr.is-paused td {
  background: #fffbeb;
}
.settings-queue-table tr.is-error td {
  background: #fef2f2;
}
.settings-queue-empty {
  margin: 0;
  padding: 0.85rem 0.75rem;
  color: #94a3b8;
  font-size: 0.82rem;
}
.settings-queue-status {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #e2e8f0;
  color: #334155;
}
.settings-queue-status.is-running {
  background: #dbeafe;
  color: #1d4ed8;
}
.settings-queue-status.is-pending {
  background: #e2e8f0;
  color: #475569;
}
.settings-queue-status.is-paused {
  background: #fef3c7;
  color: #b45309;
}
.settings-queue-status.is-done {
  background: #dcfce7;
  color: #15803d;
}
.settings-queue-status.is-error {
  background: #fee2e2;
  color: #b91c1c;
}
.settings-queue-status.is-cancelled {
  background: #f1f5f9;
  color: #64748b;
}
.settings-queue-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.settings-queue-btn {
  font: inherit;
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  cursor: pointer;
}
.settings-queue-btn:hover {
  background: #f8fafc;
}
.settings-queue-btn.danger {
  border-color: #fecaca;
  color: #b91c1c;
  background: #fff;
}
.settings-queue-btn.danger:hover {
  background: #fef2f2;
}
.settings-queue-note {
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #64748b;
}

/* —— Reports filters —— */
.reports-page {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 100%;
}
.reports-map {
  aspect-ratio: auto;
  height: 624px;
  min-height: 528px;
  max-height: 768px;
  flex: 0 0 auto;
  margin-bottom: 0;
}
.reports-map-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.65rem;
}
.reports-map-modes {
  display: inline-flex;
  gap: 0.3rem;
}
.reports-mode-btn {
  font: inherit;
  font-size: 0.75rem;
  padding: 0.22rem 0.55rem;
  border: 1px solid #b8b8b8;
  border-radius: 999px;
  background: #fff;
  color: #222;
  cursor: pointer;
}
.reports-mode-btn:hover {
  background: #f3f3f3;
}
.reports-mode-btn.is-active {
  background: #eff6ff;
  border-color: #93c5fd;
  color: #1d4ed8;
}
.reports-mode-btn.secondary {
  color: #475569;
}
#reports-map-clear-draw[hidden],
#reports-map-finish-draw[hidden] {
  display: none !important;
}
.reports-map-hint {
  font-size: 0.75rem;
}
.reports-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  font-size: 0.72rem;
  color: #334155;
  padding: 0 0.1rem 0.15rem;
}
.reports-map-legend[hidden] {
  display: none !important;
}
.reports-map-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  max-width: 14rem;
}
.reports-map-legend-swatch {
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  flex: 0 0 auto;
  border: 1px solid rgba(15, 23, 42, 0.25);
}
.reports-map-legend-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reports-summary {
  font-size: 0.82rem;
  line-height: 1.4;
  padding: 0.35rem 0.15rem 0.5rem;
}
.reports-summary strong {
  font-weight: 650;
}
.reports-results {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.25rem 0 1rem;
}
.reports-results[hidden] {
  display: none !important;
}
.reports-results-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.65rem 1rem;
}
.reports-results-toolbar .reports-metric-wrap {
  flex: 0 0 auto;
}
.reports-species-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: min(280px, 100%);
  flex: 1 1 220px;
}
.reports-field-label {
  font-size: 0.72rem;
  font-weight: 650;
  color: #475569;
}
.reports-download-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.reports-totals {
  font-size: 0.8rem;
}
.reports-table-actions {
  margin-top: 0.55rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.reports-chart-hint {
  font-size: 0.72rem;
  font-weight: 500;
}
.reports-chart-card[data-chart-viewer] {
  cursor: zoom-in;
}
.reports-chart-viewer-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.reports-chart-viewer-card {
  width: min(1400px, 96vw);
  height: min(90vh, 920px);
  background: #fff;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.28);
  resize: both;
  min-width: 480px;
  min-height: 360px;
}
.reports-chart-viewer-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.55rem;
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.reports-chart-viewer-toolbar h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
}
.reports-chart-viewer-hint {
  margin-right: auto;
  font-size: 0.75rem;
}
.reports-chart-viewer-toolbar .reports-mode-btn {
  padding: 0.22rem 0.65rem;
  font-size: 0.78rem;
}
.reports-chart-viewer-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #fff;
  padding: 0.35rem 0.5rem 0.65rem;
}
.reports-chart-viewer-plotly {
  width: 100%;
  height: 100%;
  min-height: 320px;
}
.reports-table-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0.65rem 0.75rem 0.85rem;
}
.reports-table-card h3 {
  margin: 0 0 0.45rem;
  font-size: 0.88rem;
  font-weight: 650;
  color: #0f172a;
}
.reports-table-note {
  margin: 0 0 0.45rem;
  font-size: 0.75rem;
}
.reports-table-scroll {
  overflow: auto;
  max-height: min(420px, 55vh);
  border: 1px solid #e2e8f0;
  border-radius: 6px;
}
.reports-table-scroll--wide {
  max-height: min(520px, 60vh);
}
.reports-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  white-space: nowrap;
}
.reports-data-table th,
.reports-data-table td {
  padding: 0.28rem 0.45rem;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
}
.reports-data-table th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 1;
  font-weight: 650;
  color: #334155;
}
.reports-data-table td.num,
.reports-data-table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.reports-data-table tbody tr:hover {
  background: #f1f5f9;
}
.reports-data-table tfoot td {
  font-weight: 700;
  background: #f8fafc;
  border-top: 1px solid #cbd5e1;
}
.reports-data-table--compact th,
.reports-data-table--compact td {
  padding: 0.2rem 0.35rem;
  font-size: 0.72rem;
}
.reports-charts {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.reports-daily-activity {
  margin-top: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.reports-daily-activity-heading {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
  color: #0f172a;
}
.reports-daily-activity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: stretch;
}
@media (max-width: 960px) {
  .reports-daily-activity-grid {
    grid-template-columns: 1fr;
  }
}
.reports-daily-season-bar {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.45rem;
}
.reports-overlap-stats {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
}
.reports-overlap-stats[hidden] {
  display: none !important;
}
.reports-overlap-stats strong {
  color: #0f172a;
  font-weight: 650;
}
.reports-season-dropdown {
  position: relative;
}
.reports-season-dropdown-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  box-sizing: border-box;
  font: inherit;
  font-size: 0.78rem;
  text-align: left;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  color: #0f172a;
}
.reports-season-dropdown-toggle:hover,
.reports-season-dropdown-toggle[aria-expanded="true"] {
  border-color: #94a3b8;
}
.reports-season-dropdown-caret {
  color: #64748b;
  flex-shrink: 0;
}
.reports-season-dropdown-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.reports-season-dropdown-menu[hidden] {
  display: none;
}
.reports-season-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #1e293b;
  cursor: pointer;
}
.reports-season-dropdown-item:hover,
.reports-season-dropdown-item.is-selected {
  background: #f1f5f9;
}
.reports-season-dropdown-item input {
  margin: 0;
  flex-shrink: 0;
}
.reports-chart-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0.65rem 0.75rem 0.9rem;
}
.reports-chart-card h3 {
  margin: 0 0 0.55rem;
  font-size: 0.88rem;
  font-weight: 650;
  color: #0f172a;
}
.reports-chart-wide {
  /* stacked layout — full width by default */
}
.reports-chart-card .reports-chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: 360px;
  max-height: 360px;
  overflow: hidden;
}
.reports-chart-card .reports-chart-canvas-wrap canvas {
  display: block;
  max-width: 100%;
}
.reports-filters {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-bottom: 0.75rem;
}
.reports-filters h2 {
  margin: 0;
  font-size: 1rem;
}
.reports-fieldset {
  margin: 0;
  padding: 0.45rem 0.5rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.reports-fieldset legend {
  padding: 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 650;
  color: #475569;
}
.reports-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
}
.reports-field input[type="text"],
.reports-field input[type="number"] {
  font: inherit;
  font-weight: 400;
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}
.reports-field-hint {
  margin: 0.3rem 0 0;
  font-size: 0.7rem;
  font-weight: 400;
}
.reports-micro-field {
  margin-bottom: 0.45rem;
}
.reports-micro-field .reports-check-dropdown-toggle {
  font-weight: 400;
}
.reports-check-dropdown {
  position: relative;
}
.reports-check-dropdown-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  box-sizing: border-box;
  font: inherit;
  font-size: 0.78rem;
  text-align: left;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  cursor: pointer;
}
.reports-check-dropdown-toggle:hover,
.reports-check-dropdown-toggle[aria-expanded="true"] {
  border-color: #94a3b8;
  background: #f8fafc;
}
.reports-check-dropdown-toggle-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reports-check-dropdown-toggle-caret {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 0.65rem;
}
.reports-check-dropdown-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 3px);
  z-index: 40;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  overflow: hidden;
}
.reports-check-dropdown-menu[hidden] {
  display: none !important;
}
.reports-check-dropdown-search {
  width: 100%;
  box-sizing: border-box;
  border: 0;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.35rem 0.45rem;
  font: inherit;
  font-size: 0.78rem;
}
.reports-check-dropdown-list {
  max-height: 14rem;
  overflow: auto;
}
.reports-check-dropdown-allhost {
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.reports-check-dropdown-allhost[hidden] {
  display: none;
}
.reports-check-item-all {
  background: #f8fafc;
  font-weight: 650;
}
.reports-check-item-all .reports-check-item-title {
  font-weight: 700;
  letter-spacing: 0.02em;
}
.reports-check-dropdown--oneline .reports-check-dropdown-menu {
  min-width: min(28rem, 92vw);
  width: max(100%, 18rem);
}
.reports-check-item.is-oneline {
  align-items: center;
  white-space: nowrap;
}
.reports-check-item.is-oneline .reports-check-item-body {
  overflow: hidden;
}
.reports-check-item.is-oneline .reports-check-item-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}
.reports-check-item.is-oneline input {
  margin: 0;
}
.reports-project-folder {
  border-bottom: 1px solid #f1f5f9;
}
.reports-project-folder-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  border: 0;
  background: #fff;
  padding: 0.3rem 0.45rem;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
  text-align: left;
}
.reports-project-folder-btn:hover {
  background: #f8fafc;
}
.reports-project-folder.is-open > .reports-project-folder-btn .reports-project-chevron {
  transform: rotate(90deg);
}
.reports-project-chevron {
  display: inline-block;
  width: 0.75rem;
  font-size: 0.62rem;
  transition: transform 0.12s ease;
  color: #64748b;
}
.reports-project-children {
  padding-left: 0.35rem;
  border-top: 1px solid #f1f5f9;
}
.reports-project-children[hidden] {
  display: none !important;
}
.reports-project-children .reports-check-item {
  padding-left: 1.1rem;
}
.reports-check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 0.28rem 0.45rem;
  font-size: 0.76rem;
  font-weight: 400;
  color: #0f172a;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
}
.reports-check-item:last-child {
  border-bottom: 0;
}
.reports-check-item-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-bottom: 1px solid #f1f5f9;
}
.reports-check-item-row:last-child {
  border-bottom: 0;
}
.reports-check-item-row .reports-check-item {
  flex: 1 1 auto;
  min-width: 0;
  border-bottom: 0;
}
.reports-check-item-delete {
  flex: 0 0 auto;
  align-self: center;
  margin: 0 0.35rem 0 0;
  width: 1.45rem;
  height: 1.45rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #b91c1c;
  font: inherit;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.reports-check-item-delete:hover {
  background: #fef2f2;
}
.reports-check-item-locked {
  flex: 0 0 auto;
  align-self: center;
  margin: 0 0.4rem 0 0;
  font-size: 0.72rem;
  opacity: 0.65;
  user-select: none;
}
.reports-check-item:hover {
  background: #f8fafc;
}
.reports-check-item.is-selected {
  background: #eff6ff;
}
.reports-check-item input {
  margin: 0.15rem 0 0;
  flex: 0 0 auto;
}
.reports-check-item-body {
  min-width: 0;
  flex: 1 1 auto;
}
.reports-check-item-title {
  display: block;
  line-height: 1.25;
  word-break: break-word;
}
.reports-check-item-sub {
  display: block;
  margin-top: 0.1rem;
  color: #64748b;
  font-size: 0.7rem;
  line-height: 1.25;
  word-break: break-word;
}
.reports-check-dropdown-empty {
  margin: 0;
  padding: 0.55rem 0.45rem;
  color: #94a3b8;
  font-size: 0.75rem;
}
.reports-check-dropdown-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.25rem 0.45rem;
  border-top: 1px solid #eef2f7;
  font-size: 0.7rem;
  color: #64748b;
}
.reports-check-dropdown-meta button {
  border: 0;
  background: none;
  color: #2563eb;
  font: inherit;
  font-size: 0.7rem;
  cursor: pointer;
  padding: 0;
}
.reports-places {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.reports-place-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 400;
  color: #0f172a;
  cursor: pointer;
}
.reports-place-item input {
  margin: 0;
}
.reports-place-item.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.reports-polygon-import {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.4rem;
}
.reports-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.reports-filter-actions .reports-layout-picker {
  flex: 1 1 10rem;
  min-width: 8rem;
}
.reports-metric-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 12rem;
}
.reports-chart-metric-select {
  padding: 0.4rem 0.55rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font: inherit;
  font-size: 0.85rem;
  background: #fff;
  color: #0f172a;
  min-width: 12rem;
}
.reports-layout-add {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
  align-items: center;
}
.reports-layout-add input {
  flex: 1 1 8rem;
  min-width: 0;
  padding: 0.35rem 0.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font: inherit;
  font-size: 0.85rem;
}
.reports-layout-picker-row.is-active .reports-check-item {
  background: #eff6ff;
  outline: 1px solid #93c5fd;
}
.reports-layout-picker-row .reports-check-item {
  cursor: pointer;
}
.reports-layout-picker-row .reports-check-item input {
  display: none;
}
.reports-map .leaflet-marker-icon.reports-marker-selected {
  filter: hue-rotate(190deg) saturate(1.4);
}
.reports-draw-vertex {
  width: 10px !important;
  height: 10px !important;
  margin-left: -5px !important;
  margin-top: -5px !important;
  border-radius: 50%;
  background: #2563eb;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.5);
}
.settings-user-projects-label select {
  min-height: 7rem;
}
.settings-check-list {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0.35rem 0 0;
  border: 0;
  text-align: left;
}
.settings-check-list legend {
  font-size: 0.7rem;
  color: #475569;
  padding: 0;
  margin: 0 0 0.25rem;
}
.settings-check-list-items {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  max-height: 12rem;
  overflow: auto;
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  width: max-content;
  max-width: 100%;
  min-width: 11rem;
  box-sizing: border-box;
}
.library-filters .settings-check-item,
.settings-check-item {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 0.35rem;
  margin: 0;
  padding: 0.05rem 0;
  font-size: 0.78rem;
  color: #0f172a;
  text-align: left;
  width: auto !important;
  max-width: none;
  min-width: 0;
  cursor: pointer;
}
.library-filters .settings-check-item input[type="checkbox"],
.settings-check-item input[type="checkbox"] {
  width: 0.9rem !important;
  height: 0.9rem;
  margin: 0 !important;
  flex: 0 0 auto;
  align-self: center;
}
.settings-check-item-text {
  display: inline;
  line-height: 1.2;
  text-align: left;
  white-space: nowrap;
}
.settings-hint {
  grid-column: 1 / -1;
  margin: 0.25rem 0 0.5rem;
  color: #64748b;
  font-size: 0.8rem;
  text-align: left;
}
.settings-check-list .settings-hint {
  margin: 0.3rem 0 0;
}
.settings-project-modal-card {
  width: min(560px, 94vw);
  max-height: 92vh;
  overflow: auto;
}
.settings-project-fields-empty {
  margin: 0;
  color: #94a3b8;
  font-size: 0.75rem;
  text-align: left;
}
.settings-tabs {
  display: flex;
  gap: 0.35rem;
  margin: 0 0 0.75rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.35rem;
}
.settings-tab {
  font: inherit;
  font-size: 0.85rem;
  color: var(--accent);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px 6px 0 0;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
}
.settings-tab:hover {
  background: #f1f5f9;
}
.settings-tab.is-active {
  border-color: var(--line);
  border-bottom-color: #fff;
  background: #fff;
  font-weight: 600;
}
.settings-tab-panel[hidden] {
  display: none !important;
}
.settings-ai-species-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.55rem;
}
.settings-ai-species-search {
  width: min(22rem, 100%);
  padding: 0.28rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 0.82rem;
  box-sizing: border-box;
}
.settings-ai-species-list {
  max-height: min(62vh, 34rem);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.settings-ai-species-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.settings-ai-species-table th,
.settings-ai-species-table td {
  padding: 0.35rem 0.45rem;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
  vertical-align: middle;
}
.settings-ai-species-table th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: #475569;
  font-weight: 600;
  font-size: 0.72rem;
  z-index: 1;
}
.settings-ai-species-table tr.is-disabled td {
  color: #94a3b8;
}
.settings-ai-species-table tr:hover td {
  background: #f8fafc;
}
.settings-ai-species-ai {
  min-width: 12rem;
  line-height: 1.25;
}
.settings-ai-species-key {
  color: #64748b;
  font-size: 0.72rem;
}
.settings-ai-species-on {
  width: 4.5rem;
  text-align: center;
}
.settings-ai-species-on input[type="checkbox"] {
  width: 0.95rem;
  height: 0.95rem;
  margin: 0;
  cursor: pointer;
}
.settings-ai-species-map {
  min-width: 14rem;
  position: relative;
}
.settings-ai-species-map-btn {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  padding: 0.22rem 0.35rem;
  font: inherit;
  font-size: 0.78rem;
  color: inherit;
  cursor: pointer;
}
.settings-ai-species-map-btn:hover,
.settings-ai-species-map.is-editing .settings-ai-species-map-btn {
  border-color: var(--line);
  background: #fff;
}
.settings-ai-species-map-btn.is-empty {
  color: #94a3b8;
  font-style: italic;
}
.settings-ai-species-map-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 2px);
  z-index: 20;
  max-height: 14rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}
.settings-ai-species-map-menu[hidden] {
  display: none !important;
}
.settings-ai-species-map-search {
  width: 100%;
  box-sizing: border-box;
  border: 0;
  border-bottom: 1px solid #e2e8f0;
  padding: 0.35rem 0.45rem;
  font: inherit;
  font-size: 0.78rem;
}
.settings-ai-species-map-opt {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  padding: 0.3rem 0.45rem;
  font: inherit;
  font-size: 0.76rem;
  color: #0f172a;
  cursor: pointer;
}
.settings-ai-species-map-opt:hover {
  background: #eff6ff;
}
.settings-ai-species-map-opt.is-clear {
  color: #64748b;
  font-style: italic;
}


.header-end {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  font-size: 0.88rem;
}
.header-end .muted,
.header-end a {
  font-size: 0.8rem;
}
.lang-switch {
  margin: 0;
  display: inline-flex;
  align-items: center;
}
.lang-switch-btn {
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  padding: 0.28rem 0.42rem;
  min-width: 2.1rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}
.lang-switch-btn:hover {
  background: #f3f3f3;
  border-color: #999;
}
.lang-switch-code {
  display: inline-block;
}

.undo-btns {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.undo-btn {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.1rem 0.38rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  line-height: 1.2;
}

.undo-btn.export-btn {
  border-radius: 4px;
  padding: 0.12rem 0.55rem;
  margin-right: 4px;
}

.undo-btn:hover:not(:disabled) {
  background: #f3f3f3;
  border-color: #999;
}

.undo-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.undo-depth {
  min-width: 0.95rem;
  text-align: center;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  user-select: none;
}

.undo-depth.is-zero {
  opacity: 0.35;
}

.undo-toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 2000;
  max-width: min(420px, 90vw);
  padding: 10px 14px;
  border-radius: 6px;
  background: #1f2937;
  color: #fff;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.undo-toast[hidden] {
  display: none !important;
}

.project-switch {
  display: flex;
  align-items: center;
  gap: 0.22rem;
  margin: 0;
  position: relative;
}
.project-switch-label {
  font-size: 0.8rem;
  color: var(--muted);
}
.project-picker {
  position: relative;
}
.project-picker-toggle {
  max-width: 12rem;
  min-width: 4.5rem;
  font-size: 0.8rem;
  line-height: 1.15;
  padding: 0.08rem 0.35rem;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 2px;
  height: 1.55rem;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: middle;
}
.project-picker-toggle[aria-expanded="true"] {
  border-color: #888;
}
.project-picker-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 2px);
  z-index: 80;
  min-width: 11rem;
  max-width: 16rem;
  max-height: min(60vh, 18rem);
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  padding: 0.15rem 0;
}
.project-picker-folder-btn,
.project-picker-leaf {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  width: 100%;
  border: 0;
  background: transparent;
  text-align: left;
  font-size: 0.85rem;
  line-height: 1.25;
  padding: 0.28rem 0.55rem;
  cursor: pointer;
  color: var(--ink);
  border-radius: 0;
}
.project-picker-folder-btn:hover,
.project-picker-leaf:hover {
  background: #f3f3f3;
}
.project-picker-leaf.is-current {
  font-weight: 600;
  background: #eef4ff;
}
.project-picker-chevron {
  display: inline-block;
  width: 0.7rem;
  font-size: 0.6rem;
  transition: transform 0.12s ease;
  flex-shrink: 0;
}
.project-picker-folder.is-open > .project-picker-folder-btn .project-picker-chevron {
  transform: rotate(90deg);
}
.project-picker-folder-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-picker-children {
  padding-left: 0.85rem;
}
.project-picker-empty {
  display: block;
  padding: 0.2rem 0.55rem 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.page-content {
  margin: 0;
  padding: 0.5rem 0.65rem 1rem;
  min-height: calc(100vh - 40px);
}

h1, h2, h3 { font-weight: 650; letter-spacing: -0.02em; margin-top: 0; }
h1 { font-size: 1.35rem; margin-bottom: 0.65rem; }
h2 { font-size: 1.05rem; margin-bottom: 0.5rem; }

.messages { list-style: none; padding: 0; margin: 0 0 0.75rem; }
.messages li {
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.5rem;
  background: #e7f0ec;
  border-left: 4px solid var(--accent);
}
.messages li.error { background: #f8e8e4; border-color: #8a3b2d; }

/* Animals-style main + Tests-style resizable right panel */
.split-layout {
  display: grid;
  gap: 0;
  align-items: stretch;
  min-height: calc(100vh - 110px);
}

.app-layout {
  grid-template-columns:
    minmax(0, 1fr)
    10px
    minmax(220px, var(--app-right-panel-width));
}

.split-layout > .panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  padding: 0.85rem 1rem;
}

.main-panel {
  overflow: auto;
  border: 0;
  background: transparent;
  padding: 0.35rem 0.25rem 0.5rem;
}

.side-panel {
  overflow: auto;
}

.side-map {
  width: 100%;
  aspect-ratio: 5 / 4;
  min-height: 180px;
  margin-bottom: 0.65rem;
  border: 1px solid var(--line);
  background: #e4ebe6;
  z-index: 0;
}

.location-notes-panel {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem 0.75rem;
  border-bottom: 1px solid var(--border, #d8dde3);
}
.location-notes-panel[hidden] {
  display: none !important;
}
.location-notes-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.82rem;
  font-weight: 600;
}
.location-notes-field span {
  color: var(--text-muted, #5b6570);
}
.location-notes-field textarea {
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
  min-height: 4.2rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border, #c9d0d8);
  border-radius: 6px;
  font: inherit;
  font-weight: 400;
  line-height: 1.35;
  background: #fff;
}
.location-notes-field textarea:focus {
  outline: 2px solid rgba(40, 100, 180, 0.25);
  border-color: #4a7ab5;
}

.location-photos {
  margin-bottom: 0.75rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}

.location-photos h2 {
  margin-bottom: 0.25rem;
}

.location-photos-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin: 0.5rem 0 0.65rem;
}

.location-photo-card {
  margin: 0;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0.3rem;
  font-size: 0.75rem;
}

.location-photo-card img {
  display: block;
  width: 100%;
  height: 88px;
  object-fit: cover;
  background: #e4ebe6;
}

.location-photo-card figcaption {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  margin-top: 0.25rem;
  color: var(--muted);
}

.location-photo-delete {
  margin-top: 0.3rem;
  width: 100%;
  background: #8a857c;
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
}

.location-photo-form {
  display: grid;
  gap: 0.4rem;
}

.location-photo-form label {
  display: grid;
  gap: 0.15rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.location-photo-form input,
.location-photo-form select {
  width: 100%;
}

.locations-split-tables {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.tables-horizontal-splitter {
  height: 10px;
  margin: 6px 0;
  cursor: row-resize;
  border-top: 2px solid #d7dbe0;
  border-bottom: 2px solid #d7dbe0;
  border-radius: 4px;
  background: linear-gradient(to bottom, #f5f7fa, #eef2f7);
  flex: 0 0 auto;
}

.tables-horizontal-splitter:hover {
  border-top-color: var(--splitter-hover);
  border-bottom-color: var(--splitter-hover);
}

.location-visits-section {
  min-height: 0;
}

.location-visits-title {
  font-size: 0.98rem;
  margin: 0 0 0.35rem;
}

.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
  padding: 0 0.15rem;
}

.panel-toolbar h1 {
  margin: 0;
  font-size: 1.15rem;
}

.app-vertical-splitter {
  cursor: col-resize;
  border-left: 2px solid var(--splitter);
  border-right: 2px solid var(--splitter);
  border-radius: 4px;
  background: linear-gradient(to right, #f5f7fa, #eef2f7);
  margin: 0 4px;
  align-self: stretch;
}

.app-vertical-splitter:hover,
.app-vertical-splitter.is-dragging {
  border-left-color: var(--splitter-hover);
  border-right-color: var(--splitter-hover);
  background: linear-gradient(to right, #e8f2ec, #dcebe3);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
}
th, td {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 0.92rem;
}
tbody tr.is-selected {
  background: #e7f2ec;
}
tbody tr[data-selectable] {
  cursor: pointer;
}
tbody tr[data-selectable]:hover {
  background: #f0f5f2;
}

.row { display: flex; gap: 1rem; flex-wrap: wrap; }
.row > * { flex: 1 1 280px; }

button, .btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
  display: inline-block;
}
button.secondary { background: #6b655a; }
input, select { font: inherit; padding: 0.35rem 0.5rem; }
.muted { color: var(--muted); font-size: 0.92rem; }

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}
.media-card {
  border: 1px solid var(--line);
  padding: 0.5rem;
  background: #fff;
  font-size: 0.85rem;
}
.media-card img {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
  background: #e4ebe6;
  margin-bottom: 0.4rem;
}

.side-empty {
  color: var(--muted);
  font-size: 0.92rem;
}

.detail-block {
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}
.detail-block:first-child {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
}
.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.2rem 0;
  font-size: 0.9rem;
}
.detail-row strong {
  text-align: right;
  font-weight: 600;
}
.upload-history-page {
  padding: 0.35rem 0.15rem 0.75rem;
}
.upload-history-intro {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
}
.upload-history-pipe-title {
  margin: 1rem 0 0.35rem;
  font-size: 0.95rem;
}
.upload-history-side-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}
.upload-history-side-actions .btn {
  text-decoration: none;
}
.history-pipe-done {
  color: #166534;
  background: #dcfce7;
  font-weight: 600;
}
.history-pipe-warm {
  color: #9a3412;
  background: #ffedd5;
}

@media (max-width: 800px) {
  .app-layout {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .app-vertical-splitter {
    display: none;
  }
  .side-panel {
    min-height: 200px;
  }
}

.side-map.map-gps-pick {
  cursor: crosshair;
  box-shadow: inset 0 0 0 2px #2f6fed;
}
.side-map.map-gps-pick::after {
  content: "Klikni na kartu za GPS";
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 500;
  background: rgba(20, 28, 40, 0.85);
  color: #fff;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  pointer-events: none;
}
.side-map {
  position: relative;
}

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

.grid-toolbar button {
  color: #222;
  background: #fff;
  border: 1px solid #b8b8b8;
  border-radius: 999px;
  padding: 0.22rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  line-height: 1.25;
}

.grid-toolbar button:hover {
  background: #f3f3f3;
  border-color: #999;
}

.danger-btn {
  background: #b42318 !important;
  color: #fff !important;
  border: 1px solid #8e1a12 !important;
}

.danger-btn:hover {
  background: #912018 !important;
  border-color: #7a150f !important;
}

.animals-modal-actions button,
.modal-card .animals-modal-actions button,
.location-form-modal-card .animals-modal-actions button,
.multiply-edit-modal-card .animals-modal-actions button {
  border-radius: 999px;
  padding: 0.28rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.25;
  border: 1px solid transparent;
}

.animals-modal-actions button.secondary {
  background: #6b655a;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-overlay[hidden] {
  display: none !important;
}

.modal-card {
  width: min(520px, 92vw);
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 14px;
}

.export-selection-modal-card {
  width: min(480px, 94vw);
}

.export-selection-summary {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: #344054;
  font-weight: 600;
}

.export-selection-hint {
  margin: 0 0 10px;
  font-size: 0.78rem;
}

.export-fieldset {
  border: 1px solid #e4e7ec;
  border-radius: 6px;
  padding: 8px 10px 10px;
  margin: 0 0 10px;
}

.export-fieldset legend {
  padding: 0 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #475467;
}

.export-format-row,
.export-check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.85rem;
}

.export-format-row label,
.export-check-row label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.export-check-row.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.export-selection-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.export-selection-actions .primary-btn {
  background: #2d5a27;
  color: #fff;
  border: 1px solid #2d5a27;
  border-radius: 4px;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
}

.export-selection-actions .primary-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.multiply-edit-modal-card {
  width: min(720px, 96vw);
  border: 2px solid #b42318;
}

.multiply-edit-warning {
  margin: 0 0 10px 0;
  color: #b42318;
  font-weight: 700;
}

.multiply-edit-selected-count {
  margin: 0 0 10px 0;
  color: #344054;
  font-size: 13px;
}

.multiply-edit-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.multiply-edit-field-row {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 8px;
  align-items: center;
}

.multiply-edit-field-toggle {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-size: 13px;
}

.animals-sample-modal-card {
  width: min(520px, 92vw);
}

.animals-sample-form {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 8px;
  align-items: center;
}

.animals-sample-form input,
.animals-sample-form select,
.animals-sample-form textarea {
  width: 100%;
}

.animals-modal-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.location-photo-drop {
  border: 2px dashed var(--line);
  border-radius: 8px;
  padding: 0.75rem;
  margin-top: 0.5rem;
  transition: border-color 0.15s, background 0.15s;
}

.location-photo-drop.is-dragover {
  border-color: var(--accent);
  background: #e7f2ec;
}

.location-photo-drop .location-photo-drop-hint {
  margin: 0 0 0.5rem 0;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.location-form-modal-card.modal-card,
.location-form-modal-card {
  width: min(1568px, 98vw) !important;
  max-width: 98vw !important;
  max-height: 92vh;
  overflow: auto;
}
.location-form-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(420px, 1.2fr);
  gap: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .location-form-layout {
    grid-template-columns: 1fr;
  }
}
.location-form-side {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.location-form-map-hint {
  margin: 0;
  font-size: 0.82rem;
}
.location-form-map {
  width: 100%;
  height: 320px;
  border: 1px solid #c9d0d8;
  border-radius: 6px;
  z-index: 0;
}
.location-form-photos-title {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
}
.location-form-photos-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.45rem;
  max-height: 180px;
  overflow: auto;
}
.location-form-pending-photo {
  min-height: 72px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.35rem;
  background: #f5f7fa;
}
.location-form-pending-label {
  font-size: 0.72rem;
  word-break: break-all;
}
.location-form-photo-drop {
  margin-top: 0.15rem;
}

.location-visits-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.65rem 0.85rem;
  margin: 0.35rem 0 0.25rem;
}
.location-visits-header .location-visits-title {
  margin: 0;
  font-size: 1.05rem;
}
.location-visits-header .grid-toolbar {
  margin: 0;
  display: flex;
  gap: 0.4rem;
}
#visits-add-btn:disabled,
#visits-edit-btn:disabled,
#visits-delete-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.visit-delete-media-count {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0.4rem 0;
}

.visits-timeline {
  margin-top: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0.55rem 0.65rem 0.7rem;
}
.visits-timeline-title {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  font-weight: 600;
}
.visits-timeline-body {
  width: 100%;
  overflow-x: auto;
}
.visits-timeline-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}
.visits-timeline svg {
  display: block;
  min-width: 560px;
  width: 100%;
  height: auto;
}
.visits-timeline-axis {
  stroke: #c5cdd4;
  stroke-width: 1;
}
.visits-timeline-grid {
  stroke: #e8edf1;
  stroke-width: 1;
}
.visits-timeline-label {
  fill: #334155;
  font-size: 11px;
  font-family: inherit;
}
.visits-timeline-tick {
  fill: #64748b;
  font-size: 10px;
  font-family: inherit;
}
.visits-timeline-bar {
  stroke: none;
  opacity: 0.92;
}
.visits-timeline-bar.is-empty-media {
  opacity: 0.7;
}
.visits-timeline-legend {
  margin: 0.35rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.upload-picker-panel {
  max-width: 42rem;
}
.upload-picker-title {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
}
.upload-location-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.upload-location-combobox {
  position: relative;
}
.upload-location-search {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.95rem;
}
.upload-location-results {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  max-height: 280px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.upload-location-option {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: transparent;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  font: inherit;
}
.upload-location-option.is-station-active {
  background: #e8f7ee;
}
.upload-location-option.is-station-inactive {
  background: #fdeceb;
}
.upload-location-option.is-station-active:hover,
.upload-location-option.is-station-active.is-active {
  background: #d5f0df;
}
.upload-location-option.is-station-inactive:hover,
.upload-location-option.is-station-inactive.is-active {
  background: #f8d7d4;
}
.upload-location-option-line {
  display: block;
  color: #475569;
  font-size: 0.78rem;
  line-height: 1.35;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upload-map {
  min-height: 420px;
  height: calc(100vh - 180px);
}
.upload-map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  margin: 0.55rem 0 0;
  font-size: 0.85rem;
}
.upload-legend-dot {
  display: inline-block;
  width: 0.7rem;
  height: 0.7rem;
  border-radius: 50%;
  margin-right: 0.3rem;
  vertical-align: -0.05rem;
  border: 1px solid rgba(0, 0, 0, 0.2);
}
.upload-legend-dot.is-active { background: #2563eb; }
.upload-legend-dot.is-inactive { background: #eab308; }
.upload-legend-dot.is-selected { background: #dc2626; }

/* Permanent labels next to location markers (Lokacije map). */
.leaflet-tooltip.station-map-label {
  padding: 1px 5px;
  border: 1px solid rgba(15, 23, 42, 0.18);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
  font-size: 10px;
  line-height: 1.25;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.leaflet-tooltip.station-map-label.is-hidden {
  display: none !important;
}
.leaflet-tooltip.station-map-label::before {
  border-right-color: rgba(255, 255, 255, 0.92);
}
.station-map-label-code {
  display: block;
  font-weight: 650;
  font-size: 10px;
}
.station-map-label-name {
  display: block;
  font-weight: 400;
  font-size: 9px;
  color: #334155;
  max-width: 210px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-station-marker {
  background: transparent;
  border: 0;
}
.upload-station-dot {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.35), 0 2px 6px rgba(15, 23, 42, 0.25);
}

.upload-visit-block,
.upload-media-block {
  margin-top: 1.1rem;
}
.upload-select {
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: #fff;
}
.upload-camera-wrap {
  margin-top: 0.75rem;
}
.upload-media-kind-wrap {
  margin-top: 0.85rem;
  max-width: 11rem;
}
.upload-media-kind-select {
  width: 100%;
  max-width: 11rem;
}
.upload-dropzone {
  border: 2px dashed #94a3b8;
  border-radius: 10px;
  padding: 1.1rem 1rem;
  text-align: center;
  background: #f8fafc;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.upload-dropzone.is-dragover {
  border-color: #2563eb;
  background: #eff6ff;
}
.upload-dropzone-title {
  margin: 0 0 0.25rem;
  font-weight: 600;
}
.upload-dropzone-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.75rem;
}
.upload-file-summary {
  margin: 0.55rem 0 0;
}
.upload-prepare-row {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.45rem;
}
.upload-prepare-progress {
  height: 8px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.upload-prepare-progress-bar {
  height: 100%;
  width: 0;
  background: #2563eb;
  transition: width 0.12s linear;
}
.upload-prepare-status {
  margin: 0;
  font-size: 0.85rem;
  min-height: 1.2em;
}
.upload-ai-progress-modal-card {
  width: min(560px, 94vw);
  display: grid;
  gap: 0.65rem;
}
.upload-ai-progress-modal-card h3 {
  margin: 0;
  font-size: 1.05rem;
}
.upload-ai-progress-meta {
  margin: 0;
  font-size: 0.88rem;
  color: #475569;
}
.upload-ai-progress-bar-wrap {
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.upload-ai-progress-bar {
  height: 100%;
  width: 0%;
  background: #2563eb;
  transition: width 0.15s linear;
}
.upload-ai-progress-bar.is-error {
  background: #b42318;
}
.upload-ai-progress-bar.is-done {
  background: #15803d;
}
.upload-ai-progress-log {
  margin: 0;
  max-height: 220px;
  overflow: auto;
  padding: 0.55rem 0.65rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}
.upload-ai-progress-log .is-err {
  color: #b42318;
}
.upload-ai-progress-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}
.upload-report {
  margin-top: 1rem;
  padding: 0.85rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.upload-report h3 {
  margin: 0 0 0.55rem;
  font-size: 1rem;
}
.upload-report-list {
  margin: 0;
  padding-left: 1.1rem;
  line-height: 1.55;
}
.upload-report-earliest {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
}
.upload-report-exif-btn {
  margin: 0;
  padding: 0.22rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.25;
  border-radius: 999px;
  white-space: nowrap;
}
.upload-report-problems {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: #9a3412;
}
.upload-report-actions {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}
.upload-upload-later {
  margin: 0.55rem 0 0;
  font-size: 0.85rem;
}

.modal-card.upload-file-tree-modal-card {
  width: min(2880px, 98vw);
  max-width: 98vw;
  max-height: min(92vh, 1100px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
}
.upload-file-tree-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.35rem 0 0.65rem;
}
.upload-file-tree-toolbar .btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}
.upload-file-tree-count {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--muted, #64748b);
}
.upload-file-tree-body {
  display: flex;
  gap: 0.65rem;
  flex: 1;
  min-height: 0;
  align-items: stretch;
}
.upload-file-tree {
  flex: 1 1 50%;
  min-width: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fafbfc;
  padding: 0.35rem 0.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  user-select: none;
  min-height: 280px;
  max-height: min(62vh, 640px);
}
.upload-file-tree-preview {
  flex: 1 1 50%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f172a;
  overflow: hidden;
  min-height: 280px;
  max-height: min(62vh, 640px);
}
.upload-file-tree-dt-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.55rem;
  background: #1e293b;
  border-bottom: 1px solid #334155;
}
.upload-file-tree-date-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}
.upload-file-tree-date,
.upload-file-tree-time {
  border: 1px solid #475569;
  border-radius: 6px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.8rem;
  padding: 0.22rem 0.4rem;
  line-height: 1.3;
  color-scheme: dark;
}
.upload-file-tree-date {
  width: 7.2rem;
  font-variant-numeric: tabular-nums;
}
.upload-file-tree-date::placeholder {
  color: #64748b;
}
.upload-file-tree-date-picker {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
  border: 0;
  padding: 0;
}
.upload-file-tree-cal-btn {
  border: 1px solid #475569 !important;
  border-radius: 6px !important;
  background: #334155 !important;
  color: #e2e8f0 !important;
  padding: 0.18rem 0.4rem !important;
  font-size: 0.75rem !important;
  line-height: 1.2 !important;
  min-width: 1.6rem;
}
.upload-file-tree-cal-btn:hover {
  background: #475569 !important;
}
.upload-file-tree-time {
  width: 6.4rem;
  font-variant-numeric: tabular-nums;
}
.upload-file-tree-time::placeholder {
  color: #64748b;
}
.upload-file-tree-dt-bar button {
  border-radius: 999px;
  padding: 0.22rem 0.7rem;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.25;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.upload-file-tree-dt-bar button.secondary {
  background: #6b655a;
  color: #fff;
}
.upload-file-tree-dt-bar button.secondary:hover {
  background: #5a554c;
}
.upload-file-tree-preview.is-preview-locked .upload-file-tree-preview-media {
  outline: 1px solid #38bdf8;
  outline-offset: -1px;
}
.upload-file-tree-new-dt {
  margin-left: 0.35rem;
  color: #0369a1;
  font-weight: 600;
  font-size: 0.78rem;
  flex: 0 0 auto;
}
.upload-file-tree-preview-media {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  overflow: auto;
  overscroll-behavior: contain;
}
.upload-file-tree-preview-media img,
.upload-file-tree-preview-media video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  background: #020617;
  transform-origin: center center;
  will-change: transform;
}
.upload-file-tree-preview-caption {
  margin: 0;
  padding: 0.45rem 0.65rem;
  font-size: 0.78rem;
  color: #cbd5e1;
  background: #1e293b;
  border-top: 1px solid #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.upload-file-tree-preview-empty {
  color: #94a3b8;
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
}
.upload-file-tree-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.18rem 0.4rem;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.upload-file-tree-row:hover {
  background: #eef2f7;
}
.upload-file-tree-row.is-selected {
  background: #dbeafe;
}
.upload-file-tree-row.is-folder {
  font-weight: 600;
}
.upload-file-tree-row.is-dupe,
.upload-file-tree-row.is-dupe .upload-file-tree-name,
.upload-file-tree-row.is-dupe .upload-file-tree-meta {
  color: #b91c1c;
  font-weight: 600;
}
.upload-file-tree-row.is-dupe {
  background: #fef2f2;
}
.upload-file-tree-twist {
  width: 1.1rem;
  flex: 0 0 1.1rem;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  color: #475569;
}
.upload-file-tree-twist.is-leaf {
  visibility: hidden;
}
.upload-file-tree-check {
  margin: 0;
  flex: 0 0 auto;
}
.upload-file-tree-icon {
  flex: 0 0 auto;
  opacity: 0.75;
  width: 1rem;
  text-align: center;
}
.upload-file-tree-name {
  overflow: hidden;
  text-overflow: ellipsis;
}
.upload-file-tree-meta {
  margin-left: 0.45rem;
  color: #64748b;
  font-weight: 400;
  font-size: 0.78rem;
}
.upload-file-tree-hint {
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
}

.upload-report-actions .btn {
  display: inline-flex;
}
.upload-report-actions .btn:disabled {
  opacity: 0.55;
}
.upload-upload-later {
  flex: 1 1 100%;
}

.upload-file-tree-row.is-out-of-interval,
.upload-file-tree-row.is-out-of-interval .upload-file-tree-name,
.upload-file-tree-row.is-out-of-interval .upload-file-tree-meta {
  color: #b91c1c;
}
.upload-file-tree-row.is-out-of-interval.is-folder .upload-file-tree-name {
  color: #b91c1c;
}
.upload-file-tree-legend {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
}

.library-page {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 40px);
  min-height: 420px;
  padding: 0.35rem 0.4rem 0.4rem;
  box-sizing: border-box;
  gap: 0.35rem;
}
.library-toolbar {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  min-height: 1.6rem;
}
.library-toolbar-bottom {
  padding-top: 0.1rem;
}
.library-functions-wrap {
  margin-left: auto;
  position: relative;
}
.library-functions-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 13.5rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  z-index: 50;
}
.library-functions-menu[hidden] {
  display: none !important;
}
.library-functions-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  font: inherit;
  font-size: 0.8rem;
  color: #0f172a;
  cursor: pointer;
}
.library-functions-item:hover:not(:disabled) {
  background: #f1f5f9;
}
.library-functions-item:disabled {
  opacity: 0.45;
  cursor: default;
}
.library-functions-submenu {
  position: relative;
}
.library-functions-submenu-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.library-functions-caret {
  color: #64748b;
  font-size: 0.7rem;
}
.library-functions-submenu-menu {
  position: absolute;
  top: 0;
  right: calc(100% + 2px);
  min-width: 13.5rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  z-index: 51;
}
.library-functions-submenu-menu[hidden] {
  display: none !important;
}
.library-functions-submenu.is-open > .library-functions-submenu-toggle {
  background: #f1f5f9;
}
@media (max-width: 720px) {
  .library-functions-submenu-menu {
    position: static;
    right: auto;
    margin: 0.15rem 0 0.25rem 0.55rem;
    box-shadow: none;
    border-color: #e2e8f0;
  }
}
.library-special-modal-card {
  width: min(440px, 96vw);
  padding: 0.75rem 0.85rem 0.85rem;
}
.library-special-help {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
  line-height: 1.35;
}
.library-special-species {
  margin-top: 0.65rem;
}
.library-special-species-caption {
  font-size: 0.72rem;
  color: #475569;
  margin-bottom: 0.25rem;
}
.library-special-species-list {
  max-height: 14rem;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.25rem 0.35rem;
  background: #fff;
}
.library-special-species-item {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 0.28rem 0.2rem;
  font-size: 0.78rem;
  color: #0f172a;
  cursor: pointer;
}
.library-special-species-item input {
  margin-top: 0.15rem;
}
.library-tool-btn {
  font: inherit;
  font-size: 0.78rem;
  padding: 0.22rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #0f172a;
  cursor: pointer;
}
.library-tool-btn:hover {
  background: #f1f5f9;
}
.library-tool-btn.is-active {
  border-color: #2563eb;
  color: #1d4ed8;
  background: #eff6ff;
}
.library-event-modal-card {
  width: min(380px, 94vw);
  padding: 0.75rem 0.85rem 0.85rem;
}
.library-event-gap-label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.72rem;
  color: #475569;
}
.library-event-gap-label input {
  width: 6rem;
  padding: 0.28rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 0.85rem;
}
.library-page-size select {
  font: inherit;
  font-size: 0.72rem;
  padding: 0.18rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #0f172a;
  min-width: 3.4rem;
}
.library-pager {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.library-pager-btn {
  font: inherit;
  font-size: 0.85rem;
  line-height: 1;
  width: 1.55rem;
  height: 1.55rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #0f172a;
  cursor: pointer;
}
.library-pager-btn:hover:not(:disabled) {
  background: #f1f5f9;
}
.library-pager-btn:disabled {
  opacity: 0.4;
  cursor: default;
}
.library-pager-label {
  font-size: 0.7rem;
  color: #64748b;
  min-width: 2.8rem;
  text-align: center;
}
.library-status-text {
  font-size: 0.68rem;
  color: #64748b;
  line-height: 1.2;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.library-filter-modal-card {
  width: min(420px, 94vw);
  padding: 0.75rem 0.85rem 0.85rem;
  overflow: visible;
}
.library-filter-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}
.library-filter-modal-head h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
}
.library-filter-close {
  border: 0;
  background: transparent;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: #64748b;
  padding: 0.1rem 0.35rem;
}
.library-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.55rem;
  align-items: end;
  padding: 0;
  border: 0;
  background: transparent;
}
.library-filters label {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  font-size: 0.7rem;
  color: #475569;
  min-width: 0;
}
.library-filters select,
.library-filters input[type="text"] {
  width: 100%;
  min-width: 0;
  padding: 0.22rem 0.35rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 0.78rem;
  color: #0f172a;
  background: #fff;
  box-sizing: border-box;
}
.library-filters-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.15rem;
}
.library-filter-survey-fields {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem 0.55rem;
  align-items: end;
}
.library-filter-survey-fields[hidden] {
  display: none !important;
}
.library-filter-survey-fields label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.68rem;
  color: #475569;
  min-width: 0;
}
.library-filter-survey-fields select,
.library-filter-survey-fields input {
  width: 100%;
  min-width: 0;
  padding: 0.22rem 0.3rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 0.78rem;
  box-sizing: border-box;
}
.library-filter-sort {
  grid-column: 1 / -1;
  margin: 0.15rem 0 0;
  padding: 0.4rem 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
}
.library-filter-sort legend {
  padding: 0;
  margin: 0;
  font-size: 0.7rem;
  color: #475569;
  float: left;
  width: 100%;
  margin-bottom: 0.25rem;
}
.library-filter-sort-opt {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem !important;
  color: #334155 !important;
  cursor: pointer;
  user-select: none;
}
.library-filter-sort-opt input {
  width: 0.9rem;
  height: 0.9rem;
  accent-color: #0f172a;
  margin: 0;
}
.library-filter-btn {
  font: inherit;
  font-size: 0.72rem;
  padding: 0.2rem 0.75rem;
  border: 1px solid #1d4ed8;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
}
.library-filter-btn.secondary {
  background: #fff;
  color: #334155;
  border-color: var(--line);
}
.library-filter-btn:hover {
  filter: brightness(0.97);
}
.library-split {
  flex: 1;
  min-height: 0;
  display: flex;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: transparent;
}
.library-thumbs {
  width: 38%;
  min-width: 200px;
  max-width: 55%;
  overflow: auto;
  background: transparent;
  padding: 0.15rem 0.2rem 0.15rem 0;
  box-sizing: border-box;
}
.library-thumbs-empty {
  padding: 0.5rem 0.15rem;
}
.library-thumbs-grid {
  --library-thumb-size: 180px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--library-thumb-size), 1fr));
  gap: 5px;
  user-select: none;
  align-content: start;
}
.library-event-group {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--library-thumb-size), 1fr));
  gap: 5px;
  margin: 0.45rem 0 0.1rem;
  padding: 0.4rem;
  border-top: 1px solid rgba(148, 163, 184, 0.85);
  background: #dbeafe;
  border-radius: 4px;
  box-sizing: border-box;
}
.library-event-group.is-real-event {
  border-top-color: #2563eb;
  background: #bfdbfe;
}
.library-event-group.is-real-event:nth-of-type(3n + 2) {
  background: #a5f3fc;
  border-top-color: #0891b2;
}
.library-event-group.is-real-event:nth-of-type(3n + 3) {
  background: #c4b5fd;
  border-top-color: #7c3aed;
}
.library-event-group.is-proposed-event {
  background: #dbeafe;
  border-top-style: dashed;
}
.library-event-group.is-proposed-event:nth-of-type(4n + 2) {
  background: #dcfce7;
}
.library-event-group.is-proposed-event:nth-of-type(4n + 3) {
  background: #fef3c7;
}
.library-event-group.is-proposed-event:nth-of-type(4n + 4) {
  background: #fce7f3;
}
.library-event-group:first-child {
  margin-top: 0.1rem;
}
.library-thumb {
  position: relative;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: #e2e8f0;
  cursor: pointer;
  padding: 0;
  aspect-ratio: 4 / 3;
  outline: 2px solid transparent;
  outline-offset: -2px;
}
.library-thumb:hover {
  outline-color: #94a3b8;
}
.library-thumb.is-active {
  outline: 2px solid transparent;
  outline-offset: -2px;
}
.library-thumb.is-selected {
  outline: 4px solid #2563eb;
  outline-offset: -4px;
  box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.35);
}
.library-thumb.is-selected.is-active {
  outline: 4px solid #1d4ed8;
  outline-offset: -4px;
  box-shadow: inset 0 0 0 2px rgba(14, 165, 233, 0.65);
}
.library-thumb.is-special-delete {
  outline: 3px solid #dc2626;
  outline-offset: -3px;
}
.library-thumb.is-special-delete.is-selected {
  outline: 4px solid #dc2626;
  outline-offset: -4px;
  box-shadow: inset 0 0 0 1px rgba(220, 38, 38, 0.35);
}
.library-thumb-special-x {
  position: absolute;
  top: 2px;
  left: 4px;
  z-index: 3;
  color: #dc2626;
  font-size: clamp(1.55rem, 28%, 2.4rem);
  font-weight: 800;
  line-height: 1;
  text-shadow:
    0 0 2px #fff,
    0 1px 2px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  user-select: none;
}
.library-thumb img,
.library-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #0f172a;
}
.library-thumb-badge {
  position: absolute;
  left: 0.2rem;
  bottom: 0.2rem;
  font-size: 0.6rem;
  padding: 0.02rem 0.25rem;
  border-radius: 3px;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
}
.library-thumb-status {
  position: absolute;
  top: 0.28rem;
  right: 0.28rem;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.25);
  pointer-events: none;
  z-index: 1;
}
.library-thumb-status.is-pending {
  background: #dc2626;
}
.library-thumb-status.is-detected {
  background: #eab308;
}
.library-thumb-status.is-reviewed {
  background: #16a34a;
}
.library-thumb-status.is-attention {
  background: #a855f7;
}
.library-thumb-status.is-skipped {
  background: #94a3b8;
}
.library-splitter {
  width: 6px;
  flex: 0 0 6px;
  cursor: col-resize;
  border: 0;
  background: transparent;
}
.library-splitter:hover,
.library-splitter.is-dragging {
  background: rgba(37, 99, 235, 0.18);
}
.library-viewer {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #0b1220;
  color: #e2e8f0;
  border: 0;
  border-radius: 0;
  position: relative;
}
.library-viewer-toolbar {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 3;
  display: flex;
  gap: 0.35rem;
}
.library-annotate-btn {
  font: inherit;
  font-size: 0.72rem;
  padding: 0.2rem 0.7rem;
  border: 1px solid rgba(226, 232, 240, 0.35);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #f8fafc;
  cursor: pointer;
}
.library-annotate-btn:hover:not(:disabled) {
  background: rgba(37, 99, 235, 0.85);
  border-color: rgba(147, 197, 253, 0.7);
}
.library-annotate-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.library-viewer-toolbar-bottom {
  position: absolute;
  right: 0.4rem;
  bottom: 0.4rem;
  z-index: 3;
  display: flex;
  gap: 0.35rem;
}
.library-viewer-footer {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.5rem 0.45rem;
  min-height: 2rem;
}
.library-viewer-footer .library-viewer-meta {
  flex: 1;
  min-width: 0;
  padding: 0;
}
.library-viewer-footer .library-delete-btn {
  flex: 0 0 auto;
  margin-left: auto;
}
.library-delete-btn {
  font: inherit;
  font-size: 0.58rem;
  line-height: 1.1;
  padding: 0.08rem 0.38rem;
  border: 1px solid rgba(248, 113, 113, 0.55);
  border-radius: 999px;
  background: rgba(127, 29, 29, 0.82);
  color: #fef2f2;
  cursor: pointer;
}
.library-delete-btn:hover:not(:disabled) {
  background: rgba(185, 28, 28, 0.95);
  border-color: rgba(252, 165, 165, 0.8);
}
.library-delete-btn:disabled {
  opacity: 0.35;
  cursor: default;
}
.library-delete-modal-card {
  width: min(420px, 94vw);
  padding: 0.75rem 0.85rem 0.85rem;
  border: 2px solid #b91c1c;
}
.library-delete-warning {
  margin: 0 0 0.45rem;
  color: #b91c1c;
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.35;
}
.library-delete-count {
  margin: 0;
  color: #7f1d1d;
  font-size: 0.85rem;
  font-weight: 600;
}
.library-delete-confirm-btn {
  font: inherit;
  font-size: 0.72rem;
  padding: 0.2rem 0.75rem;
  border: 1px solid #b91c1c;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  cursor: pointer;
}
.library-delete-confirm-btn:hover:not(:disabled) {
  background: #b91c1c;
}
.library-delete-confirm-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.library-annotate-modal-card {
  width: min(832px, 96vw);
  padding: 0.75rem 0.85rem 0.85rem;
}
.library-annotate-modal-head {
  align-items: flex-start;
}
.library-annotate-title-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
  min-width: 0;
  flex: 1;
}
.library-annotate-title-line h2 {
  flex: 0 0 auto;
}
.library-annotate-file {
  margin: 0;
  font-size: 0.72rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.library-annotate-rows {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: min(50vh, 360px);
  overflow-x: hidden;
  overflow-y: auto;
  margin-bottom: 0.55rem;
}
.library-annotate-row {
  display: grid;
  grid-template-columns: minmax(0, 18.6rem) 2.85rem 2.95rem 2.35rem 1.4rem;
  gap: 0.25rem;
  align-items: end;
  justify-content: start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.library-annotate-species-field {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.68rem;
  color: #475569;
  min-width: 0;
  max-width: 100%;
}
.library-annotate-row .library-annotate-species-picker,
.library-annotate-row .library-annotate-species-control,
.library-annotate-row .library-annotate-species-search {
  min-width: 0;
  max-width: 100%;
}
.library-annotate-row .library-annotate-species-search {
  overflow: hidden;
  text-overflow: ellipsis;
}
.library-annotate-row-details {
  display: contents;
}
.library-annotate-row label,
.library-annotate-row-details label {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.68rem;
  color: #475569;
  min-width: 0;
  max-width: 100%;
}
.library-annotate-row select,
.library-annotate-row input,
.library-annotate-row-details select,
.library-annotate-row-details input {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 0.22rem 0.2rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 0.78rem;
  box-sizing: border-box;
}
.library-annotate-row select,
.library-annotate-row-details select {
  text-overflow: ellipsis;
}
.library-annotate-remove {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #64748b;
  height: 1.7rem;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  align-self: end;
}
.library-annotate-remove:hover {
  color: #b91c1c;
  border-color: #fca5a5;
}
.library-annotate-attention {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  color: #334155;
  user-select: none;
}
.library-annotate-attention[hidden] {
  display: none !important;
}
.library-annotate-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 0.4rem 0.75rem;
  margin: 0 0 0.55rem;
  align-items: end;
}
.library-annotate-meta label {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.68rem;
  color: #475569;
  width: auto;
  flex: 0 0 auto;
}
.library-annotate-meta label:first-child {
  width: 7.25rem;
}
.library-annotate-scalp-label {
  width: 10.5rem !important;
  white-space: nowrap;
}
.library-filter-scalp-label {
  white-space: nowrap;
}
.library-annotate-meta select {
  width: 100%;
  min-width: 0;
  padding: 0.22rem 0.3rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 0.78rem;
  box-sizing: border-box;
}
.library-filter-species-field {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  font-size: 0.7rem;
  color: #475569;
  min-width: 0;
  position: relative;
  z-index: 5;
}
.library-filter-station-field {
  grid-column: auto;
  z-index: 6;
}
.library-filter-station-field .library-annotate-species-picker.is-menu-open {
  z-index: 7;
}
/* Override .library-filters label { flex-direction: column } */
.library-filters .library-filter-station-opt,
.library-filter-station-opt {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 0.45rem;
  width: 100% !important;
  max-width: none;
  box-sizing: border-box;
  margin: 0;
  padding: 0.32rem 0.45rem;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 400;
  color: #0f172a;
  cursor: pointer;
  text-align: left;
  line-height: 1.25;
}
.library-filter-station-opt:hover {
  background: #eff6ff;
}
.library-filter-station-opt.is-selected {
  background: #dbeafe;
  font-weight: 600;
}
.library-filter-station-opt.is-empty {
  cursor: default;
  color: #94a3b8;
  font-weight: 400;
}
.library-filter-station-opt.is-empty:hover {
  background: #fff;
}
.library-filters .library-filter-station-opt input[type="checkbox"],
.library-filter-station-opt input[type="checkbox"] {
  width: 0.9rem !important;
  height: 0.9rem !important;
  min-width: 0.9rem;
  margin: 0 !important;
  padding: 0;
  flex: 0 0 auto !important;
  align-self: center;
  accent-color: #2563eb;
}
.library-filters .library-filter-station-opt > span,
.library-filter-station-opt > span {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.76rem;
  color: inherit;
}
.library-filter-station-opt:first-child {
  background: #f8fafc;
  font-weight: 700;
  letter-spacing: 0.02em;
  position: sticky;
  top: 0;
  z-index: 1;
}
.library-filter-station-opt:first-child.is-selected {
  background: #dbeafe;
}
.library-filter-station-menu {
  min-width: min(22rem, 92vw);
}
.library-filter-species-caption {
  line-height: 1.2;
}
.library-filter-species-host {
  min-width: 0;
}
.library-annotate-species-picker {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.library-annotate-species-control {
  position: relative;
  min-width: 0;
}
.library-annotate-species-search {
  width: 100%;
  min-width: 0;
  padding: 0.22rem 0.3rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 0.78rem;
  box-sizing: border-box;
}
.library-annotate-species-menu {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  max-height: 11rem;
  overflow: auto;
}
/* Filter: overlay below the search field, full width, no grid stretch */
.library-annotate-species-menu.is-filter-list {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  width: auto;
  max-height: min(16rem, 42vh);
  z-index: 40;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
}
.library-annotate-species-menu[hidden] {
  display: none !important;
}
.library-annotate-species-opt,
.library-annotate-species-more {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #f1f5f9;
  background: #fff;
  padding: 0.28rem 0.4rem;
  font: inherit;
  font-size: 0.74rem;
  color: #0f172a;
  cursor: pointer;
}
.library-annotate-species-opt:hover,
.library-annotate-species-more:hover {
  background: #eff6ff;
}
.library-annotate-species-opt.is-selected {
  background: #dbeafe;
  font-weight: 600;
}
.library-annotate-species-more {
  color: #1d4ed8;
  font-weight: 600;
  border-bottom: 0;
}
.library-annotate-fields {
  margin: 0 0 0.65rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--line);
}
.library-annotate-fields[hidden] {
  display: none !important;
}
.library-annotate-fields-title {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
}
.library-annotate-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 0.5rem;
}
.library-annotate-fields-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.68rem;
  color: #475569;
  min-width: 0;
}
.library-annotate-fields-grid select,
.library-annotate-fields-grid input {
  width: 100%;
  min-width: 0;
  padding: 0.22rem 0.3rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  font-size: 0.78rem;
  box-sizing: border-box;
}
.library-annotate-field-inline {
  display: flex !important;
  flex-direction: row !important;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
  padding: 0.1rem 0;
}
.library-annotate-field-label {
  flex: 0 1 auto;
  font-size: 0.8rem;
  color: #334155;
  white-space: nowrap;
}
.library-annotate-field-combo {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.library-annotate-field-combo select,
.library-annotate-field-combo input {
  width: 100%;
  max-width: 16rem;
}
.library-annotate-field-custom[hidden] {
  display: none !important;
}
.library-annotate-attention input {
  width: 0.95rem;
  height: 0.95rem;
  accent-color: #0f172a;
}
.library-annotate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  justify-content: space-between;
}
.library-annotate-actions-right {
  display: flex;
  gap: 0.4rem;
  margin-left: auto;
}
.library-viewer-empty {
  margin: auto;
  padding: 1rem;
  color: #94a3b8;
}
.library-viewer-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  position: relative;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.library-viewer-source-badge {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  z-index: 5;
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.72);
  color: #f8fafc;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.2;
  pointer-events: none;
  text-transform: lowercase;
}
.library-viewer-source-badge[hidden] {
  display: none !important;
}
.library-viewer-source-badge[data-mode="thumb"] {
  background: rgba(180, 83, 9, 0.82);
}
.library-viewer-source-badge[data-mode="img"] {
  background: rgba(15, 23, 42, 0.72);
}
.library-viewer-stage.is-panning {
  cursor: grabbing;
}
.library-viewer-canvas {
  transform-origin: center center;
  will-change: transform;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
}
.library-viewer-stage img,
.library-viewer-stage video {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  background: #000;
  display: block;
  pointer-events: none;
}
.library-viewer-stage img[hidden],
.library-viewer-stage video[hidden] {
  display: none !important;
}
.library-viewer-stage img,
.library-viewer-stage video {
  pointer-events: auto;
}
.library-video-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  padding: 0.35rem 0.55rem;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
}
.library-video-toolbar[hidden] {
  display: none !important;
}
.library-video-speed {
  display: inline-flex;
  gap: 0.15rem;
}
.library-video-speed-btn {
  min-width: 2.1rem;
  padding: 0.2rem 0.35rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  font-size: 0.8rem;
  cursor: pointer;
}
.library-video-speed-btn.is-active {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}
.library-video-marks {
  font-size: 0.78rem;
  white-space: nowrap;
}
.library-video-hint {
  font-size: 0.72rem;
  margin-left: 0.15rem;
}
.library-video-proxy-busy {
  opacity: 0.7;
  pointer-events: none;
}
.library-viewer-adjust {
  position: absolute;
  left: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.45rem 0.5rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.35);
  min-width: 8.5rem;
}
.library-viewer-adjust[hidden] {
  display: none !important;
}
.library-viewer-adjust label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.68rem;
  color: #e2e8f0;
}
.library-viewer-adjust input[type="range"] {
  width: 7.5rem;
  accent-color: #38bdf8;
}
.library-viewer-meta {
  padding: 0.35rem 0.5rem 0.45rem;
  border-top: 0;
  font-size: 0.78rem;
  color: #cbd5e1;
}
.library-viewer-footer .library-viewer-meta[hidden] {
  display: none;
}
@media (max-width: 900px) {
  .library-page {
    height: auto;
  }
  .library-filters {
    grid-template-columns: 1fr;
  }
  .library-annotate-row {
    grid-template-columns: minmax(0, 18.6rem) 2.85rem 2.95rem 2.35rem 1.4rem;
  }
  .library-split {
    flex-direction: column;
    min-height: 70vh;
  }
  .library-thumbs {
    width: 100%;
    max-width: none;
    max-height: 40vh;
    padding: 0;
  }
  .library-splitter {
    width: 100%;
    height: 6px;
    cursor: row-resize;
  }
}

.upload-import-banner {
  margin: 0 0 0.75rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid #f59e0b;
  border-radius: 10px;
  background: #fffbeb;
  color: #92400e;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}
.upload-import-banner[hidden] {
  display: none !important;
}
.upload-import-banner .btn {
  margin: 0;
}
.upload-import-banner-text {
  flex: 1 1 220px;
  font-size: 0.9rem;
}

#upload-visit-select option.upload-visit-empty-media {
  background-color: #fef3c7 !important;
  color: #92400e !important;
}
#upload-visit-select.has-empty-visit {
  background-color: #fef3c7 !important;
  border-color: #f59e0b !important;
  color: #92400e !important;
}

.upload-report-list .upload-report-out-of-range,
.upload-report-out-of-range,
.upload-report-list .upload-report-dupes,
.upload-report-dupes {
  color: #b91c1c;
  font-weight: 600;
}
