/* Ruang Maslahat Stage 5.17 — stable map controls, category-first datasets,
   and the BPN NTT-inspired style/legend workspace. */
:root {
  --rm-forest-950: #071d2f;
  --rm-forest-900: #10293d;
  --rm-forest-800: #245a73;
  --rm-olive-700: #0d615b;
  --rm-olive-600: #0f766e;
  --rm-gold-500: #2f7892;
  --rm-gold-300: #8bc8c0;
  --rm-ivory-100: #f4f8fa;
  --rm-ivory-50: #fbfdfe;
  --rm-shadow-premium: 0 30px 80px rgba(7, 29, 47, 0.18);
  --rm517-navy: #10293d;
  --rm517-blue: #245a73;
  --rm517-teal: #0f766e;
  --rm517-teal-dark: #0b5d57;
  --rm517-ink: #183348;
  --rm517-muted: #667b89;
  --rm517-border: #dce7ec;
  --rm517-soft: #f4f8fa;
  --rm517-soft-teal: #e9f5f3;
  --rm517-danger: #b42318;
}

::selection { color: #fff; background: var(--rm517-blue); }

/* Critical first-paint map geometry. This asset is loaded in <head>. */
html body .webgis-map-control-rail,
html body .webgis-map-control-rail:not([data-positioned="true"]),
html body .webgis-map-control-rail[data-positioned="true"] {
  position: absolute !important;
  top: var(--webgis-control-rail-top, 148px) !important;
  left: 18px !important;
  z-index: 1140 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  width: 46px !important;
  gap: 8px !important;
  overflow: visible !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
  scrollbar-width: none !important;
}
html body .webgis-map-control-rail::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }
html body .webgis-map-control-rail > .webgis-home-map-btn {
  display: inline-flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}
html body .webgis-basemap-stack:not(.is-open) {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  max-height: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
  pointer-events: none !important;
  scrollbar-width: none !important;
}
html body .webgis-basemap-stack:not(.is-open)::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }
html body .webgis-basemap-stack.is-open {
  display: flex !important;
  height: auto !important;
  max-height: min(440px, calc(100dvh - 170px)) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  visibility: visible !important;
  pointer-events: auto !important;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(36, 90, 115, .35) transparent !important;
}

/* Remove inherited olive identity from interactive surfaces. */
html.rm-admin-console body,
html.rm-admin-console .modern-dashboard-page,
html.rm-admin-console .modern-dashboard-main { background: #f5f8fa !important; color: var(--rm517-ink) !important; }
html.rm-admin-console .rm-admin-module-kicker,
html.rm-admin-console .pegawai-hero-badge {
  background: var(--rm517-soft-teal) !important;
  color: var(--rm517-teal-dark) !important;
}
html.rm-admin-console .rm-admin-small-btn.primary,
html.rm-admin-console .rm-admin-upload-btn,
html.rm-admin-console .rm-style-primary {
  border-color: var(--rm517-teal) !important;
  background: linear-gradient(135deg, var(--rm517-teal), var(--rm517-blue)) !important;
  color: #fff !important;
  box-shadow: 0 9px 20px rgba(15, 118, 110, .17) !important;
}
html.rm-admin-console .rm-admin-small-btn:not(.primary),
html.rm-admin-console .rm-style-secondary {
  border-color: var(--rm517-border) !important;
  background: #fff !important;
  color: var(--rm517-ink) !important;
}
html.rm-admin-console .rm-admin-card-icon.green,
html.rm-admin-console .rm-admin-card-icon.orange {
  background: linear-gradient(145deg, #e6f3f5, #e7f5f2) !important;
  color: var(--rm517-blue) !important;
}
html.rm-admin-console .rm-admin-module-card {
  border-color: var(--rm517-border) !important;
  background: #fff !important;
  box-shadow: 0 18px 46px rgba(7, 29, 47, .08) !important;
}
html.rm-admin-console #adminModuleContainer input:focus,
html.rm-admin-console #adminModuleContainer select:focus,
html.rm-admin-console #adminModuleContainer textarea:focus,
html.rm-admin-console #adminModuleContainer .rm-combo-trigger:focus {
  border-color: #5aada4 !important;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .10) !important;
  outline: 0 !important;
}

/* Dataset module: BPN NTT structure with Ruang Maslahat color and density. */
html.rm-admin-console .rm-admin-spatial-layout {
  grid-template-columns: minmax(350px, .88fr) minmax(520px, 1.35fr) !important;
  gap: 18px !important;
  align-items: start !important;
}
html.rm-admin-console .rm-admin-spatial-form,
html.rm-admin-console .rm-admin-spatial-list {
  border: 1px solid var(--rm517-border) !important;
  border-radius: 18px !important;
  background: #fff !important;
  box-shadow: none !important;
}
html.rm-admin-console .rm-admin-spatial-form { padding: 18px !important; }
html.rm-admin-console .rm-admin-spatial-list { padding: 14px !important; }
html.rm-admin-console .rm-admin-spatial-form-head {
  margin: -2px 0 16px !important;
  padding-bottom: 13px !important;
  border-bottom: 1px solid #e8eff2 !important;
}
html.rm-admin-console .rm-admin-spatial-form-head strong { color: var(--rm517-navy) !important; }
html.rm-admin-console .rm-admin-form-grid { gap: 12px !important; }
html.rm-admin-console .rm-admin-form-grid label,
html.rm-admin-console .rm-admin-full-label,
html.rm-admin-console .rm-admin-search-grid label {
  color: #385466 !important;
  font-weight: 750 !important;
}
html.rm-admin-console .rm-admin-spatial-upload {
  border-color: #cfe2e7 !important;
  background: linear-gradient(145deg, #f5fafb, #edf7f5) !important;
}
html.rm-admin-console .rm516-autoload-control {
  border-color: #cfe5e0 !important;
  background: #f0f8f6 !important;
}
html.rm-admin-console .rm516-autoload-control input,
html.rm-admin-console .rm516-table-toggle input { accent-color: var(--rm517-teal) !important; }
html.rm-admin-console .rm-admin-search-panel {
  border-color: var(--rm517-border) !important;
  background: var(--rm517-soft) !important;
}
html.rm-admin-console .rm-admin-user-table th {
  background: #f1f6f8 !important;
  color: #466274 !important;
}
html.rm-admin-console .rm-admin-user-table tbody tr:hover td { background: #f7fbfb !important; }
.rm517-category-badge,
.rm517-detail-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 9px;
  line-height: 1.1;
  font-weight: 850;
  letter-spacing: .035em;
  white-space: nowrap;
}
.rm517-category-badge { background: #e7f3f5; color: #1d5b70; }
.rm517-category-badge.tata-ruang { background: #e8f5f2; color: #0b665f; }
.rm517-category-badge.lainnya { background: #eef2f6; color: #526575; }
.rm517-detail-badge { margin-left: 5px; background: #f1f5f7; color: #607482; font-weight: 700; }
.rm517-edit-legend-action {
  width: auto !important;
  min-width: 38px !important;
  padding: 0 9px !important;
  gap: 5px !important;
  color: var(--rm517-blue) !important;
}
.rm517-edit-legend-action span { font-size: 9px; font-weight: 850; white-space: nowrap; }
html.rm-admin-console #adminSpatialTableWrap .rm-admin-user-table {
  min-width: 640px !important;
  table-layout: fixed !important;
}
html.rm-admin-console #adminSpatialTableWrap .rm-admin-user-table th,
html.rm-admin-console #adminSpatialTableWrap .rm-admin-user-table td {
  padding-left: 8px !important;
  padding-right: 8px !important;
}
html.rm-admin-console #adminSpatialTableWrap .rm-admin-user-table th:nth-child(1),
html.rm-admin-console #adminSpatialTableWrap .rm-admin-user-table td:nth-child(1) { width: 34% !important; }
html.rm-admin-console #adminSpatialTableWrap .rm-admin-user-table th:nth-child(2),
html.rm-admin-console #adminSpatialTableWrap .rm-admin-user-table td:nth-child(2) { width: 24% !important; }
html.rm-admin-console #adminSpatialTableWrap .rm-admin-user-table th:nth-child(3),
html.rm-admin-console #adminSpatialTableWrap .rm-admin-user-table td:nth-child(3) { width: 10% !important; }
html.rm-admin-console #adminSpatialTableWrap .rm-admin-user-table th:nth-child(4),
html.rm-admin-console #adminSpatialTableWrap .rm-admin-user-table td:nth-child(4) { width: 12% !important; }
html.rm-admin-console #adminSpatialTableWrap .rm-admin-user-table th:nth-child(5),
html.rm-admin-console #adminSpatialTableWrap .rm-admin-user-table td:nth-child(5) { width: 20% !important; }
html.rm-admin-console #adminSpatialTableWrap .rm-admin-spatial-actions {
  flex-wrap: nowrap !important;
  justify-content: flex-end !important;
  gap: 5px !important;
}
html.rm-admin-console #adminSpatialTableWrap .rm517-edit-legend-action {
  width: 34px !important;
  min-width: 34px !important;
  padding: 0 !important;
}
html.rm-admin-console #adminSpatialTableWrap .rm517-edit-legend-action span { display: none !important; }

/* New style workspace. */
.rm517-style-shell { display: grid; gap: 16px; }
.rm517-style-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--rm517-border);
  border-radius: 17px;
  background: linear-gradient(145deg, #f7fafb, #f1f7f8);
}
.rm517-style-field { display: grid; gap: 7px; min-width: 0; }
.rm517-style-field > span {
  color: #385466;
  font-size: 10.5px;
  font-weight: 850;
  letter-spacing: .02em;
}
.rm517-style-field select,
.rm517-style-field input[type="text"] {
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  border: 1px solid #cbdbe2;
  border-radius: 12px;
  background: #fff;
  color: var(--rm517-ink);
  padding: 0 12px;
  font: 700 12px/1.3 inherit;
}
.rm517-style-dataset-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-height: 20px;
  color: var(--rm517-muted);
  font-size: 10.5px;
}
.rm517-style-dataset-summary strong { color: var(--rm517-ink); font-size: 12px; }
.rm517-style-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}
.rm517-style-progress,
.rm517-style-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 128px;
  padding: 20px;
  border: 1px dashed #c9d9e0;
  border-radius: 16px;
  background: #f8fbfc;
  color: var(--rm517-muted);
  font-size: 12px;
  text-align: center;
}
.rm517-style-progress[hidden],
.rm517-style-empty[hidden],
#rm517StyleWorkspace[hidden] { display: none !important; }
.rm517-style-progress { gap: 9px; }
.rm517-style-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px;
}
.rm517-style-list-head > div { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.rm517-style-list-head strong { color: var(--rm517-navy); font-size: 13px; }
.rm517-style-list-head small { color: var(--rm517-muted); font-size: 10.5px; }
.rm517-style-grid {
  display: grid;
  gap: 9px;
  max-height: min(58dvh, 680px);
  overflow: auto;
  padding: 2px 5px 8px 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(36, 90, 115, .35) transparent;
}
.rm517-style-summary-wrap {
  overflow: auto;
  border: 1px solid var(--rm517-border);
  border-radius: 17px;
  background: #fff;
}
.rm517-style-summary-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.rm517-style-summary-table th {
  padding: 12px 14px;
  border-bottom: 1px solid var(--rm517-border);
  background: #f3f7f8;
  color: #536b7a;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .055em;
  text-align: left;
  text-transform: uppercase;
}
.rm517-style-summary-table th:nth-child(1) { width: 36%; }
.rm517-style-summary-table th:nth-child(2) { width: 27%; }
.rm517-style-summary-table th:nth-child(3) { width: 24%; }
.rm517-style-summary-table th:nth-child(4) { width: 13%; text-align: center; }
.rm517-style-summary-table td {
  padding: 13px 14px;
  border-bottom: 1px solid #edf2f4;
  color: var(--rm517-ink);
  font-size: 11px;
  vertical-align: middle;
}
.rm517-style-summary-table tr:last-child td { border-bottom: 0; }
.rm517-style-summary-table td > strong,
.rm517-style-summary-table td > small,
.rm517-style-summary-visual strong,
.rm517-style-summary-visual small { display: block; }
.rm517-style-summary-table td > strong { font-size: 12px; }
.rm517-style-summary-table td > small,
.rm517-style-summary-visual small { margin-top: 4px; color: var(--rm517-muted); font-size: 9px; }
.rm517-style-summary-visual { display: flex; align-items: center; gap: 9px; min-width: 0; }
.rm517-style-summary-visual .rm517-style-swatch { width: 48px; min-width: 48px; height: 30px; }
.rm517-style-summary-visual strong { color: #385466; font-size: 10px; text-transform: uppercase; }
.rm517-style-line-preview {
  display: block;
  width: min(70px, 100%);
  height: 12px;
  margin-bottom: 4px;
  border-bottom: var(--rm517-line-weight, 1px) solid var(--rm517-line, #334155);
}
.rm517-style-edit-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid #cfe0e7;
  border-radius: 10px;
  background: #eef7f8;
  color: var(--rm517-blue);
  padding: 0 11px;
  font: 850 10px/1 inherit;
  cursor: pointer;
}
.rm517-style-summary-table td:last-child { text-align: center; }
.rm517-style-edit-button:hover { border-color: #9fc6ce; background: #e4f2f3; }

/* BPN NTT-style focused editor for one legend symbol. */
.rm517-admin-style-modal {
  position: fixed;
  inset: 0;
  z-index: 2350;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(7, 29, 47, .62);
  backdrop-filter: blur(7px);
}
.rm517-admin-style-modal[hidden] { display: none !important; }
.rm517-admin-style-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(910px, calc(100vw - 28px));
  max-height: min(88dvh, 820px);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 34px 92px rgba(7, 29, 47, .3);
}
.rm517-admin-style-head,
.rm517-admin-style-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 17px 20px;
  background: #fff;
}
.rm517-admin-style-head { border-bottom: 1px solid #e6eef1; }
.rm517-admin-style-foot { justify-content: flex-end; border-top: 1px solid #e6eef1; }
.rm517-admin-style-head h3 { margin: 0; color: var(--rm517-navy); font-size: 19px; }
.rm517-admin-style-head p { margin: 5px 0 0; color: var(--rm517-muted); font-size: 11px; }
.rm517-admin-style-close {
  display: inline-flex;
  width: 38px;
  height: 38px;
  min-width: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid #d7e3e8;
  border-radius: 10px;
  background: #f4f7f8;
  color: #536b7a;
  padding: 0;
  font: 500 20px/1 inherit;
  cursor: pointer;
}
.rm517-admin-style-foot button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--rm517-border);
  border-radius: 11px;
  padding: 0 15px;
  font: 850 10.5px/1 inherit;
  text-decoration: none;
  cursor: pointer;
}
.rm517-admin-style-scroll {
  display: grid;
  gap: 14px;
  overflow: auto;
  padding: 18px 20px;
  background: #fbfcfd;
  scrollbar-width: thin;
  scrollbar-color: rgba(36,90,115,.35) transparent;
}
.rm517-admin-style-note {
  border: 1px solid #c8e7df;
  border-radius: 13px;
  background: #eef9f5;
  color: #1f665e;
  padding: 11px 13px;
  font-size: 10px;
  line-height: 1.45;
}
.rm517-admin-style-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.rm517-admin-style-section {
  display: grid;
  gap: 12px;
  min-width: 0;
  border: 1px solid #dfe8ec;
  border-radius: 16px;
  background: #f8fafb;
  padding: 14px;
}
.rm517-admin-style-section h4 { margin: 0; color: var(--rm517-navy); font-size: 12px; }
.rm517-admin-style-section label { display: grid; gap: 7px; color: #496373; font-size: 9.5px; font-weight: 800; }
.rm517-admin-style-section label > span { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rm517-admin-style-section output { color: var(--rm517-blue); font-weight: 900; }
.rm517-admin-style-section input[type="text"],
.rm517-admin-style-section select {
  width: 100%;
  min-height: 40px;
  box-sizing: border-box;
  border: 1px solid #cedce2;
  border-radius: 11px;
  background: #fff;
  color: var(--rm517-ink);
  padding: 0 11px;
  font: 700 11px/1.2 inherit;
}
.rm517-admin-style-section input[readonly] { background: #f1f5f7; color: #657985; }
.rm517-admin-style-section input[type="range"] { width: 100%; accent-color: var(--rm517-blue); }
.rm517-admin-color-pair { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; }
.rm517-admin-color-pair input[type="color"] {
  width: 52px;
  height: 40px;
  box-sizing: border-box;
  border: 1px solid #cedce2;
  border-radius: 10px;
  background: #fff;
  padding: 3px;
}
.rm517-admin-style-section [hidden] { display: none !important; }
.rm517-admin-style-preview { width: 100%; height: 90px; opacity: 1; }
.rm517-style-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.25fr) 92px 92px 82px 92px minmax(130px, .8fr);
  gap: 9px;
  align-items: end;
  padding: 12px;
  border: 1px solid #dfe8ec;
  border-radius: 15px;
  background: #fff;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.rm517-style-row:hover {
  border-color: #b9d5dc;
  box-shadow: 0 10px 24px rgba(7, 29, 47, .07);
  transform: translateY(-1px);
}
.rm517-style-row .rm517-style-field > span { font-size: 9px; }
.rm517-style-row input[type="text"],
.rm517-style-row input[type="number"],
.rm517-style-row select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  box-sizing: border-box;
  border: 1px solid #cedce2;
  border-radius: 10px;
  background: #fff;
  color: var(--rm517-ink);
  padding: 0 9px;
  font: 700 11px/1.2 inherit;
}
.rm517-style-row input[type="color"] {
  width: 100%;
  min-width: 0;
  height: 38px;
  box-sizing: border-box;
  padding: 3px;
  border: 1px solid #cedce2;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
}
.rm517-style-pattern-settings {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 92px 92px 92px 92px;
  gap: 9px;
  padding-top: 9px;
  border-top: 1px solid #edf2f4;
}
.rm517-style-pattern-settings[hidden] { display: none !important; }
.rm517-style-swatch {
  position: relative;
  width: 100%;
  height: 38px;
  overflow: hidden;
  box-sizing: border-box;
  border: var(--rm517-line-weight, 1px) solid var(--rm517-line, #334155);
  border-radius: 10px;
  background-color: var(--rm517-fill, #94a3b8);
  opacity: var(--rm517-opacity, .45);
}
.rm517-style-swatch[data-pattern="DIAGONAL"] { background-image: repeating-linear-gradient(45deg, transparent 0 5px, var(--rm517-pattern, #334155) 5px 6px); }
.rm517-style-swatch[data-pattern="DIAGONAL_REVERSE"] { background-image: repeating-linear-gradient(-45deg, transparent 0 5px, var(--rm517-pattern, #334155) 5px 6px); }
.rm517-style-swatch[data-pattern="DIAGONAL_CROSS"] { background-image: repeating-linear-gradient(45deg, transparent 0 5px, var(--rm517-pattern, #334155) 5px 6px), repeating-linear-gradient(-45deg, transparent 0 5px, var(--rm517-pattern, #334155) 5px 6px); }
.rm517-style-swatch[data-pattern="HORIZONTAL"] { background-image: repeating-linear-gradient(0deg, transparent 0 6px, var(--rm517-pattern, #334155) 6px 7px); }
.rm517-style-swatch[data-pattern="VERTICAL"] { background-image: repeating-linear-gradient(90deg, transparent 0 6px, var(--rm517-pattern, #334155) 6px 7px); }
.rm517-style-swatch[data-pattern="CROSS"] { background-image: repeating-linear-gradient(0deg, transparent 0 6px, var(--rm517-pattern, #334155) 6px 7px), repeating-linear-gradient(90deg, transparent 0 6px, var(--rm517-pattern, #334155) 6px 7px); }
.rm517-style-swatch[data-pattern="DOT"] { background-image: radial-gradient(circle, var(--rm517-pattern, #334155) 1px, transparent 1.4px); background-size: 7px 7px; }
.rm517-style-footer {
  position: sticky;
  bottom: 0;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 0 2px;
  background: linear-gradient(180deg, rgba(255,255,255,0), #fff 28%);
}
.rm517-style-footer small { color: var(--rm517-muted); font-size: 10.5px; }
.rm517-style-actions { display: flex; align-items: center; gap: 8px; }
.rm517-style-actions button {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--rm517-border);
  border-radius: 11px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
}
.rm517-style-actions button:disabled { cursor: wait; opacity: .58; }

/* Layer legend editor and patterned legend items. */
.rm517-layer-edit-button { color: var(--rm517-blue) !important; }
.rm517-layer-legend-modal[hidden] { display: none !important; }
.rm517-layer-legend-modal {
  position: fixed;
  inset: 0;
  z-index: 50090;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(7, 29, 47, .48);
  backdrop-filter: blur(6px);
}
.rm517-layer-legend-dialog {
  width: min(900px, calc(100vw - 36px));
  max-height: min(86dvh, 820px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(7,29,47,.27);
}
.rm517-layer-legend-head {
  position: relative;
  padding: 17px 58px 14px 18px;
  border-bottom: 1px solid #e5edf1;
  background: linear-gradient(180deg, #fbfdfe, #f4f8fa);
}
.rm517-layer-legend-head span { display: block; margin-bottom: 4px; color: var(--rm517-teal); font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.rm517-layer-legend-head h3 { margin: 0; color: var(--rm517-navy); font-size: 18px; }
.rm517-layer-legend-head p { margin: 5px 0 0; color: var(--rm517-muted); font-size: 11px; }
.rm517-layer-legend-close { position: absolute; top: 13px; right: 14px; width: 38px; height: 38px; border: 1px solid #dce6eb; border-radius: 12px; background: #edf3f5; color: #385466; cursor: pointer; font-size: 20px; }
.rm517-layer-legend-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 16px 18px 18px; }

.webgis-layer-legend-item > span.rm517-pattern-chip {
  --rm517-fill: #94a3b8;
  --rm517-line: #64748b;
  --rm517-pattern: #334155;
  background-color: var(--rm517-fill) !important;
  border-color: var(--rm517-line) !important;
}
.webgis-layer-legend-item > span.rm517-pattern-chip[data-pattern="DIAGONAL"] { background-image: repeating-linear-gradient(45deg, transparent 0 4px, var(--rm517-pattern) 4px 5px) !important; }
.webgis-layer-legend-item > span.rm517-pattern-chip[data-pattern="DIAGONAL_REVERSE"] { background-image: repeating-linear-gradient(-45deg, transparent 0 4px, var(--rm517-pattern) 4px 5px) !important; }
.webgis-layer-legend-item > span.rm517-pattern-chip[data-pattern="DIAGONAL_CROSS"] { background-image: repeating-linear-gradient(45deg, transparent 0 4px, var(--rm517-pattern) 4px 5px), repeating-linear-gradient(-45deg, transparent 0 4px, var(--rm517-pattern) 4px 5px) !important; }
.webgis-layer-legend-item > span.rm517-pattern-chip[data-pattern="HORIZONTAL"] { background-image: repeating-linear-gradient(0deg, transparent 0 5px, var(--rm517-pattern) 5px 6px) !important; }
.webgis-layer-legend-item > span.rm517-pattern-chip[data-pattern="VERTICAL"] { background-image: repeating-linear-gradient(90deg, transparent 0 5px, var(--rm517-pattern) 5px 6px) !important; }
.webgis-layer-legend-item > span.rm517-pattern-chip[data-pattern="CROSS"] { background-image: repeating-linear-gradient(0deg, transparent 0 5px, var(--rm517-pattern) 5px 6px), repeating-linear-gradient(90deg, transparent 0 5px, var(--rm517-pattern) 5px 6px) !important; }
.webgis-layer-legend-item > span.rm517-pattern-chip[data-pattern="DOT"] { background-image: radial-gradient(circle, var(--rm517-pattern) 1px, transparent 1.4px) !important; background-size: 6px 6px !important; }

@media (max-width: 1080px) {
  html.rm-admin-console .rm-admin-spatial-layout { grid-template-columns: 1fr !important; }
  .rm517-style-row { grid-template-columns: minmax(150px, 1.2fr) repeat(3, 82px) minmax(120px, .8fr); }
  .rm517-style-row > .rm517-style-field:nth-child(5) { grid-column: 1 / 2; }
}
@media (max-width: 760px) {
  html body .webgis-map-control-rail,
  html body .webgis-map-control-rail:not([data-positioned="true"]),
  html body .webgis-map-control-rail[data-positioned="true"] { left: 8px !important; width: 42px !important; gap: 6px !important; }
  .rm517-style-toolbar { grid-template-columns: 1fr; }
  .rm517-style-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rm517-style-row > .rm517-style-field:first-child,
  .rm517-style-pattern-settings { grid-column: 1 / -1; }
  .rm517-style-pattern-settings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rm517-style-pattern-settings > .rm517-style-field:first-child { grid-column: 1 / -1; }
  .rm517-style-footer { align-items: stretch; flex-direction: column; }
  .rm517-style-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .rm517-style-summary-table { min-width: 620px; }
  .rm517-admin-style-modal { padding: 8px; }
  .rm517-admin-style-dialog { width: calc(100vw - 16px); max-height: 92dvh; border-radius: 18px; }
  .rm517-admin-style-head,
  .rm517-admin-style-foot { padding-left: 14px; padding-right: 14px; }
  .rm517-admin-style-head { align-items: flex-start; }
  .rm517-admin-style-head p { max-width: 42ch; }
  .rm517-admin-style-scroll { padding: 14px; }
  .rm517-admin-style-two { grid-template-columns: 1fr; }
  .rm517-layer-legend-modal { padding: 8px; }
  .rm517-layer-legend-dialog { width: calc(100vw - 16px); max-height: 92dvh; border-radius: 18px; }
}
