.ups-record-media-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 -4px;
}

.ups-record-media-title strong {
  color: #234d35;
  font-size: 15px;
}

.ups-record-media-title small,
.ups-leaf-media-hint {
  color: #637168;
  font-size: 12px;
}

.ups-leaf-media {
  min-width: 0;
  margin: 16px 0;
  padding: 14px;
  border: 1px solid #b9cfc0;
  border-radius: 16px;
  background: #f6fbf7;
}

.ups-leaf-media legend {
  padding: 0 8px;
  color: #1f5a3c;
  font-weight: 800;
}

.ups-leaf-media-hint {
  margin: 0 0 12px;
  line-height: 1.55;
}

.ups-leaf-media-actions {
  margin: 0;
}

.ups-leaf-media-error {
  min-height: 18px;
  margin: 8px 0 0;
  color: #a33e42;
  font-size: 12px;
}

.ups-leaf-media-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.ups-leaf-media-preview > small {
  grid-column: 1 / -1;
  color: #78857d;
}

.ups-leaf-media-preview article {
  overflow: hidden;
  border: 1px solid #d3e1d7;
  border-radius: 12px;
  background: #fff;
}

.ups-leaf-media-preview img {
  display: block;
  width: 100%;
  height: 112px;
  object-fit: cover;
  background: #e7eee9;
}

.ups-leaf-media-preview article div {
  display: grid;
  gap: 4px;
  padding: 8px;
}

.ups-leaf-media-preview strong,
.ups-leaf-media-preview span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ups-leaf-media-preview strong {
  font-size: 12px;
}

.ups-leaf-media-preview span {
  color: #647068;
  font-size: 11px;
}

.ups-leaf-media-preview button,
.ups-leaf-media-clear {
  border: 0;
  color: #9c393f;
  background: transparent;
  font-weight: 700;
}

.ups-leaf-media-clear {
  grid-column: 1 / -1;
  justify-self: end;
}

.ups-record-photo-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 8px;
}

.ups-record-photo-heading strong {
  color: #284e39;
}

.ups-record-photo-heading small {
  color: #78827b;
  font-size: 11px;
}

.ups-record-photo-heading.is-leaf {
  padding-top: 12px;
  border-top: 1px solid #e0e8e2;
}

.ups-species-suggestions,
.ups-species-suggestions button {
  touch-action: pan-y !important;
}

.ups-place-suggestions {
  position: relative;
  z-index: 120;
  display: grid;
  max-height: min(52vh, 390px);
  overflow-y: auto;
  gap: 5px;
  margin: -7px 0 12px;
  padding: 8px;
  border: 1px solid #cbdacf;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 36px rgb(27 62 41 / 16%);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

.ups-place-suggestions[hidden] {
  display: none !important;
}

.ups-place-suggestion,
.ups-place-custom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 10px 12px;
  border: 0;
  border-radius: 11px;
  color: #234435;
  background: #fff;
  text-align: left;
  touch-action: pan-y;
}

.ups-place-suggestion:hover,
.ups-place-suggestion:focus,
.ups-place-custom:hover,
.ups-place-custom:focus {
  background: #edf7ef;
  outline: none;
}

.ups-place-suggestion > span,
.ups-place-custom {
  min-width: 0;
}

.ups-place-suggestion > span,
.ups-place-custom {
  display: grid;
  gap: 3px;
}

.ups-place-suggestion strong,
.ups-place-custom strong {
  font-size: 14px;
}

.ups-place-suggestion small,
.ups-place-custom small {
  overflow: hidden;
  color: #66746b;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ups-place-suggestion em {
  color: #52725d;
  font-size: 10px;
  font-style: normal;
  white-space: nowrap;
}

.ups-place-custom {
  display: grid;
  grid-template-columns: 1fr;
  border: 1px dashed #9eb9a7;
  background: #f6faf7;
}

.ups-place-loading,
.ups-place-attribution {
  padding: 9px 11px;
  color: #69766e;
  font-size: 11px;
  line-height: 1.5;
}

.ups-place-attribution.is-warning {
  color: #8a552f;
}

body.ups-admin-records-open {
  overflow: hidden;
}

.ups-admin-records-overlay {
  position: fixed;
  z-index: 18000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgb(14 31 22 / 74%);
  backdrop-filter: blur(4px);
}

.ups-admin-records-card {
  display: flex;
  flex-direction: column;
  width: min(1180px, 100%);
  max-height: min(940px, calc(100dvh - 36px));
  overflow: hidden;
  border-radius: 22px;
  background: #f7f9f7;
  box-shadow: 0 30px 90px rgb(0 0 0 / 34%);
}

.ups-admin-records-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px;
  color: #fff;
  background: linear-gradient(135deg, #204c34, #356c4d);
}

.ups-admin-records-card > header span {
  color: #cfe3d5;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
}

.ups-admin-records-card > header h2 {
  margin: 3px 0 2px;
  font-size: 22px;
}

.ups-admin-records-card > header p {
  margin: 0;
  color: #e0ece4;
  font-size: 12px;
}

.ups-admin-records-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid rgb(255 255 255 / 35%);
  border-radius: 50%;
  color: #fff;
  background: rgb(255 255 255 / 10%);
  font-size: 25px;
}

.ups-admin-records-body {
  overflow: auto;
  padding: 18px 22px 24px;
}

.ups-admin-records-notice {
  margin-bottom: 12px;
  padding: 11px 13px;
  border: 1px solid #c5d9cb;
  border-radius: 12px;
  color: #315440;
  background: #edf5ef;
}

.ups-admin-records-notice.is-warning {
  border-color: #e4c2a6;
  color: #825027;
  background: #fff4e8;
}

.ups-admin-records-notice.is-success {
  border-color: #a9cdb5;
  color: #27603d;
  background: #e8f6ec;
}

.ups-admin-records-summary {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid #d7e2da;
  border-radius: 13px;
  background: #fff;
}

.ups-admin-records-summary strong {
  color: #24583a;
  font-size: 23px;
}

.ups-admin-records-summary span {
  margin-right: 12px;
  color: #6b786f;
  font-size: 12px;
}

.ups-admin-records-search {
  width: 100%;
  margin-bottom: 7px;
  padding: 11px 13px;
  border: 1px solid #ccd8cf;
  border-radius: 11px;
  background: #fff;
}

.ups-admin-records-status {
  display: block;
  margin: 0 0 9px;
  color: #6b776f;
}

.ups-admin-records-list {
  display: grid;
  gap: 8px;
}

.ups-admin-records-list article {
  display: grid;
  grid-template-columns: 38px minmax(220px, 1fr) minmax(210px, .8fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #d8e2da;
  border-radius: 13px;
  background: #fff;
}

.ups-admin-records-list article > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  background: #386d4e;
  font-weight: 800;
}

.ups-admin-records-list article > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.ups-admin-records-list strong {
  color: #254d36;
}

.ups-admin-records-list em,
.ups-admin-records-list small,
.ups-admin-records-list time {
  overflow: hidden;
  color: #68746d;
  font-size: 11px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ups-admin-records-list article > button {
  padding: 9px 11px;
  border: 1px solid #9fbca8;
  border-radius: 9px;
  color: #28593c;
  background: #f2f8f3;
  font-weight: 700;
}

.ups-admin-records-empty {
  padding: 30px;
  color: #69756d;
  text-align: center;
}

.ups-admin-record-editor {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.ups-admin-record-field {
  display: grid;
  gap: 6px;
}

.ups-admin-record-field > span {
  color: #496054;
  font-size: 12px;
  font-weight: 700;
}

.ups-admin-record-field input,
.ups-admin-record-field select,
.ups-admin-record-field textarea {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid #ccd7cf;
  border-radius: 10px;
  color: #223b2e;
  background: #fff;
}

.ups-admin-record-field:has(textarea) {
  grid-column: 1 / -1;
}

.ups-admin-record-field small {
  color: #718078;
  font-size: 10px;
}

.ups-admin-record-photo-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.ups-admin-record-photos {
  padding: 12px;
  border: 1px solid #d4dfd7;
  border-radius: 13px;
  background: #fff;
}

.ups-admin-record-photos.is-leaf {
  border-color: #a9c7b3;
  background: #f3faf5;
}

.ups-admin-record-photos > header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
}

.ups-admin-record-photos header small {
  color: #718078;
}

.ups-admin-record-photos > div {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.ups-admin-record-photos button {
  position: relative;
  overflow: hidden;
  min-height: 90px;
  padding: 0;
  border: 1px solid #d4ddd6;
  border-radius: 9px;
  color: #647168;
  background: #edf2ee;
}

.ups-admin-record-photos img {
  display: block;
  width: 100%;
  height: 90px;
  object-fit: cover;
}

.ups-admin-record-photos button span {
  position: absolute;
  right: 4px;
  bottom: 4px;
  padding: 2px 5px;
  border-radius: 8px;
  color: #fff;
  background: rgb(0 0 0 / 60%);
  font-size: 10px;
}

.ups-admin-record-error {
  min-height: 20px;
  margin-top: 10px;
  color: #a23c42;
}

.ups-admin-record-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 8px;
}

.ups-admin-record-actions button {
  padding: 10px 14px;
  border: 1px solid #cbd8cf;
  border-radius: 10px;
  color: #355443;
  background: #fff;
  font-weight: 700;
}

.ups-admin-record-actions button.is-primary {
  border-color: #2e6b48;
  color: #fff;
  background: #2e6b48;
}

.ups-admin-record-actions button.is-danger {
  border-color: #d8aeb1;
  color: #9e373e;
  background: #fff5f5;
}

.ups-project-delete-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.ups-project-delete-summary span {
  display: grid;
  gap: 4px;
  padding: 11px;
  border: 1px solid #d9e1da;
  border-radius: 11px;
  color: #657269;
  background: #fff;
  font-size: 11px;
}

.ups-project-delete-summary strong {
  color: #28553a;
  font-size: 22px;
}

.ups-project-delete-warning {
  margin: 12px 0;
  padding: 13px;
  border: 1px solid #e2b6b9;
  border-radius: 12px;
  color: #80363b;
  background: #fff1f1;
}

.ups-project-delete-warning p {
  margin: 5px 0 0;
}

.ups-project-delete-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 12px 0;
  color: #7f383e;
  font-weight: 700;
}

.ups-project-delete-checkbox input {
  width: 18px;
  height: 18px;
}

.ups-project-delete-error {
  min-height: 20px;
  margin-top: 8px;
  color: #9e363d;
}

@media (max-width: 760px) {
  .ups-admin-records-overlay {
    padding: 0;
  }

  .ups-admin-records-card {
    width: 100%;
    max-height: 100dvh;
    border-radius: 0;
  }

  .ups-admin-records-body {
    padding: 14px;
  }

  .ups-admin-records-list article {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .ups-admin-records-list article > div:nth-of-type(2),
  .ups-admin-records-list article > button {
    grid-column: 2;
  }

  .ups-admin-record-editor {
    grid-template-columns: 1fr;
  }

  .ups-admin-record-field:has(textarea) {
    grid-column: auto;
  }

  .ups-admin-record-photo-area {
    grid-template-columns: 1fr;
  }

  .ups-admin-record-photos > div {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ups-admin-record-actions {
    flex-wrap: wrap;
  }

  .ups-project-delete-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.ups-record-photo-grid.is-leaf .ups-record-photo {
  border-color: #8eb69d;
}

.ups-edit-leaf-photos {
  background: #f4faf5;
  border-color: #a9c8b3;
}

.ups-edit-photo-item.is-leaf span::after {
  content: " · 无水印";
  color: #3f7455;
}

body.ups-overview-open {
  overflow: hidden;
}

.ups-overview-overlay {
  position: fixed;
  z-index: 16000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgb(14 31 22 / 72%);
  backdrop-filter: blur(4px);
}

.ups-overview-card {
  display: flex;
  flex-direction: column;
  width: min(1240px, 100%);
  max-height: min(920px, calc(100dvh - 40px));
  overflow: hidden;
  border-radius: 22px;
  background: #f7f9f7;
  box-shadow: 0 30px 90px rgb(0 0 0 / 32%);
}

.ups-overview-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  color: #fff;
  background: linear-gradient(135deg, #204c34, #356c4d);
}

.ups-overview-card > header span {
  color: #cfe3d5;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.ups-overview-card > header h2 {
  margin: 3px 0 2px;
  font-size: 23px;
}

.ups-overview-card > header p {
  margin: 0;
  color: #e2eee6;
  font-size: 12px;
}

.ups-overview-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid rgb(255 255 255 / 34%);
  border-radius: 50%;
  color: #fff;
  background: rgb(255 255 255 / 10%);
  font-size: 25px;
}

.ups-overview-body {
  overflow: auto;
  padding: 18px 22px 24px;
}

.ups-overview-notice {
  padding: 12px 14px;
  border: 1px solid #c7d9cd;
  border-radius: 12px;
  color: #315440;
  background: #edf5ef;
}

.ups-overview-notice.is-warning {
  border-color: #e6c4a7;
  color: #7c4b24;
  background: #fff4e8;
}

.ups-overview-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.ups-overview-summary div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 13px 15px;
  border: 1px solid #d9e3dc;
  border-radius: 13px;
  background: #fff;
}

.ups-overview-summary strong {
  color: #23573a;
  font-size: 24px;
}

.ups-overview-summary span {
  color: #6a756e;
  font-size: 12px;
}

.ups-overview-controls {
  display: grid;
  grid-template-columns: 1fr 150px minmax(210px, 1.5fr) auto auto;
  gap: 9px;
  margin-bottom: 10px;
}

.ups-overview-controls select,
.ups-overview-controls input,
.ups-overview-controls button {
  min-height: 40px;
  border: 1px solid #cad8ce;
  border-radius: 10px;
  background: #fff;
}

.ups-overview-controls select,
.ups-overview-controls input {
  padding: 0 10px;
}

.ups-overview-controls button {
  padding: 0 13px;
  color: #315940;
  font-weight: 700;
}

.ups-overview-permission {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
  padding: 10px 13px;
  border: 1px solid #d4dfd7;
  border-radius: 11px;
  background: #fff;
}

.ups-overview-permission input {
  width: 18px;
  height: 18px;
}

.ups-overview-permission span {
  color: #294c38;
  font-weight: 750;
}

.ups-overview-permission small {
  margin-left: auto;
  color: #78837c;
}

.ups-overview-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(310px, 0.8fr);
  gap: 14px;
}

.ups-overview-map-panel,
.ups-overview-stats {
  overflow: hidden;
  border: 1px solid #d4dfd7;
  border-radius: 15px;
  background: #fff;
}

.ups-overview-map-panel {
  position: relative;
}

.ups-overview-map {
  height: 560px;
  background: #e7ede9;
}

.ups-overview-fullscreen-button {
  position: absolute;
  z-index: 1000;
  top: 12px;
  left: 58px;
  min-height: 34px;
  padding: 7px 13px;
  border: 1px solid #b9cec0;
  border-radius: 8px;
  color: #24583d;
  background: #fff;
  box-shadow: 0 1px 5px rgb(0 0 0 / 18%);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.ups-overview-history-toggle {
  position: absolute;
  z-index: 1000;
  top: 12px;
  left: 154px;
  min-height: 34px;
  padding: 7px 13px;
  border: 1px solid #b9cec0;
  border-radius: 8px;
  color: #24583d;
  background: #fff;
  box-shadow: 0 1px 5px rgb(0 0 0 / 18%);
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.ups-overview-history-toggle[aria-pressed="true"] {
  color: #fff;
  border-color: #285e3b;
  background: #285e3b;
}

.ups-overview-map-fullscreen .ups-overview-history-toggle {
  top: max(12px, env(safe-area-inset-top));
}

.ups-sample-detail-delete {
  width: 100%;
  margin-top: 14px;
  padding: 11px 14px;
  border: 1px solid #d7a69e;
  border-radius: 10px;
  color: #973a31;
  background: #fff5f3;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.ups-sample-detail-delete:disabled { opacity: .55; cursor: wait; }

@media (max-width: 560px) {
  .ups-overview-history-toggle { left: 145px; padding-inline: 10px; }
}

.ups-overview-overlay.ups-overview-fullscreen-active {
  padding: 0;
  backdrop-filter: none;
}

.ups-overview-map-panel.ups-overview-map-fullscreen {
  position: fixed;
  z-index: 3;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  border: 0;
  border-radius: 0;
  background: #e7ede9;
}

.ups-overview-map-fullscreen .ups-overview-map {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.ups-overview-map-fullscreen .ups-overview-map-status,
.ups-overview-map-fullscreen .ups-overview-legend {
  display: none;
}

.ups-overview-map-fullscreen .ups-overview-fullscreen-button {
  top: max(12px, env(safe-area-inset-top));
}

.ups-overview-map.is-error {
  display: grid;
  place-items: center;
  padding: 30px;
  color: #8c4548;
}

.ups-overview-map-status {
  display: block;
  padding: 9px 12px 4px;
  color: #68746c;
}

.ups-overview-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 5px 12px 11px;
}

.ups-overview-legend span {
  color: #56625b;
  font-size: 11px;
}

.ups-overview-legend span::before {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-right: 5px;
  border-radius: 50%;
  background: var(--ups-project-color);
  content: "";
}

.ups-overview-stats {
  display: flex;
  flex-direction: column;
  max-height: 620px;
}

.ups-overview-stats > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 13px 14px;
  border-bottom: 1px solid #e2e8e4;
}

.ups-overview-stats > header strong {
  color: #264e38;
}

.ups-overview-stats > header small {
  color: #7c8680;
}

.ups-overview-species-list {
  overflow: auto;
}

.ups-overview-species-list article {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 4px 9px;
  align-items: center;
  padding: 9px 12px;
  border-bottom: 1px solid #edf1ee;
}

.ups-overview-species-list article > span {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  background: #52735f;
  font-size: 11px;
}

.ups-overview-species-list article div {
  display: grid;
}

.ups-overview-species-list article strong {
  color: #263e30;
}

.ups-overview-species-list article em {
  overflow: hidden;
  color: #6c766f;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ups-overview-species-list article b {
  color: #ad5539;
  font-size: 18px;
}

.ups-overview-species-list article small {
  grid-column: 2 / 4;
  color: #7a847e;
  font-size: 10px;
}

.ups-overview-popup .leaflet-popup-content {
  display: grid;
  gap: 3px;
  min-width: 180px;
}

.ups-overview-popup strong,
.ups-overview-popup em,
.ups-overview-popup span,
.ups-overview-popup small {
  display: block;
}

.ups-current-project-stats {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid #c9d9ce;
  border-radius: 13px;
  background: #f4f9f5;
}

.ups-current-project-stats > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.ups-current-project-stats > header strong {
  color: #285139;
}

.ups-current-project-stats > header small,
.ups-current-project-stats > p {
  color: #718078;
  font-size: 11px;
}

.ups-current-project-stats > p {
  margin: 8px 0 0;
}

.ups-current-project-species {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.ups-current-project-species > span {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  gap: 5px;
  align-items: center;
  min-width: 0;
  padding: 6px 8px;
  border-radius: 9px;
  background: #fff;
}

.ups-current-project-species i {
  color: #829087;
  font-size: 10px;
  font-style: normal;
}

.ups-current-project-species b {
  overflow: hidden;
  color: #33483a;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ups-current-project-species strong {
  color: #a35239;
  font-size: 12px;
}

.field-nav .ups-overview-field-button span {
  font-size: 20px;
}

.field-nav:has(.ups-overview-field-button) {
  grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 820px) {
  .ups-overview-overlay {
    padding: 0;
  }

  .ups-overview-card {
    width: 100%;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
  }

  .ups-overview-card > header {
    padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
  }

  .ups-overview-card > header h2 {
    font-size: 19px;
  }

  .ups-overview-card > header p {
    display: none;
  }

  .ups-overview-body {
    padding: 12px 12px calc(18px + env(safe-area-inset-bottom));
  }

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

  .ups-overview-summary strong {
    font-size: 20px;
  }

  .ups-overview-controls {
    grid-template-columns: 1fr 1fr;
  }

  .ups-overview-controls input {
    grid-column: 1 / -1;
  }

  .ups-overview-permission {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .ups-overview-permission small {
    flex-basis: 100%;
    margin-left: 27px;
  }

  .ups-overview-workspace {
    grid-template-columns: 1fr;
  }

  .ups-overview-map {
    height: 48dvh;
    min-height: 340px;
  }

  .ups-overview-stats {
    max-height: 480px;
  }
}

@media (max-width: 520px) {
  .ups-leaf-media-preview {
    grid-template-columns: 1fr;
  }

  .ups-current-project-species {
    grid-template-columns: 1fr;
  }
}

/* RC7 sample-detail hotfix: rich point inspection without changing survey data. */
.ups-sample-detail-sheet {
  position: absolute;
  z-index: 1250;
  top: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  width: min(410px, calc(100% - 24px));
  overflow: hidden;
  border: 1px solid rgb(83 121 98 / 28%);
  border-radius: 18px;
  background: rgb(249 252 249 / 97%);
  box-shadow: 0 20px 55px rgb(25 45 32 / 28%);
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(100% + 24px));
  transition: transform 180ms ease, opacity 160ms ease;
  backdrop-filter: blur(12px);
}

.ups-sample-detail-sheet.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.ups-sample-detail-sheet > header {
  display: flex;
  flex: 0 0 auto;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px 13px;
  border-bottom: 1px solid #dce7df;
  background: linear-gradient(135deg, #f7fbf8, #eef6f1);
}

.ups-sample-detail-sheet > header span {
  color: #6b8a78;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.ups-sample-detail-sheet > header h3 {
  margin: 2px 0 2px;
  color: #203e2d;
  font-size: 21px;
  line-height: 1.2;
}

.ups-sample-detail-sheet > header p {
  margin: 0;
  color: #718077;
  font-size: 11px;
}

.ups-sample-detail-close {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid #c9d9cf;
  border-radius: 50%;
  color: #355f48;
  background: #fff;
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}

.ups-sample-detail-body {
  min-height: 0;
  overflow: auto;
  padding: 14px 15px 18px;
}

.ups-sample-detail-content {
  display: grid;
  gap: 13px;
}

.ups-sample-detail-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.ups-sample-detail-content > .ups-sample-detail-badges {
  margin-bottom: 0;
}

.ups-sample-detail-badges span {
  padding: 4px 8px;
  border: 1px solid #bfd4c7;
  border-radius: 999px;
  color: #2f6650;
  background: #edf6f0;
  font-size: 10px;
  font-weight: 750;
}

.ups-sample-detail-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.ups-sample-detail-metrics div {
  min-width: 0;
  padding: 11px 8px;
  border: 1px solid #d8e5dc;
  border-radius: 12px;
  background: #fff;
  text-align: center;
}

.ups-sample-detail-metrics span {
  display: block;
  margin-bottom: 3px;
  color: #7c8980;
  font-size: 10px;
}

.ups-sample-detail-metrics strong {
  display: block;
  overflow: hidden;
  color: #23543b;
  font-size: 18px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ups-sample-photo-group {
  display: grid;
  gap: 7px;
}

.ups-sample-photo-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.ups-sample-photo-heading strong {
  color: #294b38;
  font-size: 13px;
}

.ups-sample-photo-heading small {
  color: #7d8981;
  font-size: 10px;
}

.ups-sample-photo-gallery {
  display: grid;
  gap: 7px;
}

.ups-sample-photo-gallery.is-loading {
  min-height: 180px;
  border-radius: 13px;
  background: linear-gradient(110deg, #eef3ef 25%, #f8faf8 40%, #eef3ef 55%);
  background-size: 220% 100%;
  animation: ups-sample-detail-shimmer 1.2s linear infinite;
}

.ups-sample-photo-gallery.is-loading > * {
  visibility: hidden;
}

.ups-sample-photo-gallery.is-error,
.ups-sample-photo-empty,
.ups-sample-detail-error,
.ups-sample-detail-note {
  padding: 12px;
  border: 1px solid #dce5df;
  border-radius: 11px;
  color: #68776e;
  background: #f6f8f6;
  font-size: 11px;
}

.ups-sample-detail-error {
  border-color: #ebc8bd;
  color: #8a4b39;
  background: #fff6f2;
}

.ups-sample-photo-hero {
  position: relative;
  display: block;
  width: 100%;
  height: 205px;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 13px;
  background: #e7eee9;
  cursor: zoom-in;
}

.ups-sample-photo-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ups-sample-photo-hero span {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  color: #fff;
  background: rgb(28 52 38 / 76%);
  font-size: 10px;
}

.ups-sample-photo-thumbs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.ups-sample-photo-thumbs button {
  flex: 0 0 58px;
  width: 58px;
  height: 50px;
  overflow: hidden;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  background: #e9efeb;
  cursor: pointer;
}

.ups-sample-photo-thumbs button.is-active {
  border-color: #4d8a70;
  box-shadow: 0 0 0 1px #fff inset;
}

.ups-sample-photo-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ups-sample-detail-info {
  overflow: hidden;
  border: 1px solid #dce5df;
  border-radius: 12px;
  background: #fff;
}

.ups-sample-detail-info > div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid #edf1ee;
}

.ups-sample-detail-info > div:last-child {
  border-bottom: 0;
}

.ups-sample-detail-info span {
  color: #7c8981;
  font-size: 10px;
}

.ups-sample-detail-info strong {
  overflow-wrap: anywhere;
  color: #31473a;
  font-size: 11px;
  font-weight: 650;
  text-align: right;
}

.ups-sample-detail-notes {
  padding: 11px 12px;
  border-left: 3px solid #75a58d;
  border-radius: 0 10px 10px 0;
  background: #f1f7f3;
}

.ups-sample-detail-notes strong {
  color: #305b45;
  font-size: 11px;
}

.ups-sample-detail-notes p {
  margin: 5px 0 0;
  color: #56665d;
  font-size: 11px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.ups-sample-detail-loading {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 220px;
  color: #65756b;
  font-size: 11px;
}

.ups-sample-detail-loading span {
  width: 26px;
  height: 26px;
  border: 3px solid #d7e5dc;
  border-top-color: #477d63;
  border-radius: 50%;
  animation: ups-sample-detail-spin 0.8s linear infinite;
}

.ups-sample-photo-lightbox {
  position: absolute;
  z-index: 1500;
  inset: 0;
  display: none;
  place-items: center;
  padding: 34px;
  background: rgb(12 22 16 / 88%);
  backdrop-filter: blur(6px);
}

.ups-sample-photo-lightbox.is-open {
  display: grid;
}

.ups-sample-photo-lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  box-shadow: 0 18px 60px rgb(0 0 0 / 38%);
  object-fit: contain;
}

.ups-sample-photo-lightbox button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border: 1px solid rgb(255 255 255 / 38%);
  border-radius: 50%;
  color: #fff;
  background: rgb(0 0 0 / 36%);
  font-size: 25px;
  cursor: pointer;
}

@keyframes ups-sample-detail-spin {
  to { transform: rotate(360deg); }
}

@keyframes ups-sample-detail-shimmer {
  to { background-position-x: -220%; }
}

@media (max-width: 820px) {
  .ups-sample-detail-sheet {
    top: auto;
    right: 8px;
    bottom: 8px;
    left: 8px;
    width: auto;
    max-height: min(68dvh, 570px);
    border-radius: 19px;
    transform: translateY(calc(100% + 18px));
  }

  .ups-sample-detail-sheet.is-open {
    transform: translateY(0);
  }

  .ups-sample-photo-hero {
    height: 190px;
  }

  .ups-sample-photo-lightbox {
    padding: 18px;
  }
}

/* RC11: manager-only controls inside collection overview sample detail */
.ups-sample-detail-manager-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0 4px;
}
.ups-sample-detail-edit,
.ups-sample-detail-edit-actions button {
  min-height: 42px;
  border: 1px solid rgba(47, 111, 78, .28);
  border-radius: 12px;
  background: #eef7f1;
  color: #285c3b;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.ups-sample-detail-edit:disabled { opacity: .55; cursor: wait; }
.ups-sample-detail-edit-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px;
  margin: 10px 0 4px;
  border: 1px solid rgba(31, 78, 55, .12);
  border-radius: 14px;
  background: rgba(244, 249, 246, .92);
}
.ups-sample-detail-edit-form label { display: grid; gap: 5px; font-size: 12px; color: #52675b; }
.ups-sample-detail-edit-form input,
.ups-sample-detail-edit-form textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(31, 78, 55, .18);
  border-radius: 9px;
  padding: 9px 10px;
  background: #fff;
  color: #173b28;
  font: inherit;
}
.ups-sample-detail-edit-form label:last-of-type,
.ups-sample-detail-edit-actions { grid-column: 1 / -1; }
.ups-sample-detail-edit-actions { display: flex; gap: 10px; justify-content: flex-end; }
.ups-sample-detail-edit-actions button { padding: 0 16px; }
.ups-sample-detail-edit-actions button:last-child { background: #fff; color: #52675b; }
@media (max-width: 720px) {
  .ups-sample-detail-manager-actions,
  .ups-sample-detail-edit-form { grid-template-columns: 1fr; }
  .ups-sample-detail-edit-form label:last-of-type,
  .ups-sample-detail-edit-actions { grid-column: auto; }
}

/* RC15 repeated-visit sampling */
.ups-species-duplicate-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:9px}.ups-species-duplicate-actions button{border:1px solid #b86153;border-radius:9px;padding:7px 10px;background:#b86153;color:#fff;font-size:11px;font-weight:800;cursor:pointer}.ups-species-duplicate-actions button.is-secondary{background:#fff8f6;color:#8a3028}.ups-followup-section{display:grid;gap:10px;margin-top:16px;padding:14px;border:1px solid #d8e4d8;border-radius:15px;background:#f7faf5}.ups-followup-section>div:first-child{display:flex;align-items:baseline;justify-content:space-between;gap:10px}.ups-followup-section>div:first-child>strong{color:#285b3d;font-size:15px}.ups-followup-section>div:first-child>small{color:#728078;font-size:10px}.ups-followup-list{display:grid;gap:8px;color:#66736b;font-size:12px}.ups-followup-empty{margin:0;color:#708077;line-height:1.6}.ups-followup-card{display:grid;gap:7px;padding:10px 11px;border:1px solid #dbe5da;border-radius:12px;background:#fff}.ups-followup-card>div{display:flex;align-items:center;justify-content:space-between;gap:10px}.ups-followup-card strong{color:#345643;font-size:12px}.ups-followup-card span{padding:3px 7px;border-radius:999px;background:#e5f2e7;color:#2f6840;font-size:10px;font-weight:800}.ups-followup-card p{margin:0;color:#5f6f65;line-height:1.55}.ups-followup-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:14px 0}.ups-followup-form>label{display:flex;align-items:center;gap:9px;padding:12px 14px;border:1px solid #cddbcc;border-radius:12px;background:#f7faf5;color:#315a40;font-weight:900;cursor:pointer}.ups-followup-form input{width:18px;height:18px;accent-color:#2f6f47}.ups-followup-notes{display:grid;gap:7px;color:#4f6255;font-size:12px;font-weight:800}.ups-followup-notes textarea{width:100%;box-sizing:border-box;border:1px solid #ccd7cc;border-radius:11px;background:#fff;padding:10px 12px;color:#213d2d;font:inherit;font-weight:400;line-height:1.55;resize:vertical}.ups-existing-species-list{display:grid;gap:10px;margin-top:12px}.ups-existing-species-list article{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;padding:12px;border:1px solid #dce5dc;border-radius:13px;background:#fff}.ups-existing-species-list article>div:first-child{display:grid;gap:3px;min-width:0}.ups-existing-species-list strong{color:#284f38}.ups-existing-species-list small{color:#728078;font-size:10px}.ups-existing-species-list span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#5c6c62;font-size:11px}.ups-existing-species-list article>div:last-child{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}@media(max-width:600px){.ups-existing-species-list article{grid-template-columns:1fr}.ups-existing-species-list article>div:last-child{justify-content:flex-start}.ups-followup-section>div:first-child{align-items:flex-start;flex-direction:column}.ups-followup-form{grid-template-columns:1fr 1fr}}
.ups-sample-followups{display:grid;gap:10px;margin-top:14px;padding:13px;border:1px solid #d8e4d8;border-radius:14px;background:#f7faf5}.ups-sample-followups>div:first-child{display:flex;align-items:center;justify-content:space-between;gap:10px}.ups-sample-followups>div:first-child>strong{color:#285b3d}.ups-sample-followups>div:first-child>button{border:0;border-radius:9px;padding:7px 10px;background:#2f6f47;color:#fff;font-size:11px;font-weight:800;cursor:pointer}.ups-sample-followups-list{display:grid;gap:8px}.ups-sample-followups-list>p{margin:0;color:#6d7a72;font-size:11px;line-height:1.55}.ups-sample-followups-list article{display:grid;gap:6px;padding:9px 10px;border:1px solid #dce5dc;border-radius:11px;background:#fff}.ups-sample-followups-list article>div{display:flex;justify-content:space-between;gap:8px}.ups-sample-followups-list article strong{color:#3e5d49;font-size:11px}.ups-sample-followups-list article span{padding:2px 6px;border-radius:999px;background:#e5f2e7;color:#2f6840;font-size:9px;font-weight:800}.ups-sample-followups-list article p{margin:0;color:#5f6f65;font-size:10px;line-height:1.5}.ups-sample-followup-form{display:grid;gap:9px;padding-top:4px}.ups-sample-followup-options{display:grid;grid-template-columns:1fr 1fr;gap:8px}.ups-sample-followup-options label{display:flex;align-items:center;gap:7px;padding:9px 10px;border:1px solid #cfdccf;border-radius:10px;background:#fff;color:#315a40;font-size:11px;font-weight:800}.ups-sample-followup-form>label{display:grid;gap:5px;color:#4f6255;font-size:10px;font-weight:800}.ups-sample-followup-form textarea{width:100%;box-sizing:border-box;border:1px solid #ccd7cc;border-radius:10px;padding:9px 10px;font:inherit;resize:vertical}.ups-sample-followup-form>div:last-child{display:flex;gap:7px}.ups-sample-followup-form>div:last-child button{border:1px solid #cbd8cc;border-radius:9px;padding:7px 10px;background:#fff;color:#315a40;font-size:10px;font-weight:800}.ups-sample-followup-form>div:last-child button:first-child{border-color:#2f6f47;background:#2f6f47;color:#fff}.ups-sample-followup-error{color:#a13e35;font-size:10px}
