:root {
  color-scheme: light;
  --ink: var(--panorama-text-primary);
  --ink-soft: var(--panorama-text-secondary);
  --muted: var(--panorama-text-tertiary);
  --surface: var(--panorama-background-bg-brand-primary);
  --surface-strong: var(--panorama-background-bg-primary);
  --surface-muted: var(--panorama-background-bg-secondary);
  --line: var(--panorama-border-border-secondary);
  --line-soft: var(--panorama-border-border-tertiary);
  --brand: var(--panorama-text-brand-primary);
  --brand-strong: var(--panorama-text-brand-secondary);
  --brand-soft: var(--panorama-background-bg-brand-primary);
  --accent: var(--panorama-background-bg-brand-solid);
  --success: var(--panorama-text-success-primary);
  --warning: var(--panorama-text-warning-primary);
  --danger: var(--panorama-text-error-primary);
  --hover-bg: var(--panorama-background-bg-primary-hover);
  --selected-bg: var(--panorama-background-bg-brand-primary-active);
  --focus-ring: var(--panorama-effects-focus-rings-focus-ring);
  --panel-bg: var(--panorama-background-bg-primary);
  --panel-bg-strong: var(--panorama-background-bg-primary);
  --shadow-sm: 0 1px 3px rgb(20 35 32 / 8%);
  --shadow-md: 0 8px 22px rgb(20 35 32 / 10%);
  --shadow-lg: 0 16px 42px rgb(20 35 32 / 16%);
  --radius-sm: 6px;
  --radius-md: 12px;
  --target-sm: 38px;
  --target-md: 44px;
  --target-touch: 48px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --header-height: calc(64px + var(--safe-top));
  --left-panel-width: 428px;
  --right-panel-width: 400px;
  --panel-rail-width: 44px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--surface);
  color: var(--ink);
}

.resolution-notice {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.45;
}

.resolution-notice p { margin: 0 0 4px; }
.resolution-notice button {
  min-height: var(--target-sm);
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--brand-strong);
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.resolution-notice button:hover { color: var(--ink); }

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button {
  color: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.15;
}

h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.app-shell {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--surface);
}

#map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: var(--surface);
}

.map-layer-drop-target {
  position: absolute;
  z-index: 15;
  top: var(--header-height);
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  transition: opacity 120ms ease-out, visibility 120ms ease-out;
}

.map-layer-drop-target.is-active {
  visibility: visible;
  opacity: 1;
}

.map-layer-drop-content {
  display: grid;
  place-items: center;
  justify-items: center;
  gap: 8px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
}

.map-layer-drop-orbit {
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  opacity: .58;
}

.map-layer-drop-orbit img {
  display: block;
  width: 100%;
  height: 100%;
}

.map-layer-drop-target.is-drop-ready .map-layer-drop-content {
  color: var(--brand-strong);
}

.map-layer-drop-target.is-drop-ready .map-layer-drop-orbit {
  opacity: 1;
}

body.is-dragging-catalogue-layer {
  user-select: none;
}

@media (prefers-reduced-motion: reduce) {
  .map-layer-drop-target {
    transition: none;
  }
}

.map-logo-watermark {
  position: absolute;
  z-index: 11;
  top: calc(var(--header-height) + 12px);
  right: calc(min(var(--right-panel-width), 42vw) + 16px);
  display: grid;
  width: 112px;
  height: 32px;
  place-items: center;
  padding: 5px 8px;
  border: 1px solid rgb(20 35 32 / 5%);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  opacity: .24;
  pointer-events: none;
}

.map-logo-watermark span {
  display: block;
  color: var(--brand-strong);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.5px;
}

body.right-panel-collapsed .map-logo-watermark {
  right: calc(var(--panel-rail-width) + 16px);
}

.icon {
  display: block;
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  stroke-width: 2;
}

.topbar {
  position: absolute;
  z-index: 30;
  top: 0;
  right: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: auto;
  min-height: var(--header-height);
  padding: max(4px, var(--safe-top)) max(10px, var(--safe-right)) 4px max(10px, var(--safe-left));
  border: 0;
  border-bottom: 1px solid rgb(20 35 32 / 6%);
  border-radius: 0;
  color: var(--brand-strong);
  background: var(--panel-bg);
  box-shadow: 0 1px 2px rgb(20 35 32 / 4%);
}

.brand-block,
.topbar-actions,
.topbar-panel-controls,
.info-section-title,
.control-group,
.topbar-action,
.panel-action,
.basemap-control {
  display: flex;
  align-items: center;
}

.brand-block {
  min-width: 0;
  gap: 7px;
}

.brand-block > div {
  min-width: 0;
}

.brand-block h1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  flex: 0 0 auto;
  gap: 4px;
}

/* Remove inline SVG baseline space and keep icon-only controls centered. */
[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 0;
}

/* Icons arrive with the module: reserve their inline footprint from first paint. */
.topbar-action [data-icon],
.layer-stack-action [data-icon] {
  display: inline-flex;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
}

.topbar-panel-controls {
  gap: 0;
  margin-left: 1px;
  padding: 1px;
  border: 1px solid rgb(20 35 32 / 8%);
  border-radius: 999px;
  background: var(--panel-bg);
}

.topbar-panel-controls .topbar-action {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
}

.topbar-panel-controls .topbar-action + .topbar-action {
  margin-left: 1px;
}

.topbar-action {
  min-height: 34px;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--brand-strong);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  transition: background 140ms ease-out, color 140ms ease-out;
}

.topbar-action:hover {
  background: var(--selected-bg);
}

.topbar-action[aria-pressed="true"] {
  background: var(--selected-bg);
}

.panel-toggle-action[aria-expanded="true"] {
  background: var(--selected-bg);
}

.panel-toggle-action[aria-expanded="false"] {
  opacity: .72;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.panel-kicker {
  color: var(--muted);
}

.panel-rail {
  position: absolute;
  z-index: 21;
  top: var(--header-height);
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: var(--panel-rail-width);
  min-width: var(--panel-rail-width);
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  color: var(--ink-soft);
  background: var(--panel-bg);
  box-shadow: none;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 160ms ease-out, background 160ms ease-out, color 160ms ease-out;
}

.panel-rail--left {
  left: 0;
  border-right: 1px solid var(--line);
}

.panel-rail--right {
  right: 0;
  border-left: 1px solid var(--line);
}

.panel-rail .panel-rail-label {
  display: block;
  color: inherit;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  text-transform: none;
  white-space: nowrap;
  writing-mode: vertical-rl;
}

.panel-rail--left .panel-rail-label {
  transform: rotate(180deg);
}

body.sidebar-collapsed .panel-rail--left,
body.right-panel-collapsed .panel-rail--right {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.panel-rail:hover {
  color: var(--brand-strong);
  background: var(--selected-bg);
}

.panel-rail:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: -2px;
}

.sidebar {
  position: absolute;
  z-index: 18;
  top: var(--header-height);
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: min(var(--left-panel-width), 42vw);
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel-bg);
  box-shadow: none;
  transition: transform 180ms ease-out, opacity 180ms ease-out;
}

body.sidebar-collapsed .sidebar {
  transform: translateX(calc(-100% - 24px));
  opacity: 0;
  pointer-events: none;
}

.panel {
  min-height: 0;
  padding: 10px var(--space-3);
  border-bottom: 1px solid var(--line-soft);
}

.panel:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.layer-panel {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  padding-bottom: 0;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: 10px;
}

.info-section-title {
  gap: var(--space-2);
}

.panel-action {
  min-height: var(--target-md);
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  background: transparent;
  font-size: 11.5px;
  font-weight: 700;
}

.panel-action--icon {
  justify-content: center;
  width: var(--target-md);
  min-width: var(--target-md);
  padding: 0;
}

.panel-action-label {
  display: none;
}

.panel-action:hover,
.map-toolbar button:hover,
.map-toolbar select:hover {
  background: var(--hover-bg);
}

.search-label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.layer-discovery-summary {
  min-height: 16px;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.catalogue-help {
  display: grid;
  gap: 4px;
  margin: 0 0 10px;
  padding: 7px 8px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: var(--panel-bg);
  font-size: 10.5px;
  line-height: 1.3;
}

.catalogue-help strong {
  color: var(--ink-soft);
  font-size: 11px;
}

.catalogue-help ol {
  display: grid;
  gap: 2px;
  margin: 0;
  padding-left: 16px;
}

.catalogue-help p {
  margin: 1px 0 0;
  color: var(--muted);
}

.layer-discovery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin: 0 0 10px;
}

.layer-discovery-filter {
  min-height: 24px;
  padding: 2px 7px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  font-weight: 700;
}

.layer-discovery-filter:hover {
  color: var(--brand-strong);
  background: var(--hover-bg);
}

.layer-discovery-filter.is-active {
  border-color: var(--line);
  color: var(--brand-strong);
  background: var(--selected-bg);
}

.search-field {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-height: var(--target-md);
  margin-bottom: 8px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: var(--panel-bg);
}

.search-input {
  min-width: 0;
  width: 100%;
  min-height: 42px;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
}

.metadata-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.metadata-metrics div {
  min-width: 0;
  padding: 6px 8px 6px 0;
  border: 0;
  border-right: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
}

.metadata-metrics div:not(:first-child) {
  padding-left: 8px;
}

.metadata-metrics div:last-child {
  border-right: 0;
}

.metadata-metrics strong,
.metadata-metrics span {
  display: block;
}

.metadata-metrics strong {
  color: var(--brand);
  font-size: 14px;
  line-height: 1;
}

.metadata-metrics span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.15;
}

.search-input::placeholder {
  color: var(--muted);
}

.search-input:focus {
  outline: 0;
}

.search-field:focus-within,
.catalogue-search:focus-within,
.catalogue-controls select:focus,
.catalogue-export:focus,
.catalogue-sort:focus,
.catalogue-open-layer:focus,
.upload-file:focus-within,
.upload-form input:focus,
.upload-form select:focus,
.upload-form textarea:focus,
.upload-submit:focus,
.aggregation-pill:focus,
.right-tab:focus,
.layer-export-button:focus,
.stack-visibility:focus,
.stack-remove:focus,
.layer-stack-clear:focus,
.layer-stack-item:focus,
.map-toolbar button:focus,
.map-toolbar select:focus,
.panel-action:focus,
.topbar-action:focus,
.icon-button:focus,
.layer-add-control:focus,
.layer-main:focus,
.layer-section-heading button:focus,
.layer-value-trigger:focus,
.layer-value-option:focus,
.value-field-trigger:focus,
.value-field-option:focus,
.feature-info-release:focus,
.layer-discovery-filter:focus,
.dataset-map-action:focus,
.dataset-details summary:focus {
  border-color: var(--brand);
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.layer-list {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding: 0 2px var(--space-3) 0;
}

.layer-section {
  display: grid;
  gap: 0;
}

.layer-section-heading {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--target-md);
  padding: 3px 0 5px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--brand);
  background: var(--panel-bg);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.layer-section-heading button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  min-height: var(--target-md);
  padding: 6px 8px 6px 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--brand);
  background: transparent;
  font-weight: 800;
}

.layer-section-heading button .icon {
  width: 14px;
  height: 14px;
  transition: transform 160ms ease-out;
}

.layer-section.is-collapsed .layer-section-heading button .icon {
  transform: rotate(-90deg);
}

.layer-section-heading small {
  min-width: 22px;
  padding: 1px 5px;
  border: 0;
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--surface-muted);
  font-size: 10px;
  font-weight: 700;
  text-align: center;
}

.layer-section-counts {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  flex: 0 0 auto;
}

.layer-section-active {
  color: var(--brand-strong);
  font-size: 9.5px;
  font-weight: 760;
  line-height: 1;
  white-space: nowrap;
}

.layer-section-description {
  margin: 5px 0 4px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.35;
}

.layer-row {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) var(--target-md);
  grid-template-areas: "drag main control";
  align-items: start;
  column-gap: var(--space-2);
  row-gap: var(--space-2);
  min-height: var(--target-touch);
  padding: var(--space-3) 0;
  border: 1px solid transparent;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  transition: background 140ms ease-out, border-color 140ms ease-out;
}

.layer-row:hover {
  background: var(--hover-bg);
}

.layer-row.is-selected {
  border-color: transparent;
  background: transparent;
}

.layer-row.is-active .layer-title {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.layer-row.is-active {
  background: transparent;
}

.layer-row.is-active:hover {
  background: var(--hover-bg);
}

.layer-row.is-disabled {
  opacity: .62;
}

.layer-row--aggregation {
  grid-template-areas:
    "drag main control"
    ". scale scale"
    ". fields fields";
}

.layer-row:has(.layer-value-tree):not(.layer-row--aggregation) {
  grid-template-areas:
    "drag main control"
    ". fields fields";
}

.layer-add-control {
  grid-area: control;
}

.layer-main {
  grid-area: main;
}

.layer-drag-handle {
  grid-area: drag;
}

.layer-row--aggregation:has(.layer-value-tree) {
  grid-template-areas:
    "drag main control"
    ". scale scale"
    ". fields fields";
}

.layer-row--aggregation .layer-main {
  min-height: var(--target-md);
  padding: 0;
}

.layer-add-control {
  display: grid;
  align-self: start;
  justify-self: end;
  min-width: var(--target-md);
  min-height: var(--target-md);
  width: var(--target-md);
  height: var(--target-md);
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
}

.layer-add-control:hover {
  border-color: var(--line);
  color: var(--brand);
  background: var(--hover-bg);
}

.layer-add-control.is-active {
  border-color: rgb(164 59 53 / 16%);
  color: var(--danger);
  background: rgb(164 59 53 / 7%);
  cursor: pointer;
}

.layer-add-control.is-active:hover {
  border-color: rgb(164 59 53 / 32%);
  color: var(--danger);
  background: rgb(164 59 53 / 11%);
}

.layer-add-control.is-active .icon {
  stroke-width: 2.5;
}

.layer-add-control:disabled {
  cursor: default;
}

.layer-drag-handle {
  display: grid;
  align-self: start;
  width: 22px;
  height: var(--target-md);
  min-height: var(--target-md);
  place-items: center;
  color: var(--muted);
  cursor: grab;
  touch-action: none;
}

.layer-drag-handle:hover {
  color: var(--brand);
}

.layer-drag-handle:active {
  cursor: grabbing;
}

.layer-drag-handle .icon {
  width: 14px;
  height: 14px;
}

.layer-main {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 2px;
  min-width: 0;
  min-height: var(--target-md);
  padding: 2px 0;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  text-align: left;
  color: inherit;
  background: transparent;
}

.layer-title {
  display: block;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.layer-status {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--brand-strong);
  font-size: 9.5px;
  font-weight: 760;
  line-height: 1;
}

.layer-status .icon {
  width: 10px;
  height: 10px;
}

.badge {
  min-width: 32px;
  align-self: start;
  padding: 2px 5px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--surface-muted);
}

.badge[data-level="N0"],
.badge[data-level="N1"] {
  color: var(--brand-strong);
  background: var(--brand-soft);
}

.badge[data-level="N2"] {
  border-color: var(--panorama-utility-success-utility-success-200);
  color: var(--panorama-utility-success-utility-success-700);
  background: var(--panorama-utility-success-utility-success-50);
}

.badge[data-level="N3"] {
  border-color: var(--panorama-utility-warning-utility-warning-200);
  color: var(--panorama-utility-warning-utility-warning-700);
  background: var(--panorama-utility-warning-utility-warning-50);
}

.badge[data-level="N4"] {
  border-color: var(--panorama-utility-error-utility-error-200);
  color: var(--panorama-utility-error-utility-error-700);
  background: var(--panorama-utility-error-utility-error-50);
}

.aggregation-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: var(--space-2);
  min-width: 0;
  max-width: 100%;
}

.aggregation-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}

.aggregation-pill {
  flex: 0 0 auto;
  max-width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: var(--space-1) var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
  transition: background 140ms ease-out, color 140ms ease-out, border-color 140ms ease-out;
}

.aggregation-pill::before {
  content: none;
}

.aggregation-pill:hover {
  color: var(--brand-strong);
  background: var(--selected-bg);
}

.aggregation-pill.is-current {
  border-color: var(--brand);
  color: var(--brand-strong);
  background: var(--selected-bg);
}

.aggregation-pill.is-active {
  color: var(--brand-strong);
}

.layer-value-tree {
  grid-area: fields;
  min-width: 0;
  padding: 0;
}

.layer-value-trigger {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-height: var(--target-md);
  padding: var(--space-1) 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  text-align: left;
  font-size: 11px;
}

.layer-value-trigger .icon {
  width: 12px;
  height: 12px;
  transform: rotate(-90deg);
  transition: transform 140ms ease-out;
}

.layer-value-tree.is-open .layer-value-trigger .icon {
  transform: rotate(0);
}

.layer-value-trigger strong {
  display: block;
  min-width: 0;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}

.layer-value-list {
  display: grid;
  gap: var(--space-1);
  margin: var(--space-2) 0 0 var(--space-2);
  padding-left: var(--space-3);
  border-left: 1px solid var(--line);
}

.layer-value-option {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14px;
  align-items: center;
  min-height: 34px;
  padding: 3px 4px;
  border: 0;
  color: var(--ink-soft);
  background: transparent;
  text-align: left;
  font-size: 10.5px;
}

.layer-value-option::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -13px;
  width: 8px;
  height: 1px;
  background: var(--surface-muted);
}

.layer-value-option span:first-child {
  min-width: 0;
  overflow: hidden;
}

.layer-value-option strong,
.layer-value-option small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-value-option strong {
  font-size: 10.5px;
  font-weight: 680;
}

.layer-value-option small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 620;
}

.layer-value-option:hover {
  color: var(--brand-strong);
  background: var(--selected-bg);
}

.layer-value-option.is-active {
  color: var(--brand-strong);
  font-weight: 760;
}

.layer-value-option.requires-variant small {
  color: var(--muted);
}

.aggregation-pill:disabled {
  cursor: not-allowed;
  opacity: .54;
}

.empty-state {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.dataset-info {
  min-height: 0;
  height: auto;
  overflow-y: auto;
  padding: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.45;
}

.dataset-card {
  display: grid;
  gap: 9px;
}

.dataset-card-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-2);
  align-items: start;
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--line-soft);
}

.dataset-level {
  min-width: 30px;
  align-self: start;
  padding: 2px 5px;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  color: var(--brand-strong);
  background: var(--brand-soft);
  text-align: center;
  font-size: 11px;
  font-weight: 700;
}

.dataset-card-header h3 {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
}

.dataset-card-header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  word-break: break-word;
}

.dataset-description {
  margin: -1px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.45;
}

.dataset-map-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: max-content;
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  color: var(--brand-strong);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
}

.dataset-map-action:hover {
  background: var(--hover-bg);
}

.dataset-map-action .icon {
  width: 14px;
  height: 14px;
}

.dataset-summary {
  padding-top: 8px;
  border-top: 1px solid var(--line-soft);
}

.dataset-details {
  border-top: 1px solid var(--line-soft);
  color: var(--ink-soft);
}

.dataset-details summary {
  min-height: 34px;
  padding: 8px 0;
  cursor: pointer;
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
}

.dataset-details[open] summary {
  border-bottom: 1px solid var(--line-soft);
}

.dataset-details dl {
  padding-top: 8px;
}

.dataset-info dl {
  display: grid;
  grid-template-columns: 94px 1fr;
  gap: 6px 10px;
  margin: 0;
}

.dataset-info dt {
  color: var(--muted);
}

.dataset-info dd {
  margin: 0;
  word-break: break-word;
}

.map-toolbar {
  position: absolute;
  z-index: 20;
  right: calc(min(var(--right-panel-width), 42vw));
  bottom: 0;
  left: calc(min(var(--left-panel-width), 42vw));
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  max-width: none;
  min-height: calc(38px + var(--safe-bottom));
  padding: 3px var(--space-2) calc(3px + var(--safe-bottom));
  border: 0;
  border-top: 1px solid rgb(20 35 32 / 10%);
  border-radius: 0;
  background: var(--panel-bg);
  box-shadow: none;
}

body.sidebar-collapsed .map-toolbar {
  left: var(--panel-rail-width);
}

body.right-panel-collapsed .map-toolbar {
  right: var(--panel-rail-width);
}

.control-group {
  display: flex;
  align-items: center;
  gap: 1px;
  padding-right: 2px;
  border-right: 0;
}

.control-group:last-of-type {
  border-right: 0;
}

.map-toolbar button,
.map-toolbar select,
.basemap-control {
  min-height: var(--target-sm);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  background: transparent;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.map-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: var(--target-sm);
  padding: 4px;
}

.map-toolbar button span:last-child:not([data-icon]) {
  display: none;
}

.map-toolbar button[aria-pressed="true"] {
  border-color: var(--line);
  color: var(--brand-strong);
  background: var(--selected-bg);
}

.map-toolbar button:disabled {
  cursor: not-allowed;
  opacity: .52;
}

.map-toolbar button.is-exporting {
  color: var(--brand-strong);
  background: var(--selected-bg);
}

.basemap-control {
  gap: 3px;
  padding: 0 3px;
  border-color: var(--line-soft);
  background: var(--panel-bg);
}

.basemap-control > span {
  display: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.basemap-control select {
  min-height: var(--target-sm);
  width: 120px;
  max-width: 100%;
  padding: 0 12px;
  border: 0;
  background: transparent;
}

.right-panel {
  position: absolute;
  z-index: 22;
  top: var(--header-height);
  right: 0;
  bottom: 0;
  display: flex;
  width: min(var(--right-panel-width), 42vw);
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel-bg);
  box-shadow: none;
  transition: transform 180ms ease-out, opacity 180ms ease-out;
}

body.right-panel-collapsed .right-panel {
  transform: translateX(calc(100% + 24px));
  opacity: 0;
  pointer-events: none;
}

.right-panel-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 10px var(--space-3);
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
}

.right-panel-body {
  display: grid;
  flex: 1 1 auto;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}


.layer-stack-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 7px;
  min-height: 0;
  padding: 10px var(--space-3);
  border-bottom: 1px solid var(--line-soft);
  background: transparent;
  pointer-events: auto;
}

.layer-stack-panel--right {
  overflow: hidden;
  max-height: none;
  background: var(--surface-strong);
}

.layer-stack-panel--right:has(.layer-stack-list:empty) {
  min-height: min(360px, 42dvh);
}

.layer-stack-panel:has(> .data-export-status:not([hidden])) {
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.layer-stack-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.layer-stack-header h2 {
  font-size: 13px;
}

.layer-stack-hint {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  max-width: 270px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 560;
  line-height: 1.25;
}

.layer-stack-hint .icon {
  width: 12px;
  height: 12px;
  margin-top: 1px;
  color: var(--brand);
  opacity: .68;
}

.sidebar-collapse-action {
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  color: var(--muted);
}

.sidebar-collapse-action:hover {
  color: var(--brand-strong);
}

.layer-stack-count {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: var(--brand);
  background: var(--surface-muted);
  font-size: 12px;
  font-weight: 700;
}

.layer-stack-actions {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.layer-stack-action,
.layer-stack-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: transparent;
  font-size: 10.5px;
  font-weight: 620;
  white-space: nowrap;
}

.layer-stack-action:hover:not(:disabled),
.layer-stack-clear:hover:not(:disabled) {
  color: var(--brand-strong);
  background: var(--selected-bg);
}

.layer-stack-clear:disabled {
  cursor: not-allowed;
  opacity: .42;
}

.layer-stack-action .icon,
.layer-stack-clear .icon {
  width: 13px;
  height: 13px;
}

.layer-export-button {
  flex: 0 0 auto;
}

.layer-export-button:hover:not(:disabled) {
  color: var(--brand-strong);
  background: var(--selected-bg);
}

.layer-export-button:disabled {
  cursor: not-allowed;
  opacity: .42;
}

.layer-export-button.is-exporting {
  color: var(--brand-strong);
  background: var(--selected-bg);
}

.layer-export-button .icon {
  width: 13px;
  height: 13px;
}

.data-export-status {
  margin: 0;
  max-height: 80px;
  overflow: auto;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.data-export-status[hidden] {
  display: none;
}

.layer-stack-list {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 0;
  max-height: min(300px, 31vh);
  min-height: 0;
  overflow: auto;
  padding-right: 2px;
}

.layer-stack-panel--right .layer-stack-list {
  max-height: none;
}

.layer-stack-empty {
  padding: 8px 9px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 12px;
}

.layer-stack-dropzone {
  position: relative;
  z-index: 2;
  height: 6px;
  margin: 0;
  pointer-events: none;
}

.layer-stack-dropzone::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 40px;
  right: 18px;
  height: 1px;
  border-radius: 999px;
  background: transparent;
  opacity: 0;
  transform: translateY(-50%) scaleX(.96);
  transform-origin: center;
  transition: background 120ms ease-out, opacity 120ms ease-out, transform 120ms ease-out;
}

.layer-stack-list.is-dragging-stack .layer-stack-dropzone {
  z-index: 4;
  height: 16px;
  margin: -2px 0;
}

.layer-stack-dropzone.is-drop-target,
.layer-stack-list.is-dragging-stack .layer-stack-dropzone.is-drop-target {
  height: 18px;
  margin: -1px 0;
}

.layer-stack-dropzone.is-drop-target::before {
  height: 2px;
  background: var(--brand);
  opacity: .76;
  transform: translateY(-50%) scaleX(1);
}

.layer-stack-item {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 32px 32px;
  grid-template-areas:
    "grip text visibility remove"
    ". opacity opacity opacity"
    ". scale scale scale"
    ". fields fields fields";
  align-items: start;
  gap: var(--space-2);
  min-height: var(--target-touch);
  padding: var(--space-3) var(--space-2);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--panel-bg);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.layer-stack-item:active,
.layer-stack-list.is-dragging-stack .layer-stack-item {
  cursor: grabbing;
}

.layer-stack-item:hover,
.layer-stack-item:focus-visible {
  background: var(--hover-bg);
}

.layer-stack-item.is-selected {
  background: var(--selected-bg);
}

.layer-stack-item.is-dragging {
  border-color: var(--panorama-border-border-brand);
  background: var(--selected-bg);
  opacity: .58;
}

.layer-stack-item.is-dragging * {
  pointer-events: none;
}

.layer-stack-item.is-hidden .stack-layer-text {
  display: grid;
  grid-area: text;
  min-width: 0;
  gap: var(--space-1);
}

.layer-stack-item:has(.stack-aggregation-pills) {
  min-height: 88px;
}

.layer-stack-item:has(.layer-value-tree) {
  min-height: 96px;
}

.layer-stack-item:has(.layer-value-tree.is-open) {
  align-items: start;
}

.layer-stack-list.is-dragging-stack .layer-stack-item:not(.is-dragging) {
  z-index: 0;
  opacity: .76;
  pointer-events: none;
}

.stack-grip {
  display: grid;
  grid-area: grip;
  width: 22px;
  min-height: 32px;
  align-self: start;
  place-items: center;
  color: var(--muted);
  cursor: grab;
}

.stack-grip:hover,
.layer-stack-item:hover .stack-grip {
  color: var(--brand);
}

.stack-grip:active {
  cursor: grabbing;
}

.stack-grip .icon {
  width: 14px;
  height: 14px;
}

.stack-layer-text {
  display: grid;
  grid-area: text;
  min-width: 0;
  gap: 2px;
}

.stack-layer-text strong,
.stack-layer-text small {
  white-space: normal;
  overflow-wrap: anywhere;
}

.stack-layer-text strong {
  font-size: 12px;
  line-height: 1.4;
}

.stack-layer-text small {
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.15;
}

.stack-visibility,
.stack-remove {
  display: grid;
  width: 30px;
  height: 30px;
  min-width: 30px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.stack-visibility {
  grid-area: visibility;
}

.stack-remove {
  grid-area: remove;
}

.stack-visibility:hover,
.stack-remove:hover {
  color: var(--brand-strong);
  background: var(--selected-bg);
}

.stack-visibility[aria-pressed="false"] {
  color: var(--muted);
  opacity: .72;
}

.stack-visibility[aria-pressed="false"]:hover {
  opacity: 1;
}

.stack-visibility .icon,
.stack-remove .icon {
  width: 14px;
  height: 14px;
}

.stack-aggregation-pills {
  margin: 0;
}

.stack-opacity {
  grid-area: opacity;
  display: grid;
  grid-template-columns: auto minmax(64px, 104px) 38px;
  align-items: center;
  justify-self: start;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.4;
  cursor: default;
}
.stack-opacity input {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-width: 0;
  height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.stack-opacity input::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 1px;
  background: var(--line);
}
.stack-opacity input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 8px;
  height: 8px;
  margin-top: -3px;
  border: 0;
  border-radius: 50%;
  background: var(--brand);
}
.stack-opacity input::-moz-range-track {
  height: 2px;
  border: 0;
  border-radius: 1px;
  background: var(--line);
}
.stack-opacity input::-moz-range-thumb {
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 50%;
  background: var(--brand);
}
.stack-opacity input:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
.stack-opacity-value { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

.stack-aggregation-pill {
  min-height: 32px;
  font-size: 11px;
}

.layer-value-tree--stack {
  grid-area: fields;
  padding: 0;
}

.layer-value-tree--stack .layer-value-list {
  max-height: 190px;
  margin: 2px 0 0 7px;
  overflow-y: auto;
}

.layer-value-tree--stack .layer-value-option {
  min-height: 30px;
  padding-right: 2px;
}

.layer-value-tree--stack .layer-value-option strong {
  font-size: 10px;
}

.stack-attribute-preview {
  min-height: 0;
  overflow: hidden;
  border-top: 0;
  padding-top: 0;
}

.stack-preview-head {
  display: grid;
  gap: 2px;
  margin-bottom: 7px;
}

.stack-preview-head span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
}

.stack-preview-head strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stack-preview-empty {
  display: grid;
  gap: 3px;
  padding: 8px 9px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 12px;
  line-height: 1.35;
}

.stack-preview-empty strong {
  color: var(--ink-soft);
  font-size: 12px;
}

.stack-preview-table-wrap {
  max-height: 176px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
}

.stack-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  line-height: 1.25;
}

.stack-preview-table th,
.stack-preview-table td {
  max-width: 130px;
  padding: 5px 7px;
  border-bottom: 1px solid var(--surface-muted);
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stack-preview-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: var(--surface);
  font-weight: 700;
}

.stack-preview-table tbody tr:hover {
  background: var(--brand-soft);
}

.right-tabs-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  min-height: 0;
  padding: 10px var(--space-3);
  border-top: 0;
  overflow: auto;
  pointer-events: auto;
}

.right-tabs-panel > :not(.right-tab-panel) {
  flex: none;
}

.value-field-control[hidden] {
  display: none;
}

.value-field-tree {
  position: relative;
  margin-bottom: 8px;
}

.value-field-trigger {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-height: var(--target-md);
  padding: var(--space-2) 0;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-soft);
  background: transparent;
  text-align: left;
}

.value-field-trigger .icon {
  width: 13px;
  height: 13px;
  transform: rotate(-90deg);
  transition: transform 140ms ease-out;
}

.value-field-tree.is-open .value-field-trigger .icon {
  transform: rotate(0);
}

.value-field-label {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
}

.value-field-trigger strong {
  display: block;
  min-width: 0;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}

.value-field-list {
  display: grid;
  gap: 1px;
  max-height: 190px;
  margin: 2px 0 8px 8px;
  padding: 4px 0 5px 13px;
  overflow: auto;
  border-left: 1px solid var(--surface-muted);
  border-bottom: 1px solid var(--line-soft);
}

.value-field-list[hidden] {
  display: none;
}

.value-field-option {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px;
  align-items: center;
  min-height: 36px;
  padding: 4px 2px;
  border: 0;
  color: var(--ink-soft);
  background: transparent;
  text-align: left;
  font-size: 11px;
}

.value-field-option::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -13px;
  width: 8px;
  height: 1px;
  background: var(--surface-muted);
}

.value-field-option span:first-child {
  min-width: 0;
  overflow: hidden;
}

.value-field-option strong,
.value-field-option small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.value-field-option strong {
  font-size: 11px;
  font-weight: 690;
}

.value-field-option small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 620;
}

.value-field-option:hover {
  color: var(--brand-strong);
  background: var(--selected-bg);
}

.value-field-option.is-active {
  color: var(--brand-strong);
  font-weight: 760;
}

.right-tabs {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  min-width: 0;
  border-bottom: 1px solid var(--line);
}

.right-tab {
  position: relative;
  min-width: 0;
  min-height: var(--target-md);
  margin-bottom: -1px;
  padding: 7px 12px;
  overflow: hidden;
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  color: var(--ink-soft);
  background: transparent;
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.right-tab:hover {
  color: var(--brand-strong);
  background: var(--selected-bg);
}

.right-tab.is-active {
  border-color: var(--line);
  color: var(--brand-strong);
  background: var(--panel-bg);
}

.right-tab-panel {
  display: grid;
  flex: 1 0 auto;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: visible;
  padding-top: 10px;
}

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

.feature-info,
.map-legend {
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--panel-bg);
  box-shadow: none;
}

.map-legend {
  justify-self: stretch;
  width: 100%;
  padding: 7px 9px;
}

.legend-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 2px 8px;
  margin-bottom: 6px;
}

.legend-header span {
  grid-row: 1 / span 2;
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
}

.legend-header strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 11.5px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-header small {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-strip {
  display: flex;
  height: 8px;
  overflow: hidden;
  border: 1px solid rgb(20 35 32 / 16%);
  border-radius: 999px;
}

.legend-strip i {
  flex: 1 1 0;
  min-width: 0;
  background: var(--bin-color);
}

.legend-markers {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}

.legend-markers span {
  overflow: hidden;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.legend-category {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.2;
}

.legend-category i {
  width: 9px;
  height: 9px;
  border: 1px solid rgb(20 35 32 / 14%);
  border-radius: 999px;
  background: var(--bin-color);
}

.legend-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.legend-categories.legend-classes { gap: 2px 12px; }
.legend-class {
  min-height: 24px;
  max-width: 100%;
  padding: 2px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 11px;
  line-height: 1.4;
  text-align: left;
}
button.legend-class { cursor: pointer; }
button.legend-class:hover { color: var(--brand-strong); }
button.legend-class:hover .legend-class-label { text-decoration: underline; text-underline-offset: 3px; }
.legend-class[aria-pressed="false"] { opacity: .55; }
.legend-class[aria-pressed="false"] .legend-class-label { text-decoration: line-through; }
.legend-classes .legend-class { gap: 5px; }
.legend-classes .legend-class i { width: 9px; height: 9px; flex: 0 0 9px; border: 0; }
/* Keep white and transparent classes identifiable on the panel surface. */
.legend-class i[style*="var(--surface-strong)" i],
.legend-class i[style*="var(--surface-strong)" i],
.legend-class i[style*="transparent"],
.legend-class i[style*="rgba(0,0,0,0)"] { box-shadow: inset 0 0 0 1px var(--line); }
.legend-class-label { overflow-wrap: anywhere; }
.legend-filter-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 4px; color: var(--ink-soft); font-size: 10px; line-height: 1.5; }
.legend-reset { min-height: 24px; padding: 2px 0; border: 0; color: var(--brand-strong); background: transparent; font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.legend-class:focus-visible, .legend-reset:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (max-width: 680px), (max-width: 1000px) and (max-height: 500px) and (pointer: coarse) {
  .legend-class, .legend-reset { min-height: 32px; }
}

.feature-info {
  max-height: 176px;
  overflow: auto;
  padding: 10px;
  font-size: 12px;
  line-height: 1.4;
  pointer-events: auto;
}

.map-readout {
  position: static;
  z-index: auto;
  flex: 1 1 auto;
  min-width: 0;
  height: auto;
  margin-left: auto;
  padding: 0;
  overflow: hidden;
  border: 0;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 10.5px;
  font-weight: 400;
  line-height: 1.2;
  text-align: right;
  text-overflow: ellipsis;
  text-shadow: 0 1px 0 var(--panel-bg);
  white-space: nowrap;
  pointer-events: none;
}

.feature-info-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 8px;
  margin-bottom: 8px;
}

.feature-info-title span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.feature-info-title strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feature-info-help {
  margin: -3px 0 8px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.3;
}

.feature-info-release {
  align-self: center;
  padding: 2px 0;
  border: 0;
  color: var(--brand-strong);
  background: transparent;
  font-size: 10px;
  font-weight: 720;
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 3px;
}

.feature-info-table-wrap {
  max-height: 176px;
  overflow: auto;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
}

.feature-info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  line-height: 1.25;
}

.feature-info-table th,
.feature-info-table td {
  max-width: 154px;
  padding: 5px 7px;
  border-bottom: 1px solid var(--surface-muted);
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  vertical-align: top;
  white-space: nowrap;
}

.feature-info-table thead th {
  position: sticky;
  top: 0;
  color: var(--muted);
  background: var(--surface-strong);
  font-weight: 700;
  z-index: 1;
}

.feature-info-table .feature-info-group th {
  padding-top: 7px;
  color: var(--brand-strong);
  background: var(--surface-strong);
  font-size: 10px;
  font-weight: 780;
  text-transform: none;
}

.feature-info-table tbody th {
  width: 42%;
  color: var(--muted);
  font-weight: 700;
}

.feature-info-table td {
  color: var(--ink);
}

.feature-info-table td.is-empty {
  color: transparent;
}

.feature-info-empty {
  color: var(--muted);
  font-weight: 700;
}

/* Same dotted orbital sphere as the intranet; labels carry the loading state. */
.loading-overlay {
  position: absolute;
  z-index: 28;
  top: calc(var(--header-height) + 12px);
  left: 50%;
  display: grid;
  gap: 6px;
  width: min(340px, calc(100vw - 32px));
  transform: translateX(-50%);
  pointer-events: none;
}
.loading-overlay[hidden], .map-load-notice[hidden] { display: none; }
.loading-feedback {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 8px 14px;
  border: 0;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
  font-size: 13px;
  line-height: 1.4;
}
.loading-orb { display: block; flex: 0 0 auto; }
button[aria-busy="true"], .layer-export-button[aria-busy="true"], .map-toolbar button[aria-busy="true"], .upload-submit[aria-busy="true"], .catalogue-export[aria-busy="true"] { opacity: 1; cursor: progress; }
.loading-feedback span { min-width: 0; overflow-wrap: anywhere; text-shadow: 0 1px 3px var(--surface-strong), 0 0 6px var(--surface-strong); }
.catalogue-loading-content { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 68px; }
.map-load-notice {
  position: absolute;
  z-index: 28;
  bottom: 60px;
  left: 50%;
  width: min(340px, calc(100vw - 32px));
  transform: translateX(-50%);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--surface-strong);
  font-size: 12px;
  line-height: 1.5;
}
@media (max-width: 680px), (max-width: 1000px) and (max-height: 500px) and (pointer: coarse) {
  .loading-overlay { width: min(310px, calc(100vw - 32px)); }
  .loading-feedback { min-height: 58px; padding: 6px 10px; }
}


.catalogue-panel {
  position: absolute;
  z-index: 38;
  inset: 0;
  visibility: visible;
  pointer-events: none;
}

.catalogue-panel[aria-hidden="true"] {
  visibility: hidden;
}

.catalogue-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: color-mix(in srgb, var(--panorama-background-bg-overlay) 45%, transparent);
  opacity: 1;
  transition: opacity 180ms ease-out;
  pointer-events: auto;
}

.catalogue-panel[aria-hidden="true"] .catalogue-backdrop {
  opacity: 0;
}

.catalogue-sheet {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  bottom: var(--space-3);
  left: var(--space-3);
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: var(--space-3);
  overflow: hidden;
  padding: var(--space-4);
  border: 1px solid rgb(20 35 32 / 10%);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: var(--surface-strong);
  box-shadow: var(--shadow-lg);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 180ms ease-out, transform 180ms ease-out;
  pointer-events: auto;
}

.catalogue-panel[aria-hidden="true"] .catalogue-sheet {
  opacity: 0;
  transform: translateY(10px);
}

.catalogue-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--line-soft);
}

.catalogue-header h2 {
  font-size: 20px;
  line-height: 1.15;
}

.catalogue-header p:last-child {
  max-width: 78ch;
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.45;
}

.catalogue-controls {
  display: grid;
  grid-template-columns: minmax(280px, 2fr) repeat(5, minmax(118px, 1fr)) auto;
  gap: var(--space-2);
  align-items: end;
}

.catalogue-controls label {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.catalogue-controls label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.catalogue-search {
  display: flex !important;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--target-md);
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
}

.catalogue-search input {
  min-width: 0;
  width: 100%;
  min-height: 42px;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
}

.catalogue-search input:focus {
  outline: 0;
}

.catalogue-controls select,
.catalogue-export {
  min-width: 0;
  min-height: var(--target-md);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  background: var(--surface-strong);
  font-size: 12px;
  font-weight: 700;
}

.catalogue-controls select {
  width: 100%;
  padding: 0 9px;
}

.catalogue-export {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
}

.catalogue-statusline {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 30px;
  color: var(--muted);
  font-size: 12px;
}

.catalogue-statusline strong {
  color: var(--brand);
  font-size: 17px;
}

.catalogue-statusline span:last-child {
  margin-left: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
}

.catalogue-table-wrap {
  position: relative;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
}

.catalogue-table {
  width: 100%;
  min-width: 1100px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.catalogue-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: var(--target-md);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: var(--brand);
  text-align: left;
}

/* Name, description and keywords lead the reading order. */
.catalogue-table th:nth-child(1) { width: 23%; }
.catalogue-table th:nth-child(2) { width: 22%; }
.catalogue-table th:nth-child(3) { width: 13%; }
.catalogue-table th:nth-child(4) { width: 6%; }
.catalogue-table th:nth-child(5) { width: 12%; }
.catalogue-table th:nth-child(6) { width: 9%; }
.catalogue-table th:nth-child(7) { width: 15%; }
.catalogue-text-heading { padding-inline: 10px; font-size: 11px; }


.catalogue-sort {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 100%;
  padding: 0 10px;
  border: 0;
  color: inherit;
  background: transparent;
  font-size: 11px;
  font-weight: 800;
}

.catalogue-sort .icon {
  width: 13px;
  height: 13px;
  opacity: .6;
}

.catalogue-sort.is-active {
  color: var(--brand-strong);
  background: var(--surface-muted);
}

.catalogue-sort.is-active[data-direction="desc"] .icon {
  transform: rotate(180deg);
}

.catalogue-table td {
  min-height: 40px;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-soft);
  overflow: hidden;
  overflow-wrap: anywhere;
  text-overflow: ellipsis;
  vertical-align: top;
}

.catalogue-table tr:hover td {
  background: var(--surface);
}

.catalogue-action-cell {
  white-space: nowrap;
}

.catalogue-status-cell {
  color: var(--brand-strong);
  font-weight: 700;
}

.catalogue-unpublished {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.catalogue-open-layer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 30px;
  padding: 4px 7px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--brand-strong);
  background: var(--selected-bg);
  font-size: 10.5px;
  font-weight: 700;
}

.catalogue-open-layer:hover {
  background: var(--brand-soft);
}

.catalogue-open-layer .icon {
  width: 14px;
  height: 14px;
}

.catalogue-table .catalogue-message {
  padding: 22px 18px;
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 13px;
}

.catalogue-table .catalogue-message--loading {
  color: var(--brand);
  background: transparent;
  border: 0;
}

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

.catalogue-name-cell strong,
.catalogue-name-cell small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.catalogue-name-cell strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.25;
}

.catalogue-name-cell small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10.5px;
  line-height: 1.3;
  white-space: normal;
}

.upload-panel {
  position: absolute;
  z-index: 39;
  inset: 0;
  visibility: visible;
  pointer-events: none;
}

.upload-panel[aria-hidden="true"] {
  visibility: hidden;
}

.upload-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: color-mix(in srgb, var(--panorama-background-bg-overlay) 45%, transparent);
  opacity: 1;
  transition: opacity 180ms ease-out;
  pointer-events: auto;
}

.upload-panel[aria-hidden="true"] .upload-backdrop {
  opacity: 0;
}

.upload-sheet {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  bottom: var(--space-3);
  left: var(--space-3);
  display: grid;
  grid-template-columns: minmax(300px, .76fr) minmax(540px, 1.24fr);
  gap: 0;
  overflow: hidden;
  border: 1px solid rgb(20 35 32 / 10%);
  border-radius: var(--radius-md);
  color: var(--ink);
  background: var(--surface-strong);
  box-shadow: var(--shadow-lg);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 180ms ease-out, transform 180ms ease-out;
  pointer-events: auto;
}

.upload-panel[aria-hidden="true"] .upload-sheet {
  opacity: 0;
  transform: translateY(10px);
}

.upload-content {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: var(--space-4);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: var(--space-6) clamp(28px, 3vw, 48px);
  background: var(--surface-strong);
}

.upload-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: var(--space-3);
  padding-bottom: 0;
  border-bottom: 0;
}

.upload-header h2 {
  font-size: 22px;
  line-height: 1.15;
}

.upload-header p:last-child {
  max-width: 62ch;
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.45;
}

.upload-form {
  display: grid;
  align-content: start;
  gap: var(--space-3);
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.upload-help { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.5; }
.upload-technical { border-top: 1px solid var(--line-soft); padding-top: 8px; }
.upload-technical summary { min-height: 44px; display: list-item; align-content: center; color: var(--brand); font-size: 13px; font-weight: 700; cursor: pointer; }
.upload-technical summary:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.upload-technical[open] > .upload-help { margin: 8px 0 12px; }
.upload-technical .upload-grid { margin-bottom: 12px; }

.upload-guidance {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.upload-guidance div {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
}

.upload-guidance strong {
  color: var(--brand);
  font-size: 12px;
}

.upload-guidance span {
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.45;
}

.upload-notice {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(220px, .8fr);
  gap: var(--space-3);
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink-soft);
  background: var(--surface);
}

.upload-notice strong {
  display: block;
  margin-bottom: 4px;
  color: var(--brand-strong);
  font-size: 13px;
}

.upload-notice p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.45;
}

.upload-file {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 104px;
  align-content: center;
  justify-items: center;
  padding: var(--space-3);
  border: 1px dashed var(--line);
  border-radius: var(--radius-md);
  color: var(--ink-soft);
  background: var(--surface-strong);
  text-align: center;
}

.upload-file .icon {
  width: 22px;
  height: 22px;
  color: var(--brand);
}

.upload-file strong {
  color: var(--ink);
  font-size: 14px;
}

.upload-file small {
  max-width: 58ch;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.upload-file input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  opacity: 0;
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.upload-form label:not(.upload-file) {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.upload-form label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.upload-form input,
.upload-form select,
.upload-form textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--surface-strong);
  font-size: 13px;
}

.upload-form input,
.upload-form select {
  min-height: var(--target-md);
  padding: 0 9px;
}

.upload-form textarea {
  min-height: 92px;
  padding: 9px;
  resize: vertical;
}

.upload-form .upload-file input {
  position: absolute;
  width: 1px;
  min-width: 0;
  height: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  opacity: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  pointer-events: none;
}

.upload-file:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus-ring) 15%, transparent);
}

.upload-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding-top: var(--space-2);
  border-top: 1px solid var(--line-soft);
}

.upload-status {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.upload-status[data-tone="success"] {
  color: var(--success);
}

.upload-status[data-tone="error"] {
  color: var(--danger);
}

.upload-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: var(--target-md);
  padding: 0 14px;
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  color: var(--surface-strong);
  background: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.upload-submit:hover {
  background: var(--brand-strong);
}

.upload-submit:disabled {
  cursor: wait;
  opacity: .62;
}

.info-panel {
  position: absolute;
  z-index: 35;
  inset: 0;
  visibility: visible;
  pointer-events: none;
}

.info-panel[aria-hidden="true"] {
  visibility: hidden;
}

.info-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: color-mix(in srgb, var(--panorama-background-bg-overlay) 45%, transparent);
  opacity: 1;
  transition: opacity 180ms ease-out;
  pointer-events: auto;
}

.info-panel[aria-hidden="true"] .info-backdrop {
  opacity: 0;
}

.info-sheet {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  bottom: var(--space-3);
  left: var(--space-3);
  display: grid;
  grid-template-columns: minmax(300px, .76fr) minmax(540px, 1.24fr);
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  box-shadow: var(--shadow-lg);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 180ms ease-out, transform 180ms ease-out;
  pointer-events: auto;
}

.info-panel[aria-hidden="true"] .info-sheet {
  opacity: 0;
  transform: translateY(10px);
}

.info-visual,
.upload-visual {
  min-width: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 28px;
  padding: clamp(28px, 4vw, 56px);
  color: var(--panorama-text-primary-on-brand);
  background: var(--panorama-background-bg-brand-section);
}


.info-visual-copy,
.upload-visual-copy {
  max-width: 360px;
}

.info-visual-copy h2,
.upload-visual-copy h2 {
  margin-bottom: var(--space-2);
  color: var(--surface-strong);
  font-size: 23px;
  line-height: 1.15;
  text-wrap: balance;
}

.info-visual-copy p:last-child,
.upload-visual-copy p:last-child {
  margin: 0;
  color: var(--panorama-text-secondary-on-brand);
  font-size: 14px;
  line-height: 1.55;
}

.info-content {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-content: start;
  gap: var(--space-4);
  min-width: 0;
  overflow-y: auto;
  padding: var(--space-6) clamp(28px, 3vw, 48px);
  background: var(--surface-strong);
}

.info-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: 0;
}

.info-header h2 {
  font-size: 22px;
  line-height: 1.15;
}

.info-lede {
  max-width: 72ch;
  margin: var(--space-2) 0 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}

.icon-button {
  display: grid;
  width: var(--target-md);
  height: var(--target-md);
  place-items: center;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: min-content;
  gap: var(--space-3);
  align-content: start;
}

.info-section {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
}

.info-section--levels {
  grid-column: 1 / -1;
}

.info-section--guide {
  grid-column: 1 / -1;
}

.info-section-title {
  color: var(--brand);
}

.info-section p,
.info-list,
.source-list {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}

.level-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--space-5);
  gap: var(--space-2);
}

.level-item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
}

.level-item:nth-child(-n + 2) {
  padding-top: 0;
  border-top: 0;
}

.level-item:last-child {
  grid-column: 1 / -1;
}

.level-item strong {
  display: grid;
  min-height: 34px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 12px;
}

.level-item span {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.5;
}

.info-list,
.source-list {
  display: grid;
  gap: 8px;
  padding-left: 18px;
}

.info-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: info-step;
}

.info-steps li {
  position: relative;
  min-width: 0;
  padding: 8px 8px 8px 30px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  background: var(--surface-strong);
  font-size: 12px;
  line-height: 1.4;
  counter-increment: info-step;
}

.info-steps li::before {
  content: counter(info-step);
  position: absolute;
  top: 8px;
  left: 8px;
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 50%;
  color: var(--brand-strong);
  background: var(--brand-soft);
  font-size: 10px;
  font-weight: 800;
}

.info-glossary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 7px 12px;
  margin: 0;
  padding-top: 4px;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.4;
}

.info-glossary dt {
  color: var(--brand-strong);
  font-weight: 760;
}

.info-glossary dd {
  margin: 0;
}

.info-atlas {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--line-soft);
}

.info-atlas img {
  display: block;
  width: min(150px, 38vw);
  height: auto;
  opacity: .74;
}

.info-atlas p {
  max-width: 42ch;
  margin: 0;
  color: var(--ink-muted);
  font-size: 12px;
  line-height: 1.45;
  text-align: right;
}

.source-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--space-4);
}

.maplibregl-map {
  font: 12px/1.4 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.maplibregl-ctrl-top-right {
  top: calc(var(--header-height) + var(--space-3));
}

.maplibregl-ctrl-bottom-left {
  left: calc(min(var(--left-panel-width), 42vw) + var(--space-1));
  bottom: var(--space-2);
}

body.sidebar-collapsed .maplibregl-ctrl-bottom-left {
  left: calc(var(--panel-rail-width) + var(--space-2));
}

.maplibregl-ctrl-bottom-right {
  right: calc(min(var(--right-panel-width), 42vw) + var(--space-1));
  bottom: var(--space-2);
}

body.right-panel-collapsed .maplibregl-ctrl-bottom-right {
  right: calc(var(--panel-rail-width) + var(--space-2));
}

.maplibregl-ctrl-attrib {
  font-size: 10px;
}


@media (max-width: 1180px) {
  .catalogue-controls {
    grid-template-columns: minmax(260px, 1.4fr) repeat(2, minmax(128px, 1fr)) auto;
  }

  .map-toolbar {
    justify-content: flex-start;
  }
}

@media (max-width: 920px) {
  .brand-block h1,
  .topbar-action span:last-child:not([data-icon]) {
    display: none;
  }

  .topbar-actions {
    gap: 5px;
  }

  .topbar-action {
    min-width: var(--target-md);
    min-height: var(--target-md);
    padding: 6px 8px;
  }

  .sidebar {
    width: min(390px, 48vw);
  }

  .right-panel {
    width: min(360px, 48vw);
  }

  .map-toolbar {
    left: min(390px, 48vw);
    right: min(360px, 48vw);
    justify-content: flex-start;
  }

  .map-readout {
    min-width: 0;
  }

  body.right-panel-collapsed .map-toolbar {
    right: var(--panel-rail-width);
  }

  body.sidebar-collapsed .map-toolbar {
    left: var(--panel-rail-width);
  }

  body:not(.sidebar-collapsed) .map-toolbar {
    display: none;
  }

  .maplibregl-ctrl-bottom-right {
    right: calc(min(360px, 48vw) + var(--space-1));
  }

  body.right-panel-collapsed .maplibregl-ctrl-bottom-right {
    right: calc(var(--panel-rail-width) + var(--space-2));
  }

  .catalogue-sheet {
    padding: var(--space-3);
  }

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

  .catalogue-search {
    grid-column: 1 / -1;
  }

  .catalogue-export {
    width: 100%;
  }

  .upload-sheet {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .upload-visual {
    min-height: 280px;
    padding: var(--space-5);
  }

  .upload-content {
    padding: var(--space-5);
  }

  .upload-notice {
    grid-template-columns: 1fr;
  }

  .upload-guidance,
  .upload-grid {
    grid-template-columns: 1fr;
  }

  .info-sheet {
    grid-template-columns: 1fr;
  }

  .info-visual {
    min-height: 300px;
    padding: var(--space-5);
  }

  .info-content {
    padding: var(--space-5);
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .info-section--levels {
    grid-row: auto;
  }

  .level-list {
    grid-template-columns: 1fr;
  }

  .level-item:nth-child(2) {
    padding-top: 10px;
    border-top: 1px solid var(--line-soft);
  }

  .level-item:last-child {
    grid-column: auto;
  }

  .source-list {
    grid-template-columns: 1fr;
  }

  .info-steps,
  .info-glossary {
    grid-template-columns: 1fr;
  }

  .info-atlas {
    align-items: flex-start;
    flex-direction: column;
  }

  .info-atlas p {
    text-align: left;
  }
}

@media (max-width: 680px), (max-width: 1000px) and (max-height: 500px) and (pointer: coarse) {
  :root {
    --header-height: calc(56px + var(--safe-top));
    --panel-rail-width: 44px;
  }

  .topbar {
    min-height: var(--header-height);
    gap: var(--space-2);
    padding: max(6px, var(--safe-top)) max(var(--space-2), var(--safe-right)) 6px max(var(--space-2), var(--safe-left));
  }

  .topbar-action span:last-child:not([data-icon]) {
    display: none;
  }

  .topbar-actions {
    gap: 5px;
  }

  .topbar-action {
    min-width: var(--target-md);
    min-height: var(--target-md);
    padding: 6px 8px;
  }

  .topbar-panel-controls .topbar-action {
    min-height: var(--target-md);
  }

  .panel-action--icon,
  .icon-button {
    width: var(--target-touch);
    min-width: var(--target-touch);
    height: var(--target-touch);
  }

  .panel-action--icon {
    width: auto;
    padding: 0 10px;
  }

  .panel-action-label {
    display: inline;
  }

  .right-tab,
  .upload-submit,
  .catalogue-controls select,
  .catalogue-export,
  .catalogue-search,
  .search-field {
    min-height: var(--target-touch);
  }

  .search-input {
    min-height: calc(var(--target-touch) - 2px);
  }

  .layer-section-heading button,
  .layer-add-control,
  .layer-main,
  .layer-discovery-filter,
  .aggregation-pill,
  .layer-stack-action,
  .layer-stack-clear,
  .map-toolbar button,
  .map-toolbar select,
  .basemap-control {
    min-height: var(--target-touch);
  }

  .layer-stack-action,
  .layer-stack-clear,
  .dataset-map-action,
  .catalogue-open-layer,
  .stack-visibility,
  .stack-remove {
    min-width: var(--target-touch);
  }

  .layer-stack-item {
    grid-template-columns: var(--target-touch) minmax(0, 1fr) var(--target-touch) var(--target-touch);
  }

  .stack-grip {
    width: var(--target-touch);
    min-height: var(--target-touch);
  }

  .stack-visibility,
  .stack-remove {
    width: var(--target-touch);
    height: var(--target-touch);
  }

  .layer-stack-item:has(.stack-aggregation-pills) {
    min-height: 108px;
  }

  .stack-aggregation-pill {
    min-height: 30px;
    padding: 4px 7px;
    font-size: 9px;
  }

  .map-toolbar button {
    min-width: var(--target-touch);
  }

  .sidebar {
    top: var(--header-height);
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
  }

  .right-panel {
    top: var(--header-height);
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
  }

  .map-toolbar {
    right: 0;
    bottom: 0;
    left: 0;
    max-width: none;
    justify-content: flex-start;
  }

  body.sidebar-collapsed .map-toolbar {
    left: var(--panel-rail-width);
  }

  body.right-panel-collapsed .map-toolbar {
    right: var(--panel-rail-width);
  }

  .map-readout {
    min-width: 0;
    font-size: 10px;
  }

  .layer-stack-list {
    max-height: 180px;
  }

  .map-toolbar button span:last-child:not([data-icon]),
  .basemap-control > span {
    display: none;
  }

  body:not(.sidebar-collapsed) .map-toolbar,
  body:not(.sidebar-collapsed) .right-panel,
  body:not(.sidebar-collapsed) .map-readout,
  body:not(.right-panel-collapsed) .map-readout,
  body:not(.right-panel-collapsed) .map-toolbar {
    display: none;
  }

  .info-sheet {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    border-radius: 0;
  }

  .info-visual {
    min-height: 250px;
  }

  .info-content {
    padding: var(--space-4);
  }

  .catalogue-sheet {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    border-radius: 0;
  }

  .catalogue-header {
    gap: var(--space-2);
  }

  .catalogue-header h2 {
    font-size: 18px;
  }

  .catalogue-header p:last-child {
    display: none;
  }

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

  .catalogue-statusline {
    flex-wrap: wrap;
  }

  .catalogue-statusline span:last-child {
    width: 100%;
    margin-left: 0;
  }

  .upload-sheet {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    max-height: none;
    border-radius: 0;
    transform: none;
  }

  .upload-panel[aria-hidden="true"] .upload-sheet {
    transform: translateY(10px);
  }

  .upload-header {
    gap: var(--space-2);
  }

  .upload-header h2 {
    font-size: 18px;
  }

  .upload-header p:last-child {
    display: block;
    font-size: 12px;
  }

  .upload-visual {
    min-height: 230px;
    padding: var(--space-4);
  }

  .upload-visual-copy h2 {
    font-size: 20px;
  }

  .upload-visual-copy p:last-child {
    font-size: 13px;
  }

  .upload-content {
    padding: var(--space-4);
  }

  .upload-actions {
    display: grid;
  }

  .upload-submit {
    width: 100%;
  }

}

@media (max-width: 360px) {

  .topbar {
    gap: 4px;
  }

  .topbar-actions {
    gap: 4px;
  }

  .topbar-panel-controls {
    gap: 3px;
    margin-left: 0;
    padding-left: 4px;
  }
}

@media (max-height: 520px) and (min-width: 700px) {
  .catalogue-sheet,
  .upload-sheet {
    top: var(--space-2);
    right: var(--space-2);
    bottom: var(--space-2);
    left: var(--space-2);
    width: auto;
    max-height: none;
    padding: 10px var(--space-3);
    gap: var(--space-2);
    transform: none;
  }

  .upload-panel[aria-hidden="true"] .upload-sheet {
    transform: translateY(10px);
  }

  .catalogue-header,
  .upload-header {
    padding-bottom: var(--space-2);
  }

  .catalogue-header h2,
  .upload-header h2 {
    font-size: 18px;
  }

  .catalogue-header p:last-child,
  .upload-header p:last-child {
    display: none;
  }

  .upload-notice {
    padding: 10px;
  }

  .catalogue-controls {
    grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(92px, 1fr)) 76px;
    gap: 6px;
  }

  .catalogue-search {
    grid-column: auto;
  }

  .catalogue-controls label > span {
    font-size: 10.5px;
  }

  .catalogue-statusline {
    min-height: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar,
  .right-panel,
  .loading-overlay,
  .info-backdrop,
  .info-sheet {
    transition: none;
  }

  .catalogue-backdrop,
  .catalogue-sheet,
  .upload-backdrop,
  .upload-sheet {
    transition: none;
  }

}

/* Catalogue discovery: shared facets, readable metadata, compact mobile controls. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.catalogue-help summary,
.discovery-more summary {
  padding: 8px 0;
  cursor: pointer;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 700;
}
.catalogue-help p { line-height: 1.5; }
.discovery-field {
  display: grid;
  min-width: 0;
  gap: 5px;
  margin-bottom: 8px;
  color: var(--ink-soft);
  font-size: 12px;
}
.discovery-field select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--surface-strong);
  font: inherit;
}
.discovery-grid { display: grid; gap: 4px; }
.discovery-more { border-bottom: 1px solid var(--line-soft); }
.discovery-tools { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 7px 0; }
.discovery-reset {
  min-height: 32px;
  padding: 4px 0;
  border: 0;
  color: var(--brand-strong);
  background: transparent;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.discovery-reset:disabled { color: var(--muted); text-decoration: none; cursor: default; }
.discovery-criteria { margin: 0 0 10px; color: var(--ink-soft); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.dataset-keywords { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.keyword-chip {
  min-height: 28px;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-strong);
  color: var(--brand-strong);
  font-size: 11px;
  line-height: 1.35;
  text-align: left;
  overflow-wrap: anywhere;
}
.keyword-chip[aria-pressed="true"], .keyword-chip:hover { background: var(--selected-bg); border-color: var(--brand); }
/* Stable category colors; labels and underlining also communicate theme and selection. */
.catalogue-theme-tag {
  --theme-ink: var(--ink-soft);
  --theme-bg: var(--surface-muted);
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  padding: 2px 6px;
  border: 0;
  border-radius: 3px;
  background: var(--theme-bg);
  color: var(--theme-ink);
  font: inherit;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.3;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}
.catalogue-theme-tag:hover { text-decoration: underline; text-underline-offset: 3px; }
.catalogue-theme-tag[aria-pressed="true"] {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.catalogue-theme-tag:focus-visible {
  outline: 2px solid var(--theme-ink);
  outline-offset: 2px;
}
.dataset-keywords > span { color: var(--muted); font-size: 11px; }
.dataset-resources { display: grid; gap: 8px; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.dataset-resources a { color: var(--brand-strong); font-size: 12px; line-height: 1.5; text-underline-offset: 3px; overflow-wrap: anywhere; }
.dataset-resources p { margin: 0; font-size: 12px; line-height: 1.5; color: var(--ink-soft); }
.dataset-prose { font-size: 12px; line-height: 1.6; white-space: pre-line; }
.dataset-description { font-size: 13px; }
.dataset-details summary { font-size: 12px; }
.catalogue-controls { grid-template-columns: minmax(0, 1fr) auto; }
.catalogue-controls > .catalogue-search { grid-column: auto; }
.catalogue-controls > .catalogue-facet-grid { grid-row: 2; grid-column: 1 / -1; }
.catalogue-controls > .catalogue-export { grid-row: 1; grid-column: 2; }
.catalogue-facet-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.catalogue-name-button { padding: 0; border: 0; color: var(--ink); background: transparent; font: inherit; font-size: 13px; font-weight: 700; text-align: left; line-height: 1.4; text-decoration: underline; text-underline-offset: 3px; }
.catalogue-status-cell small { display: block; margin-top: 6px; color: var(--ink-soft); font-size: 11px; font-weight: 400; }
.catalogue-action-cell { white-space: normal; }
.catalogue-action-cell button { margin: 0 0 6px; min-height: 34px; }
.catalogue-name-cell small { font-size: 12px; line-height: 1.5; }
.discovery-field select:focus-visible,
.discovery-reset:focus-visible,
.discovery-more summary:focus-visible,
.catalogue-help summary:focus-visible,
.keyword-chip:focus-visible,
.catalogue-name-button:focus-visible,
.dataset-resources a:focus-visible,
.catalogue-table-wrap:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
@media (max-width: 920px) {
  .catalogue-controls { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .catalogue-controls > .catalogue-search { grid-column: 1 / -1; }
  .catalogue-controls > .catalogue-export { grid-row: 2; grid-column: 1 / -1; }
  .catalogue-controls > .catalogue-facet-grid { grid-row: 3; }
  .catalogue-facet-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px), (max-width: 1000px) and (max-height: 500px) and (pointer: coarse) {
  .layer-panel { overflow-y: auto; }
  .layer-panel > * { flex-shrink: 0; }
  .layer-panel .layer-list { overflow: visible; flex: 0 0 auto; }
  .layer-discovery-filter { font-size: 11px; }
  .discovery-field select, .discovery-reset, .keyword-chip, .catalogue-open-layer, .dataset-map-action { min-height: 44px; }
  .discovery-more summary, .catalogue-help summary { min-height: 44px; }
  .catalogue-sheet { gap: 8px; }
  .catalogue-controls { max-height: none; overflow: visible; padding: 2px; }
  .catalogue-controls .catalogue-export { font-size: 11px; }
  .catalogue-statusline { gap: 5px 10px; }
  .catalogue-statusline strong { font-size: 15px; }
  .catalogue-statusline #catalogueSortInfo { display: none; }
  .catalogue-statusline .discovery-reset { margin-left: auto; }
  .catalogue-table { min-width: 0; table-layout: auto; display: block; }
  .catalogue-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .catalogue-table tbody { display: block; }
  .catalogue-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 12px 10px; border-bottom: 1px solid var(--line); }
  .catalogue-table td { display: block; padding: 6px; min-height: 0; border: 0; font-size: 12px; }
  .catalogue-table td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 11px; margin-bottom: 4px; }
  .catalogue-table td:first-child, .catalogue-table td:last-child, .catalogue-table td.catalogue-description-cell, .catalogue-table td.catalogue-keywords-cell, .catalogue-table td.catalogue-message { grid-column: 1 / -1; }
  .catalogue-table td:first-child::before, .catalogue-table td:last-child::before { display: none; }
  .catalogue-action-cell { display: block !important; }
  .catalogue-action-cell button { flex: 1; margin: 0; min-height: 44px; }
  .dataset-resources a { display: flex; align-items: center; min-height: 44px; }
}

/* Hierarchy inside layer rows and cards: title, scale, then attributes. */
.aggregation-control {
  grid-area: scale;
  display: grid;
  gap: var(--space-2);
  min-width: 0;
}
.aggregation-control.is-single {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.aggregation-value { color: var(--ink-soft); font-size: 12px; line-height: 1.4; }
.stack-aggregation-pills[data-choice-count="4"] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.attribute-summary { display: grid; gap: var(--space-1); min-width: 0; }
.attribute-summary-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-3);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}
.attribute-count { flex: 0 0 auto; font-weight: 400; }
.layer-value-trigger:hover, .value-field-trigger:hover { color: var(--brand-strong); background: var(--hover-bg); }

/* Forms and reading panels use the same label-to-value and group spacing. */
.discovery-field, .catalogue-controls label, .upload-form label:not(.upload-file) { gap: var(--space-2); }
.discovery-grid { gap: var(--space-2); padding-block: var(--space-2); }
.discovery-tools { gap: var(--space-2) var(--space-4); margin-block: var(--space-2); }
.dataset-card { gap: var(--space-4); }
.dataset-info dl { grid-template-columns: minmax(80px, 28%) minmax(0, 1fr); gap: var(--space-3) var(--space-4); }
.dataset-keywords { gap: var(--space-2); }
.dataset-keywords > span { flex-basis: 100%; }
.dataset-resources { gap: var(--space-3); padding-top: var(--space-4); }
.catalogue-controls { gap: var(--space-3) var(--space-4); }
.catalogue-facet-grid { gap: var(--space-4); padding-block: var(--space-2); }
.catalogue-action-cell button + button { margin-left: var(--space-2); }
.legend-header { gap: var(--space-1) var(--space-3); margin-bottom: var(--space-3); }
.legend-header strong { white-space: normal; overflow-wrap: anywhere; line-height: 1.4; }
.legend-categories { gap: var(--space-2) var(--space-3); }
.legend-category { gap: var(--space-2); line-height: 1.4; }
.legend-category i { flex: 0 0 9px; }
.layer-section-counts { gap: var(--space-2); }

@media (max-width: 680px), (max-width: 1000px) and (max-height: 500px) and (pointer: coarse) {
  body:not(.sidebar-collapsed) .panel-rail,
  body:not(.right-panel-collapsed) .panel-rail { display: none; }
  .layer-stack-item { grid-template-columns: 22px minmax(0, 1fr) 44px 44px; }
  .stack-grip { width: 22px; }
  .stack-visibility, .stack-remove { width: 44px; min-width: 44px; height: 44px; }
  .stack-opacity input { height: 32px; }
  .aggregation-pill, .stack-aggregation-pill, .layer-value-trigger, .value-field-trigger { min-height: 44px; font-size: 11px; }
  .aggregation-pills[data-choice-count="4"] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalogue-action-cell button + button { margin-left: 0; }
  .catalogue-sheet { gap: var(--space-3); }
}

/* The left rail introduces compositions; the catalogue owns data selection. */
.preset-panel { overflow-y: auto; padding: 20px; }
.preset-panel:last-child { padding-bottom: 24px; }
.preset-panel > * { flex-shrink: 0; }
.preset-panel .panel-header { margin-bottom: 8px; }
.preset-panel h2, .preset-catalogue-entry h3 { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.4; }
.preset-intro { margin: 0 0 18px; font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
.preset-list { display: grid; gap: 8px; }
.preset-list:empty { min-block-size: calc(6 * 5.4rem + 40px); }
.preset-choice { --preset-color: var(--panorama-border-border-brand); display: grid; grid-template-columns: minmax(0, 1fr) 18px; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-strong); color: var(--ink); text-align: left; }
.preset-choice:hover { background: var(--hover-bg); border-color: var(--preset-color); }
.preset-choice[aria-pressed="true"] { background: var(--selected-bg); border-color: var(--preset-color); }
.preset-choice:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
.preset-choice-copy { display: grid; gap: 5px; }
.preset-choice-copy strong { font-size: 14px; font-weight: 700; line-height: 1.4; }
.preset-choice-copy > span { font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
.preset-help { margin: 12px 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.preset-status { margin: 12px 0 4px; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.preset-panel:has(.preset-list:empty) .preset-status { display: block; visibility: hidden; min-block-size: 1.5em; }
.preset-apply, .preset-catalogue-button { display: flex; width: 100%; min-height: 44px; align-items: center; justify-content: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--brand); border-radius: var(--radius-sm); background: var(--brand); color: white; font: inherit; font-size: 13px; font-weight: 700; }
.preset-apply:hover { background: var(--brand-strong); }
.preset-apply:focus-visible, .preset-catalogue-button:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
.preset-catalogue-entry { border-top: 1px solid var(--line); padding-top: 24px; }
.preset-catalogue-entry p { margin: 8px 0 0; font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
.preset-catalogue-button { font-size: 14px; line-height: 1.4; justify-content: flex-start; margin-top: 16px; background: var(--surface-strong); color: var(--brand); border-color: var(--line); }
.preset-catalogue-button:hover { background: var(--hover-bg); border-color: var(--brand); }
#presetCatalogueCount { font-size: 12px; margin-left: auto; color: var(--muted); font-weight: 400; }

.catalogue-workspace { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 16px; min-height: 0; min-width: 0; }
.catalogue-map-tray { display: flex; flex-direction: column; gap: 16px; min-height: 0; min-width: 0; }
.catalogue-drop-zone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px 16px; border: 1px dashed var(--line); border-radius: var(--radius-sm); text-align: center; background: var(--surface); transition: background 120ms, border-color 120ms; }
.catalogue-drop-zone canvas { display: block; width: 100%; height: 100%; }
.catalogue-drop-zone strong { font-size: 14px; }
.catalogue-drop-zone p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
.catalogue-drop-zone.is-dragging { border-color: var(--brand); border-style: solid; }
.catalogue-drop-zone.is-drop-ready { background: var(--panorama-background-bg-success-primary); outline: 2px solid var(--brand); outline-offset: 3px; }
.catalogue-drop-visual { display: grid; place-items: center; width: 144px; max-width: 100%; aspect-ratio: 1; flex-shrink: 0; }
.catalogue-drop-visual > * { grid-area: 1 / 1; }
.catalogue-drop-check { width: 32px; height: 32px; fill: none; stroke: var(--brand); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(.8); transition: opacity 140ms, transform 180ms ease-out; }
.catalogue-drop-zone.is-drop-complete { background: var(--panorama-background-bg-success-primary); border-style: solid; border-color: var(--brand); }
.catalogue-drop-zone.is-drop-complete canvas { opacity: 0; }
.catalogue-drop-zone.is-drop-complete .catalogue-drop-check { opacity: 1; transform: scale(1); }
.catalogue-drop-zone.is-drop-complete p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--brand-strong); }
.is-catalogue-drag-source { opacity: .42; }
.catalogue-drag-preview { position: fixed; top: 0; left: 0; z-index: 60; display: flex; align-items: center; gap: 12px; width: min(300px, calc(100vw - 16px)); padding: 12px 14px; border: 1px solid var(--brand); border-radius: var(--radius-sm); background: var(--surface-strong); color: var(--ink); box-shadow: 0 8px 24px rgb(20 35 32 / 20%); pointer-events: none; user-select: none; will-change: transform; }
.catalogue-drag-preview > svg { flex: 0 0 20px; width: 20px; height: 20px; fill: none; stroke: var(--brand); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.catalogue-drag-preview > div { display: grid; gap: 4px; min-width: 0; }
.catalogue-drag-preview strong { font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.catalogue-drag-preview span { font-size: 11px; line-height: 1.3; color: var(--muted); }
.catalogue-drag-preview.is-drop-ready { background: var(--surface-muted); }
#catalogueMapStatus { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.catalogue-active-layers { margin: 0; padding: 0; list-style: none; overflow-y: auto; min-height: 0; flex: 1; }
.catalogue-active-layers li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); font-size: 12px; line-height: 1.4; }
.catalogue-active-layers li > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.catalogue-remove-layer { display: grid; place-items: center; flex: 0 0 28px; width: 28px; height: 28px; padding: 0; border: 0; color: var(--muted); background: transparent; cursor: pointer; }
.catalogue-remove-layer .icon { width: 14px; height: 14px; }
.catalogue-remove-layer:hover { color: var(--brand-strong); background: var(--hover-bg); }
.catalogue-remove-layer:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.catalogue-open-layer.is-added { color: var(--ink-soft); background: transparent; }

/* Native modal retains the catalogue, filters and scroll position beneath it. */
.dataset-sheet { width: min(50vw, 720px); min-width: min(480px, calc(100vw - 32px)); max-width: calc(100vw - 32px); max-height: calc(100dvh - 48px); margin: auto; padding: 0; overflow: hidden; border: 0; border-radius: var(--radius-md); color: var(--ink); background: var(--surface-strong); box-shadow: var(--shadow-lg); }
.dataset-sheet[open] { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.dataset-sheet::backdrop { background: color-mix(in srgb, var(--panorama-background-bg-overlay) 45%, transparent); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.dataset-sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 24px; border-bottom: 1px solid var(--line-soft); }
.dataset-sheet-header h2 { margin: 0; font-size: 18px; line-height: 1.3; }
.dataset-sheet-header .icon-button { flex-shrink: 0; }
.dataset-sheet-content { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px 24px 24px; }
@media (max-width: 680px), (max-width: 1000px) and (max-height: 500px) and (pointer: coarse) {
  .dataset-sheet { width: calc(100vw - 24px); min-width: 0; max-width: none; max-height: calc(100dvh - 24px); }
  .dataset-sheet-header { padding: 12px 16px; }
  .dataset-sheet-content { padding: 16px; }
}
.catalogue-map-tray > .preset-apply { flex-shrink: 0; }
.catalogue-name-cell .catalogue-row-heading { display: flex; align-items: flex-start; gap: 8px; overflow: visible; }
.catalogue-row-heading .layer-drag-handle { position: static; display: flex; flex: 0 0 24px; width: 24px; min-height: 32px; align-items: center; justify-content: center; margin: 0; }
.catalogue-row-heading .layer-drag-handle[hidden] { display: flex; visibility: hidden; }
.catalogue-row-heading .catalogue-name-button { min-width: 0; }
.catalogue-table td:last-child, .catalogue-table th:last-child { position: sticky; right: 0; z-index: 2; background: var(--surface-strong); box-shadow: -1px 0 var(--line); }
.catalogue-table th:last-child { z-index: 3; background: var(--surface); padding: 0 10px; }
.catalogue-table .catalogue-open-layer { width: auto; min-height: 32px; font-size: 11px; margin: 0; padding: 4px 6px; }
.catalogue-open-layer:disabled { cursor: default; background: var(--surface-muted); color: var(--muted); }
.catalogue-add-reference { display: none; margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.is-expanded .catalogue-add-reference { display: block; }
.catalogue-add-reference.is-single-variant { display: block; margin: 0 0 4px; }
.catalogue-levels { display: flex; flex-wrap: wrap; gap: 4px; }
.catalogue-table .catalogue-variant-select { display: block; width: 100%; min-width: 0; min-height: 28px; margin: 0 0 4px; padding: 3px 5px; border: 1px solid var(--line); border-radius: 4px; color: var(--ink-soft); background: var(--surface-strong); font: inherit; font-size: 11px; }
.catalogue-variant-select:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.catalogue-action-cell button + button { margin-left: 0; }
.catalogue-row-actions { display: flex; align-items: center; gap: 4px; }
.catalogue-row-actions .catalogue-details { background: transparent; border: 0; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.catalogue-name-cell .catalogue-row-heading { gap: 4px; align-items: flex-start; }
.catalogue-row-toggle { display: flex; align-items: flex-start; gap: 4px; min-height: 32px; width: 100%; text-decoration: none; padding-block: 4px; }
.catalogue-row-toggle > [data-icon] { display: flex; flex: 0 0 14px; width: 14px; height: 18px; }
.catalogue-row-toggle[aria-expanded="true"] > [data-icon] { transform: rotate(90deg); }
.catalogue-row-toggle > span:last-child, .catalogue-description { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.catalogue-row-toggle .icon { width: 14px; height: 18px; }
.catalogue-table td:nth-child(6) { white-space: nowrap; }
.catalogue-description { font-size: 12px; line-height: 1.5; }
.catalogue-row-toggle:hover { color: var(--brand-strong); }
.catalogue-table .is-expanded td { background: var(--surface); }
.is-expanded .catalogue-row-toggle > span:last-child, .is-expanded .catalogue-description { display: block; overflow: visible; }
.catalogue-keywords-cell .dataset-keywords { gap: 4px; }
.catalogue-keywords-cell .keyword-chip { min-height: 24px; padding: 2px 5px; font-size: 10.5px; border: 0; border-radius: 3px; background: var(--selected-bg); }
.catalogue-keywords-more { min-height: 24px; padding: 2px 4px; border: 0; background: transparent; color: var(--brand-strong); font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
.catalogue-keywords-more:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

.stack-grip, .layer-drag-handle { touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
body.is-pointer-dragging, body.is-pointer-dragging * { user-select: none !important; -webkit-user-select: none !important; cursor: grabbing !important; }

/* Keep documentation and the Atlas signature in normal, non-overlapping flow. */
.info-content { grid-template-rows: auto auto auto; }
.info-atlas { align-items: center; gap: 24px; padding-top: 24px; }
.info-atlas img { flex: 0 0 auto; width: 128px; height: auto; object-fit: contain; }
.info-atlas p { margin: 0; line-height: 1.5; }
.info-header { position: sticky; top: -1px; z-index: 1; background: var(--surface-strong); padding-block: 6px 16px; }
.info-header .icon-button { flex-shrink: 0; }
.info-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 1000px) {
  .info-sheet { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr); }
  .info-visual { display: none; }
}
@media (max-width: 920px) {
  .catalogue-workspace { gap: 12px; }
  .catalogue-drop-zone { padding: 16px 12px; }
}
@media (max-width: 680px), (max-width: 1000px) and (max-height: 500px) and (pointer: coarse) {
  .preset-panel { padding: 20px; }
  .catalogue-workspace { display: flex; flex-direction: column; gap: 12px; }
  .catalogue-table-wrap { flex: 1; }
  .catalogue-map-tray { display: grid; flex-shrink: 0; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 12px; }
  .catalogue-drop-zone { flex-direction: row; gap: 8px; padding: 6px; min-height: 54px; }
  .catalogue-drop-visual { width: 48px; }
  .catalogue-drop-zone strong { font-size: 12px; }
  .catalogue-drop-zone p, .catalogue-active-layers { display: none; }
  .catalogue-map-tray > .preset-apply { width: auto; }
  #catalogueMapStatus { grid-column: 1 / -1; grid-row: 2; max-height: 3em; overflow-y: auto; font-size: 11px; }
  .catalogue-table td:last-child { position: static; box-shadow: none; }
  .catalogue-row-heading .layer-drag-handle { flex-basis: 32px; width: 32px; min-height: 44px; }
  .catalogue-action-cell { flex-wrap: wrap; }
  .catalogue-table .catalogue-open-layer { min-height: 44px; }
  .catalogue-row-toggle { min-height: 44px; }
  .catalogue-table tr { padding: 8px; }
  .catalogue-table td { padding: 4px; }
  .catalogue-table tr:not(.is-expanded) .catalogue-description { -webkit-line-clamp: 1; }
  .catalogue-row-actions { gap: 8px; }
  .catalogue-row-actions button { flex: 1; }
  .catalogue-table tr:not(.is-expanded) td:nth-child(4),
  .catalogue-table tr:not(.is-expanded) td:nth-child(5),
  .catalogue-table tr:not(.is-expanded) td:nth-child(6),
  .catalogue-table tr:not(.is-expanded) .catalogue-keywords-cell { display: none; }
  .catalogue-description-cell::before { display: none !important; }
  .catalogue-keywords-cell .keyword-chip, .catalogue-keywords-more { min-height: 44px; }

  .catalogue-add-reference { flex-basis: 100%; order: 1; margin: 0; }
  .info-atlas { flex-wrap: wrap; gap: 16px; }
  .info-atlas p { text-align: left; }
  .info-steps { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .catalogue-drop-zone, .catalogue-drop-check { transition: none; }
  .catalogue-drop-check { transform: none; }
}

/* Grips move layers; the rest of each card remains a normal scroll surface. */
.layer-stack-item { cursor: pointer; touch-action: pan-y; user-select: auto; }
.layer-stack-item:active { cursor: pointer; }
.catalogue-action-cell button:last-of-type:not(:first-of-type) { background: transparent; border-color: var(--line); }

/* Each layer expands its settings inline; the stack remains the sole scroll area. */
.layer-stack-panel--right .layer-stack-item { grid-template-columns: 18px minmax(0, 1fr) 28px 28px 28px; grid-template-areas: "grip text visibility document remove"; align-items: center; gap: 4px; min-height: 34px; padding: 3px 5px; border-radius: 3px; }
.layer-stack-panel--right .stack-grip { width: 18px; min-height: 26px; align-self: center; }
.layer-stack-panel--right .stack-visibility,
.layer-stack-panel--right .stack-document,
.layer-stack-panel--right .stack-remove { width: 28px; height: 28px; min-width: 28px; padding: 0; }
.layer-stack-panel--right .stack-layer-text strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 12px; line-height: 1.3; }
.selected-layer-controls { display: flex; flex-direction: column; gap: 6px; padding-bottom: 6px; }
.selected-layer-controls[hidden] { display: none; }
.selected-layer-controls h3 { margin: 0; font-size: 13px; line-height: 1.35; overflow-wrap: anywhere; }
.legend-layer-controls { padding: 8px 0 2px; }
.legend-layer-controls .stack-opacity { grid-area: auto; }
.aggregation-control--details { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.aggregation-control--details .aggregation-label { margin: 0; }
.aggregation-control--details .aggregation-pills { display: flex; flex-wrap: wrap; gap: 3px; }
.aggregation-control--details .aggregation-pill { min-height: 24px; padding: 2px 6px; font-size: 10.5px; border: 0; }
.aggregation-control--details .aggregation-value { font-size: 11px; }
.layer-inline-controls .value-field-tree { margin-bottom: 4px; }
.layer-inline-controls .value-field-trigger { min-height: 28px; padding: 4px 0; }
.layer-inline-controls .attribute-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 8px; }
.layer-inline-controls .attribute-summary-heading { display: contents; }
.layer-inline-controls .attribute-count { order: 2; margin-left: auto; font-size: 10px; }
.layer-inline-controls .attribute-summary strong { font-size: 11px; }
.legend-uniform { padding-block: 4px; }
.legend-uniform[data-geometry="line"] i { width: 18px; height: 3px; flex-basis: 18px; border: 0; border-radius: 1px; }
@media (max-width: 680px), (max-width: 1000px) and (max-height: 500px) and (pointer: coarse) {
  .layer-stack-panel--right .layer-stack-item { grid-template-columns: 20px minmax(0, 1fr) 44px 44px 44px; min-height: 44px; }
  .layer-stack-panel--right .stack-grip { width: 20px; min-height: 32px; }
  .layer-stack-panel--right .stack-visibility,
  .layer-stack-panel--right .stack-document,
  .layer-stack-panel--right .stack-remove { width: 44px; height: 44px; min-width: 44px; }
  .aggregation-control--details .aggregation-pill { min-height: 32px; }
}
.grid-inspection-summary {
  padding: 8px 0;
  font-size: 11px;
  line-height: 1.45;
  border-top: 1px solid var(--border, var(--line));
}
.grid-inspection-summary[hidden] { display: none; }
.grid-inspection-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--ink-soft); }
.grid-inspection-summary p { margin: 3px 0 0; color: var(--ink-soft); }
.grid-inspection-id { display: block; color: var(--ink-soft); font-size: 10px; margin-top: 3px; }
.grid-inspection-values { display: flex; flex-wrap: wrap; gap: 2px 12px; }
.grid-inspection-values strong { margin-left: 4px; font-variant-numeric: tabular-nums; }
.grid-inspection-summary button, .feature-info [data-grid-retry] {
  min-height: 24px; width: auto; padding: 0 2px; border: 0; background: transparent;
  color: inherit; font: inherit; text-decoration: underline; cursor: pointer;
}
.grid-inspection-loading { display: flex; align-items: center; gap: 6px; min-height: 25px; }
.grid-inspection-loading canvas { width: 22px; height: 22px; }

/* One compact reading surface for the complete cell, above the map only. */
.cell-hover {
  position: fixed; inset: 0 auto auto 0; z-index: 35;
  display: flex; flex-direction: column; width: 360px; max-height: 460px;
  background: var(--surface-strong); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  pointer-events: none; font-size: 11px; line-height: 1.4; overflow: hidden;
}
.cell-hover[hidden] { display: none; }
.cell-hover[data-pinned="true"] { pointer-events: auto; }
.cell-hover > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 10px; border-bottom: 1px solid var(--line-soft); }
.cell-hover h3 { margin: 0; font-size: 13px; line-height: 1.35; }
.cell-hover > header span { color: var(--ink-soft); font-size: 10px; font-weight: 400; white-space: nowrap; }
.cell-hover > header button { padding: 5px; width: 28px; min-width: 28px; height: 28px; min-height: 28px; border: 0; background: transparent; color: var(--ink-soft); cursor: pointer; }
.cell-hover[data-pinned="false"] > header button { visibility: hidden; }
.cell-hover > header svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.5; fill: none; }
.cell-hover-body { min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--muted) transparent; }
.cell-hover-layer { padding: 6px 10px; }
.cell-hover-layer + .cell-hover-layer { border-top: 1px solid var(--line-soft); }
.cell-hover h4 { margin: 0; font-size: 11px; line-height: 1.4; font-weight: 700; overflow-wrap: anywhere; }
.cell-hover-palette { display: inline-flex; width: 36px; height: 6px; margin-right: 4px; vertical-align: 1px; overflow: hidden; }
.cell-hover-palette.is-uniform { width: 12px; }
.cell-hover-palette i { flex: 1; min-width: 0; background: var(--bin-color); }
.cell-hover p { margin: 2px 0 0; }
.cell-hover-note, .cell-hover-primary > span { color: var(--ink-soft); }
.cell-hover-primary { display: flex; align-items: baseline; gap: 8px; }
.cell-hover-primary > span { min-width: 0; overflow-wrap: anywhere; }
.cell-hover-primary strong { margin-left: auto; max-width: 60%; text-align: right; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.cell-hover-note { display: flex; align-items: baseline; gap: 8px; }
.cell-hover-count { flex: 0 0 auto; color: var(--muted); font-size: 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cell-hover-note .cell-hover-count { margin-left: auto; }
.cell-hover-loading { display: flex; align-items: center; gap: 8px; min-height: 55px; padding: 12px; }
.cell-hover-loading canvas { width: 22px; height: 22px; }
.cell-hover:has(.cell-hover-loading) { background: transparent; border-color: transparent; box-shadow: none; text-shadow: 0 1px 3px var(--surface-strong), 0 0 6px var(--surface-strong); }
.cell-hover:has(.cell-hover-loading) > header { border-bottom-color: transparent; }
.cell-hover-empty { padding: 12px; }
.cell-hover-empty button { border: 0; background: transparent; font: inherit; color: var(--brand); text-decoration: underline; }
.cell-hover :focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (max-width: 680px), (max-width: 1000px) and (max-height: 500px) and (pointer: coarse) {
  .cell-hover { font-size: 12px; }
  .cell-hover h4 { font-size: 12px; }
  .cell-hover > header button { width: 36px; height: 36px; min-height: 36px; }
}

/* Inline layer settings and the shared dataset sheet. */
.layer-stack-panel--right .stack-layer-toggle { display: grid; grid-template-columns: 12px minmax(0, 1fr); align-items: center; gap: 5px; min-height: 32px; width: 100%; padding: 2px 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.stack-layer-toggle .icon { width: 12px; height: 12px; }
.stack-layer-toggle[aria-expanded="true"] .icon { transform: rotate(90deg); }
.stack-document { grid-area: document; display: grid; place-items: center; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); cursor: pointer; }
.stack-document .icon { width: 14px; height: 14px; }
.stack-document:hover { color: var(--brand-strong); background: var(--hover-bg); }
.stack-document:focus-visible, .stack-layer-toggle:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 1px; }
.layer-inline-controls { --control-label-width: 44px; display: flex; flex-direction: column; gap: 6px; grid-column: 1 / -1; min-width: 0; padding: 8px 6px; border-top: 1px solid var(--line); cursor: auto; }
.layer-inline-controls[hidden], #layerControlsParking[hidden] { display: none; }
.layer-inline-controls .map-legend { margin: 0; padding: 0; background: transparent; border: 0; box-shadow: none; }
/* Align captions and use the available width instead of stacking short rows. */
.layer-inline-controls .selected-layer-controls,
.layer-inline-controls .legend-layer-controls { padding: 0; }
.layer-inline-controls .aggregation-control--details { display: grid; grid-template-columns: var(--control-label-width) minmax(0, 1fr); gap: 6px; }
.layer-inline-controls .aggregation-pills { display: grid; grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; align-items: stretch; }
.layer-inline-controls .aggregation-pill { min-height: 28px; padding: 3px 4px; text-align: center; }
.layer-inline-controls .stack-opacity { width: 100%; grid-template-columns: var(--control-label-width) minmax(64px, 1fr) 38px; }
.layer-inline-controls .legend-header { grid-template-columns: var(--control-label-width) minmax(0, 1fr); gap: 6px; align-items: baseline; }
.layer-inline-controls .legend-header span { grid-row: auto; font-size: 11px; font-weight: 500; }
.layer-inline-controls .legend-uniform { padding: 0; }
.layer-inline-controls .value-field-tree { margin: 0; }
.layer-inline-controls .legend-header > strong { display: none; }
.layer-inline-controls .legend-filter-tools[hidden] { display: none; }
.layer-inline-controls .legend-note { font-size: 11px; }
.dataset-sheet-table { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--line); }
.dataset-sheet-table > summary { min-height: 36px; cursor: pointer; font-weight: 700; }
.dataset-sheet-table .stack-attribute-preview { max-height: none; }
@media (pointer: coarse) {
  .layer-stack-panel--right .stack-layer-toggle { min-height: 44px; }
  .layer-inline-controls .aggregation-pill { min-height: 44px; }
}

.panel-rail-arrow { display: grid; place-items: center; width: 30px; height: 30px; color: var(--brand); }
.panel-rail-arrow .icon { width: 20px; height: 20px; }
.panel-rail:hover .panel-rail-arrow { color: var(--brand-strong); }
.confirmation-sheet { width: min(420px, calc(100vw - 32px)); padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-strong); color: var(--ink); box-shadow: var(--shadow-lg); }
.confirmation-sheet::backdrop { background: color-mix(in srgb, var(--panorama-background-bg-overlay) 50%, transparent); }
.confirmation-sheet h2 { font-size: 18px; }
.confirmation-sheet p { margin: 12px 0 20px; color: var(--ink-soft); font-size: 14px; line-height: 1.5; }
.confirmation-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.confirmation-actions button { min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }
.confirmation-actions .confirmation-primary { background: var(--brand); color: var(--on-brand, white); border-color: transparent; }
.confirmation-actions button:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
