:root {
  color-scheme: light;

  /* ---- Palette ---- */
  --bg: #eef3f0;
  --surface: #ffffff;
  --surface-2: #f3f7f4;
  --surface-glass: rgba(255, 255, 255, 0.82);
  --line: #dde6e0;
  --line-strong: #c3d1c9;
  --text: #10201a;
  --muted: #5c6f66;
  --muted-2: #8a9a92;

  --accent: #0a7c53;
  --accent-dark: #075f40;
  --accent-soft: #e2f5eb;
  --accent-soft-strong: #c7ecd9;
  --accent-2: #b3620f;
  --danger: #c8392b;
  --danger-soft: #fbe9e6;

  --shadow-xs: 0 1px 2px rgba(13, 30, 22, 0.06);
  --shadow-sm: 0 2px 8px rgba(13, 30, 22, 0.07);
  --shadow-md: 0 10px 28px rgba(13, 30, 22, 0.12);
  --shadow-lg: 0 24px 56px rgba(13, 30, 22, 0.20);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-pill: 999px;

  --ctrl-width: 72px;
  --panel-width: minmax(320px, 400px);

  --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Manrope", "Inter", ui-sans-serif, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
.viewer-shell {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

svg {
  display: block;
}

.spin {
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease,
    transform 0.1s ease;
}

button:hover {
  border-color: var(--line-strong);
}

button:active {
  transform: translateY(1px);
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-ghost {
  padding: 6px 12px;
  border-color: transparent;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 12.5px;
}

.btn-ghost:hover {
  background: var(--accent-soft-strong);
  border-color: transparent;
}

/* ---- Layout grid ---- */

.viewer-shell {
  display: grid;
  grid-template-columns: var(--ctrl-width) 0px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--bg);
}

.viewer-shell.panel-open {
  grid-template-columns: var(--ctrl-width) var(--panel-width) minmax(0, 1fr);
}

.viewer-shell.control-strip-hidden,
.viewer-shell.control-strip-hidden.panel-open {
  grid-template-columns: 0px 0px minmax(0, 1fr);
}

/* ---- Control strip ---- */

.control-strip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 18px 0 14px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%);
  border-right: 1px solid var(--line);
  box-shadow: 2px 0 12px rgba(13, 30, 22, 0.04);
  z-index: 20;
}

.brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}

.ctrl-btn-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.ctrl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  min-height: 42px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ctrl-btn[hidden],
.control-strip[hidden],
.sidebar-panels[hidden],
.bottom-panels[hidden],
.bottom-toggle-bar[hidden],
.bottom-panels-content[hidden],
.record-panel[hidden] {
  display: none !important;
}

.ctrl-btn:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
  border-color: transparent;
}

.ctrl-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.ctrl-btn::after {
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  background: var(--text);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 30;
}

.ctrl-btn:hover::after,
.ctrl-btn:focus-visible::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ---- Sidebar panels ---- */

.sidebar-panels {
  overflow: hidden;
  background: var(--surface);
  border-right: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.sidebar-panel {
  overflow-y: auto;
  height: 100%;
  animation: panel-fade-in 0.2s ease;
}

@keyframes panel-fade-in {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.sidebar-panel[hidden] {
  display: none;
}

/* ---- Shared panel chrome ---- */

.app-header {
  padding: 22px 18px 18px;
  background: linear-gradient(160deg, var(--accent-soft) 0%, var(--surface) 65%);
  border-bottom: 1px solid var(--line);
}

.panel {
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.app-header h1,
.panel h2,
.record-panel h2 {
  margin: 0;
  letter-spacing: -0.01em;
  font-family: var(--font-display);
}

.app-header h1 {
  margin-top: 4px;
  font-size: 21px;
  line-height: 1.25;
  font-weight: 800;
  color: var(--text);
}

.panel h2,
.record-panel h2 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.eyebrow {
  margin: 0;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-line {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-line.error {
  color: var(--danger);
  font-weight: 600;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 2px;
}

/* ---- Metric grid (Counts) ---- */

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 0;
}

.metric-grid div,
.artifact,
.filter-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.metric-grid div {
  padding: 12px;
  background: var(--surface-2);
}

.metric-grid dt,
.metadata-list dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-grid dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  color: var(--accent-dark);
}

.metadata-list dd {
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

/* ---- Metadata / provenance ---- */

.metadata-list {
  display: grid;
  gap: 11px;
  margin: 14px 0 0;
}

.metadata-list a {
  color: var(--accent);
  font-weight: 600;
}

/* ---- Filters ---- */

.filters {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.filter-group {
  padding: 12px;
}

.filter-group:focus-within,
.filter-group:hover {
  border-color: var(--line-strong);
}

.filter-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter-group input[type="search"],
.filter-group input[type="number"],
.filter-group select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  background: var(--surface-2);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.filter-group input[type="search"]:focus,
.filter-group input[type="number"]:focus,
.filter-group select:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
}

.filter-group > div[style],
.filter-group input[type="number"] {
  display: inline-block;
}

.checkbox-stack {
  display: grid;
  gap: 2px;
  max-height: 150px;
  overflow: auto;
}

.checkbox-stack label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 5px 4px;
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s ease;
}

.checkbox-stack label:hover {
  background: var(--surface-2);
}

.checkbox-stack input[type="checkbox"] {
  appearance: none;
  width: 16px;
  height: 16px;
  min-height: auto;
  flex-shrink: 0;
  border: 1.6px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.checkbox-stack input[type="checkbox"]::after {
  content: "";
  width: 10px;
  height: 10px;
  background: var(--accent);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 78% 0%, 43% 62%);
  transform: scale(0);
  transition: transform 0.1s ease;
}

.checkbox-stack input[type="checkbox"]:checked {
  border-color: var(--accent);
}

.checkbox-stack input[type="checkbox"]:checked::after {
  transform: scale(1);
}

/* ---- Artifacts / Download ---- */

.artifact-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.artifact {
  padding: 12px;
}

.artifact:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-xs);
}

.artifact-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.artifact-row a {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
}

.artifact-row a:hover,
.artifact-row a:focus-visible {
  text-decoration: underline;
}

.copy-url-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  flex-shrink: 0;
}

.copy-url-btn:hover,
.copy-url-btn:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
  outline: none;
}

.copy-url-btn.copied {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.artifact p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

/* ---- Sidebar record list ---- */

#sidebar-record-list {
  margin-top: 14px;
}

.record-list {
  display: grid;
  gap: 6px;
  max-height: none;
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
}

.record-list button {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  text-align: left;
  overflow-wrap: anywhere;
  background: var(--surface-2);
  border-color: var(--line);
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.record-list button:hover {
  background: var(--accent-soft);
  border-color: var(--line-strong);
}

.record-list button[aria-current="true"] {
  background: var(--accent-soft-strong);
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
  font-weight: 600;
}

/* ---- Workspace ---- */

.workspace {
  display: grid;
  grid-template-rows: auto minmax(360px, 1fr) auto;
  min-width: 0;
  min-height: 100vh;
}

.map-title-header {
  grid-row: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 15;
}

.map-title-header[hidden] {
  display: none;
}

.map-title-text {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.map-title-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}

.map-title-header h1[hidden] {
  display: none;
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.header-stat-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.header-stat-chip strong {
  font-family: var(--font-display);
  font-size: 13.5px;
}

.app-description-button {
  margin-left: auto;
  flex-shrink: 0;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 12.5px;
  box-shadow: var(--shadow-xs);
}

.app-description-button:hover,
.app-description-button:focus-visible {
  background: var(--accent-dark);
}

.map-wrap {
  grid-row: 2;
  position: relative;
  min-height: 360px;
  background: #dbe7e1;
}

.map {
  position: absolute;
  inset: 0;
}

.empty-state {
  position: absolute;
  inset: 20px;
  display: grid;
  place-items: center;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.94);
  color: var(--muted);
  padding: 24px;
  text-align: center;
  font-weight: 500;
}

.empty-state[hidden] {
  display: none;
}

/* ---- Basemap toggle ---- */

.basemap-toggle[hidden] {
  display: none;
}

.basemap-toggle {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 5;
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-md);
}

.basemap-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 12px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.basemap-btn:hover {
  color: var(--accent-dark);
}

.basemap-btn.active {
  background: var(--accent);
  color: #fff;
}

/* ---- Map legend ---- */

.map-legend {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 5;
  max-width: 220px;
  padding: 12px 14px;
  background: var(--surface-glass);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.map-legend[hidden] {
  display: none;
}

.map-legend-title {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.map-legend-items {
  display: grid;
  gap: 6px;
}

.map-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
}

.map-legend-swatch {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 0 0 1px rgba(13, 30, 22, 0.15);
  flex-shrink: 0;
}

/* ---- MapLibre control restyle ---- */

.maplibregl-ctrl-top-right {
  top: 14px;
  right: 14px;
}

.maplibregl-ctrl-group {
  background: var(--surface-glass) !important;
  backdrop-filter: blur(10px);
  border: 1px solid var(--line) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-md) !important;
  overflow: hidden;
}

.maplibregl-ctrl-group button + button {
  border-top: 1px solid var(--line) !important;
}

/* ---- Bottom panels ---- */

.bottom-panels {
  grid-row: 3;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.bottom-toggle-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  user-select: none;
}

.bottom-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  flex-shrink: 0;
}

.bottom-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.toggle-icon {
  transition: transform 0.2s ease;
}

.bottom-panels:not(.collapsed) .toggle-icon {
  transform: rotate(90deg);
}

.bottom-panels-content {
  transition: max-height 0.25s ease, opacity 0.25s ease;
  max-height: 800px;
  overflow: hidden;
  opacity: 1;
}

.bottom-panels.collapsed .bottom-panels-content {
  max-height: 0;
  opacity: 0;
}

.bottom-panels.collapsed .bottom-toggle-bar {
  border-bottom: 0;
}

.record-panel {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 18px;
}

.record-panel h2 {
  margin-bottom: 4px;
}

#feature-details {
  max-height: 300px;
  overflow-y: auto;
}

/* ---- Processing ---- */

.processing-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.notice,
.warning {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px;
  background: var(--surface-2);
  font-size: 12.5px;
}

.warning {
  border-color: #e3b789;
  background: #fff6ea;
}

.error {
  color: var(--danger);
}

/* ---- Point Info Popup ---- */

.map-point-popup .maplibregl-popup-content {
  padding: 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  line-height: 1.4;
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;
}

.map-point-popup .maplibregl-popup-close-button {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.85);
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  line-height: 24px;
  border-radius: 50%;
}

.map-point-popup .maplibregl-popup-close-button:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.map-point-popup .maplibregl-popup-tip {
  border-top-color: var(--surface);
}

.popup-title {
  margin: 0;
  padding: 14px 34px 14px 16px;
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
}

.popup-scroll {
  max-height: 260px;
  overflow-y: auto;
  padding: 12px 16px 14px;
}

.popup-dl {
  display: grid;
  gap: 3px;
  margin: 0;
}

.popup-dl dt {
  color: var(--muted-2);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.popup-dl dd {
  margin: 0 0 7px;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
}

.popup-dl dd:last-child {
  margin-bottom: 0;
}

.popup-empty {
  margin: 0;
  padding: 14px 16px;
  color: var(--muted);
  font-size: 13px;
  font-style: italic;
}

/* ---- App Description Modal ---- */

.app-description-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(13, 24, 19, 0.55);
  backdrop-filter: blur(2px);
}

.app-description-modal[hidden] {
  display: none;
}

.app-description-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(860px, 100%);
  max-height: min(82vh, 760px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.app-description-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
}

.app-description-modal-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.01em;
}

.app-description-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.app-description-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.app-description-content {
  min-height: 0;
  overflow: auto;
  padding: 20px;
}

.app-description-content > :first-child {
  margin-top: 0;
}

.app-description-content > :last-child {
  margin-bottom: 0;
}

.app-description-content h2,
.app-description-content h3,
.app-description-content h4 {
  margin: 18px 0 8px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-family: var(--font-display);
}

.app-description-content h2 {
  font-size: 20px;
}

.app-description-content h3 {
  font-size: 17px;
}

.app-description-content h4 {
  font-size: 15px;
}

.app-description-content p,
.app-description-content ol,
.app-description-content ul,
.app-description-content table,
.app-description-content center {
  margin: 0 0 12px;
}

.app-description-content a {
  color: var(--accent-dark);
  font-weight: 600;
}

.app-description-content img,
.app-description-content iframe,
.app-description-content table {
  max-width: 100%;
}

.app-description-content img {
  height: auto;
  border-radius: var(--radius-sm);
}

.app-description-content iframe {
  display: block;
  width: 100%;
  min-height: 240px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.app-description-content table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
}

.app-description-content td {
  border: 1px solid var(--line);
  padding: 6px 8px;
  vertical-align: top;
}

/* ---- Scrollbars ---- */

.sidebar-panel::-webkit-scrollbar,
.checkbox-stack::-webkit-scrollbar,
.popup-scroll::-webkit-scrollbar,
#feature-details::-webkit-scrollbar {
  width: 8px;
}

.sidebar-panel::-webkit-scrollbar-thumb,
.checkbox-stack::-webkit-scrollbar-thumb,
.popup-scroll::-webkit-scrollbar-thumb,
#feature-details::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: var(--radius-pill);
}

/* ---- Responsive ---- */

@media (max-width: 900px) {
  .viewer-shell {
    grid-template-columns: var(--ctrl-width) 0px minmax(0, 1fr);
  }

  .viewer-shell.panel-open {
    grid-template-columns: var(--ctrl-width) minmax(260px, 340px) minmax(0, 1fr);
  }

  .viewer-shell.control-strip-hidden,
  .viewer-shell.control-strip-hidden.panel-open {
    grid-template-columns: 0px 0px minmax(0, 1fr);
  }

  .workspace {
    min-height: auto;
  }

  .map-title-header {
    min-height: 52px;
    padding: 10px 14px;
    gap: 10px;
  }

  .map-title-header h1 {
    font-size: 16px;
  }

  .app-description-button {
    padding: 6px 12px;
  }

  .map-legend {
    max-width: 170px;
    padding: 10px 12px;
  }

  .basemap-btn span {
    display: none;
  }

  .map-point-popup {
    max-width: 260px !important;
  }
}

@media (max-width: 480px) {
  :root {
    --ctrl-width: 60px;
  }

  .ctrl-btn {
    width: 38px;
    height: 38px;
  }

  .ctrl-btn::after {
    display: none;
  }

  .map-point-popup {
    max-width: 220px !important;
  }

  .map-title-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-description-button {
    align-self: flex-end;
  }

  .basemap-toggle {
    top: 10px;
    left: 10px;
  }

  .basemap-btn {
    padding: 5px 8px;
  }

  .map-legend {
    left: 10px;
    bottom: 10px;
  }

  .app-description-modal {
    padding: 12px;
  }

  .app-description-panel {
    max-height: 88vh;
  }

  .popup-dl dt {
    font-size: 10px;
  }

  .popup-dl dd {
    font-size: 12px;
  }
}
