.resource-archive-page {
  --resource-terracotta: #c66b3d;
  --resource-ochre: #c08e3a;
  --resource-ink: #163d26;
  --resource-copy: #213421;
  --resource-muted: #4c562d;
  --resource-action: #184e46;
  --resource-action-deep: #0e403a;
  --resource-sand: #e8dcc7;
  position: relative;
  height: calc(100dvh - 86px);
  min-height: 0;
  overflow: hidden;
  color: var(--resource-copy);
  background: #606c38;
  font-family: "Epilogue", "Noto Serif SC", "Songti SC", serif;
}

.resource-map-stage,
.resource-map-container {
  position: absolute;
  inset: 0;
}

.resource-map-stage { overflow: hidden; }
.resource-map-container {
  z-index: 1;
  background: #8b9d83;
  filter: saturate(.92) contrast(1.04);
}

.resource-filter-panel {
  z-index: 12;
  padding: 40px 24px 20px;
  overflow-y: auto;
  animation: resourcePanelInLeft 360ms cubic-bezier(.2, .8, .2, 1) both;
}

.resource-panel-heading {
  display: grid;
  justify-items: center;
  margin-bottom: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(96, 108, 56, .18);
}

.resource-kind-block { margin-bottom: 0; }

.resource-kind-switch.statistics-segments {
  gap: 6px;
  padding: 5px;
  border: 0;
  border-radius: 5px;
  background: rgba(139, 157, 131, .14);
}

.resource-kind-switch.statistics-segments button {
  min-height: 47px;
  border: 0;
  border-radius: 5px;
  color: var(--resource-ink);
  background: transparent;
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 16px;
  font-weight: 900;
}

.resource-kind-switch.statistics-segments button.active {
  color: #f1dfb9;
  background: var(--resource-ink);
  box-shadow: 0 7px 18px rgba(96, 108, 56, .2);
}

.resource-name-block {
  padding-top: 12px;
  border-top: 0;
}

.resource-filter-empty {
  grid-column: 1 / -1;
  color: rgba(76, 86, 45, .68);
  font-size: 12px;
}

.resource-results-panel {
  z-index: 200;
  top: 18px;
  right: 18px;
  bottom: 18px;
  width: min(504px, calc(100vw - 36px));
  padding: 18px;
  overflow: hidden;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  border-radius: 5px;
  animation: resourcePanelInRight 360ms cubic-bezier(.16, 1, .3, 1) both;
}

.resource-results-panel .heritage-list-head {
  min-height: 42px;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(96, 108, 56, .18);
}

.resource-results-panel .heritage-list-head h3 {
  margin: 0;
  color: var(--resource-ink);
  font-size: 27px;
  line-height: 1;
}

.resource-list-tools {
  display: flex;
  gap: 8px;
}

.resource-results-panel .resource-add-button {
  color: #f1dfb9;
  border-color: var(--resource-action-deep);
  background: var(--resource-action);
}

.resource-results-panel .resource-add-button:hover,
.resource-results-panel .resource-add-button:focus-visible {
  transform: none;
  color: #f1dfb9;
  border-color: var(--resource-action-deep);
  background: var(--resource-action-deep);
}

.resource-results-panel .heritage-card-list {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  grid-template-rows: repeat(10, minmax(62px, 1fr));
  align-content: stretch;
  gap: 8px;
  padding: 2px 5px 2px 2px;
}

.resource-results-panel .resource-result-card {
  width: 100%;
  min-height: 0;
  height: 100%;
  grid-template-columns: clamp(94px, 27%, 118px) minmax(0, 1fr) 46px;
  gap: 10px;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
}

.resource-result-card .heritage-result-media {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
}

.resource-result-card .heritage-result-copy {
  min-width: 0;
  display: grid;
  grid-template-rows: 27px 22px;
  gap: 3px;
  align-content: center;
}

.resource-result-card .heritage-name-marquee > span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.resource-results-panel .resource-result-card .resource-node-result-meta {
  width: 100%;
  margin: 0;
  padding: 0;
  justify-content: flex-start;
  gap: .8em;
  text-align: left;
}

.resource-results-panel .resource-result-card .resource-node-result-meta > span {
  margin: 0;
  padding: 0;
}

.resource-result-actions {
  display: grid;
  gap: 5px;
}

.resource-result-actions button {
  min-height: 26px;
  padding: 3px 4px;
  border: 1px solid rgba(176, 139, 110, .44);
  border-radius: 5px;
  color: var(--resource-muted);
  background: rgba(232, 220, 199, .58);
  font: 800 10px/1 "Noto Serif SC", "Songti SC", serif;
}

.resource-result-actions button:hover {
  border-color: rgba(96, 108, 56, .58);
  background: rgba(139, 157, 131, .18);
}

.resource-result-actions .danger,
.resource-route-controls .danger {
  color: var(--resource-terracotta);
  border-color: rgba(198, 107, 61, .45);
  background: rgba(198, 107, 61, .08);
}

.resource-results-empty {
  grid-row: 1 / -1;
  display: grid;
  place-content: center;
  gap: 6px;
  color: rgba(76, 86, 45, .72);
  text-align: center;
}

.resource-results-empty strong {
  color: var(--resource-ink);
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 17px;
}

.resource-results-panel.is-busy .heritage-card-list {
  opacity: .52;
  pointer-events: none;
}

.resource-results-panel--editor {
  grid-template-rows: auto minmax(0, 1fr);
}

.resource-editor-heading h3 {
  font-size: 27px;
  line-height: 1;
}

.resource-results-panel--editor form {
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
}

.resource-editor-scroll {
  min-height: 0;
  overflow-y: auto;
  padding: 0 5px 0 1px;
}

.resource-editor-section {
  padding: 17px 0;
  border-bottom: 1px solid rgba(96, 108, 56, .18);
}

.resource-editor-section:first-of-type { padding-top: 2px; }

.resource-editor-section h3 {
  margin: 0 0 13px;
  display: flex;
  align-items: center;
  color: var(--resource-ink);
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 17px;
  font-weight: 900;
}

.resource-route-editor h3 {
  justify-content: space-between;
}

.resource-route-point-count {
  color: rgba(76, 86, 45, .76);
  font-family: "Epilogue", "Noto Serif SC", "Songti SC", serif;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.resource-route-point-count strong {
  color: var(--resource-ink);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.resource-editor-section h3::after {
  content: none;
}

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

.resource-editor-field {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 6px;
}

.resource-editor-field > span {
  color: rgba(76, 86, 45, .86);
  font-size: 13px;
  font-weight: 800;
}

.resource-results-panel--editor input:not([type="hidden"]),
.resource-results-panel--editor textarea {
  box-sizing: border-box;
  width: 100%;
  height: 48px;
  min-height: 48px;
  padding: 9px 12px;
  border: 1px solid rgba(176, 139, 110, .34);
  border-radius: 8px;
  outline: 0;
  color: var(--resource-copy);
  background: rgba(232, 220, 199, .66);
  font: 700 14px/1.45 "Noto Serif SC", "Songti SC", serif;
}

.resource-results-panel--editor input:not([type="hidden"]):focus,
.resource-results-panel--editor textarea:focus {
  border-color: var(--resource-action);
  box-shadow: 0 0 0 3px rgba(24, 78, 70, .1);
}

.resource-results-panel--editor input[readonly] {
  color: rgba(76, 86, 45, .68);
  background: rgba(232, 220, 199, .38);
  cursor: default;
}

.resource-results-panel--editor input[type="number"] {
  appearance: textfield;
  font-variant-numeric: tabular-nums;
}

.resource-results-panel--editor input[type="number"]::-webkit-inner-spin-button,
.resource-results-panel--editor input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.resource-results-panel--editor textarea {
  height: 156px;
  min-height: 156px;
  resize: none;
  line-height: 1.55;
}

.resource-editor-field-wide {
  grid-column: 1 / -1;
}

.resource-editor-source-grid {
  margin-top: 12px;
  grid-template-columns: 1fr;
}

.resource-editor-select-field:has(.open) {
  z-index: 45;
}

.resource-editor-custom-select,
.resource-editor-select-trigger {
  width: 100%;
  height: 48px;
  min-height: 48px;
}

.resource-editor-select-trigger {
  box-sizing: border-box;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--resource-copy);
  font-size: 14px;
  line-height: 1.4;
}

.resource-editor-select-trigger.is-placeholder {
  color: rgba(76, 86, 45, .42);
  font-weight: 700;
}

.resource-editor-select-trigger:focus-visible,
.resource-editor-custom-select.open .resource-editor-select-trigger {
  outline: 0;
  border-color: var(--resource-action);
  box-shadow: 0 0 0 3px rgba(24, 78, 70, .1);
}

.resource-editor-select-menu {
  display: none;
  z-index: 80;
  max-height: 224px;
  padding: 6px;
}

.resource-editor-custom-select.open .resource-editor-select-menu {
  display: block;
}

.resource-editor-custom-select[data-multiple="true"].open .resource-editor-select-menu {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
}

.resource-editor-select-menu button {
  min-height: 38px;
  font-size: 14px;
}

.resource-map-edit-button,
.resource-route-controls button,
.resource-results-panel--editor form > footer button {
  height: 48px;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid rgba(176, 139, 110, .4);
  border-radius: 8px;
  color: var(--resource-copy);
  background: rgba(232, 220, 199, .56);
  font: 800 14px/1.3 "Noto Serif SC", "Songti SC", serif;
}

.resource-map-edit-button {
  width: 48px;
  min-width: 48px;
  padding: 0;
  align-self: end;
  display: grid;
  place-items: center;
  color: #f1dfb9;
  border-color: var(--resource-action-deep);
  background: var(--resource-action);
}

.resource-map-edit-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.resource-map-edit-button.is-picking {
  color: var(--resource-action-deep);
  background: var(--resource-ochre);
  box-shadow: 0 0 0 4px rgba(192, 142, 58, .18);
}

.resource-coordinate-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) 48px;
  align-items: end;
  gap: 10px;
}

.resource-node-coordinate-grid {
  margin-top: 12px;
}

.resource-spatial-derived-status:not(:empty) {
  margin-top: 8px;
  color: rgba(76, 86, 45, .78);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
}

.resource-route-status {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.resource-route-edit-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.resource-route-edit-guide span {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid rgba(24, 77, 66, .13);
  border-radius: 5px;
  color: rgba(49, 69, 46, .78);
  background: rgba(246, 235, 207, .48);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.resource-route-edit-guide b {
  display: grid;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  color: #f4e4be;
  background: var(--resource-action);
  font-size: 12px;
  line-height: 1;
}

.resource-route-edit-guide span:nth-child(2) b > i {
  display: block;
  font-style: normal;
  transform: translateY(-2px);
}

.resource-route-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.resource-route-controls button:first-child {
  color: #f1dfb9;
  border-color: var(--resource-action-deep);
  background: var(--resource-action);
}

.resource-form-error {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(198, 107, 61, .42);
  border-radius: 6px;
  color: var(--resource-terracotta);
  background: rgba(198, 107, 61, .08);
  font-size: 12px;
  font-weight: 700;
}

.resource-results-panel--editor form > footer {
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding: 12px 0 0;
  border: 0;
  background: transparent;
}

.resource-results-panel--editor form > footer .primary-btn {
  color: #f1dfb9;
  border-color: var(--resource-action-deep);
  background: var(--resource-action);
}

.resource-page-message {
  position: absolute;
  z-index: 300;
  top: 16px;
  left: 50%;
  max-width: 420px;
  padding: 10px 14px;
  border: 1px solid rgba(96, 108, 56, .42);
  border-radius: 6px;
  color: var(--resource-action-deep);
  background: rgba(232, 220, 199, .96);
  box-shadow: 0 12px 28px rgba(38, 61, 34, .2);
  font-size: 12px;
  font-weight: 800;
  transform: translateX(-50%);
}

.resource-page-message.error {
  color: var(--resource-terracotta);
  border-color: rgba(198, 107, 61, .45);
}

@keyframes resourcePanelInLeft {
  from { opacity: 0; transform: translateX(-24px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes resourcePanelInRight {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 1180px) {
  .resource-results-panel { width: min(470px, calc(100vw - 352px)); }
}

@media (max-width: 820px) {
  .resource-archive-page {
    height: auto;
    min-height: calc(100dvh - 76px);
    overflow: auto;
  }

  .resource-map-stage { position: relative; min-height: 54vh; }

  .resource-filter-panel,
  .resource-results-panel {
    position: relative;
    inset: auto;
    width: auto;
    margin: 12px;
    min-height: 620px;
  }

  .resource-results-panel .heritage-card-list { grid-template-rows: none; grid-auto-rows: 78px; }
}
