html,
body {
  margin: 0;
  height: 100%;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

:root,
html[data-theme='light'] {
  color-scheme: light;
  --app-bg: #fafafa;
  --app-text: #333;
  --panel-heading: #333;
  --surface-bg: #fff;
  --panel-bg: #fff;
  --text-primary: #333;
  --text-muted: #64748b;
  --gutter-bg: #e8e8e8;
  --map-border: #d0d0d0;
  --grid-header-bg: #ececec;
  --grid-header-text: #333;
  --grid-header-border: #c0c0c0;
  --compact-row-height: 26px;
  --compact-font-size: 0.8125rem;
  --compact-toggle-size: 18px;
  --compact-checkbox-size: 16px;
  --theme-toggle-bg: #fff;
  --theme-toggle-border: #c0c0c0;
  --theme-toggle-text: #333;
  --toolbar-border: #d0d0d0;
  --toolbar-label: #555;
  --badge-warning-text: #b45309;
  --badge-warning-bg: #fffbeb;
  --badge-warning-border: #fcd34d;
}

html[data-theme='dark'] {
  color-scheme: dark;
  --app-bg: #252526;
  --app-text: #dedede;
  --panel-heading: #dedede;
  --surface-bg: #2d2d2d;
  --panel-bg: #2d2d2d;
  --text-primary: #dedede;
  --text-muted: #aaa;
  --gutter-bg: #3a3a3a;
  --map-border: #4d4d4d;
  --grid-header-bg: #3d3d3d;
  --grid-header-text: #dedede;
  --grid-header-border: #4d4d4d;
  --theme-toggle-bg: #333;
  --theme-toggle-border: #555;
  --theme-toggle-text: #dedede;
  --toolbar-border: #4d4d4d;
  --toolbar-label: #aaa;
  --badge-warning-text: #fbbf24;
  --badge-warning-bg: #422006;
  --badge-warning-border: #a16207;
}

* {
  box-sizing: border-box;
}

body {
  background: var(--app-bg);
  color: var(--app-text);
}

.boot-splash {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--app-bg);
  color: var(--app-text);
  z-index: 5000;
}

.boot-splash-content {
  max-width: 640px;
  text-align: center;
}

.boot-splash-logo {
  display: block;
  width: min(288px, 90vw);
  height: auto;
  margin: 0 auto 0.75rem;
}

.boot-splash-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
}

html[data-app-init='pending'] .boot-splash,
.boot-splash.is-error {
  display: flex;
}

html[data-app-init='pending'] #report-page,
html[data-app-init='pending'] #fallback-page {
  visibility: hidden;
}

.theme-toggle {
  position: fixed;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 1000;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--theme-toggle-border);
  border-radius: 4px;
  background: var(--theme-toggle-bg);
  color: var(--theme-toggle-text);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.report-page .theme-toggle {
  display: none;
}

.toolbar-layout {
  display: flex;
  align-items: center;
  gap: 0.5rem 0.75rem;
  padding-bottom: 0.15rem;
}

.toolbar-layout-group {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.toolbar-layout-btn,
.map-toolbar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.85rem;
  height: 1.85rem;
  padding: 0;
  border: 1px solid var(--map-border);
  border-radius: 4px;
  background: var(--surface-bg);
  color: var(--text-primary);
  cursor: pointer;
}

.toolbar-layout-btn:hover,
.map-toolbar-btn:hover {
  filter: brightness(0.95);
}

html[data-theme='dark'] .toolbar-layout-btn:hover,
html[data-theme='dark'] .map-toolbar-btn:hover {
  filter: brightness(1.15);
}

.toolbar-layout-btn.is-active,
.map-toolbar-btn.is-active {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.toolbar-layout-btn:disabled {
  opacity: 0.45;
  cursor: default;
  filter: none;
}

.toolbar-layout-btn:disabled:hover {
  filter: none;
}

.toolbar-layout-btn.is-hidden,
.toolbar-layout-btn[hidden] {
  display: none !important;
}

.toolbar-layout-icon,
.map-toolbar-icon {
  display: block;
  flex-shrink: 0;
  pointer-events: none;
}

.theme-toggle:hover {
  filter: brightness(0.95);
}

html[data-theme='dark'] .theme-toggle:hover {
  filter: brightness(1.15);
}

.report-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.report-page .app-shell {
  flex: 1;
  min-height: 0;
  height: auto;
}

.report-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 1rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--toolbar-border);
  background: var(--app-bg);
  flex-shrink: 0;
}

.toolbar-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  width: 12rem;
}

.toolbar-field--half {
  width: 6rem;
}

.toolbar-field--wide {
  width: 24rem;
}

.toolbar-field--wider {
  width: 18rem;
}

.toolbar-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--toolbar-label);
  white-space: nowrap;
}

.toolbar-control {
  width: 100%;
  max-width: 100%;
}

#toolbar-dataset .dx-selectbox,
#toolbar-time-series .dx-selectbox,
#toolbar-summary-level .dx-selectbox,
#toolbar-geo-comp .dx-selectbox,
#toolbar-char-iter .dx-selectbox {
  font-size: var(--compact-font-size);
}

.toolbar-control .dx-texteditor-input {
  cursor: default;
}

.toolbar-field.is-hidden {
  display: none;
}

.is-hidden {
  display: none !important;
}

.toolbar-auth {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  padding-bottom: 0.15rem;
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7a4d00;
  background: #ffe8a3;
  border: 1px solid #e6c35c;
}

html[data-theme='dark'] .demo-badge {
  color: #ffe8a3;
  background: #5c4a1a;
  border-color: #8a7330;
}

.auth-user-label {
  font-size: 0.8125rem;
  color: var(--toolbar-label);
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-button {
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--theme-toggle-border);
  border-radius: 4px;
  background: var(--theme-toggle-bg);
  color: var(--theme-toggle-text);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

.auth-button:hover {
  filter: brightness(0.95);
}

html[data-theme='dark'] .auth-button:hover {
  filter: brightness(1.15);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.5rem 0.25rem 0.25rem;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8125rem;
}

.login-field-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.login-field-header .login-link {
  margin-left: auto;
  text-align: right;
  white-space: nowrap;
}

.login-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.login-actions button {
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--theme-toggle-border);
  border-radius: 4px;
  background: var(--theme-toggle-bg);
  color: var(--theme-toggle-text);
  font: inherit;
  cursor: pointer;
}

#login-submit,
#login-ip-submit {
  font-weight: 600;
}

.login-link {
  color: var(--toolbar-label);
  text-decoration: none;
}

.login-link:hover {
  color: var(--text-primary);
  text-decoration: underline;
}

.login-error {
  margin: 0;
  font-size: 0.8125rem;
  color: #b00020;
}

html[data-theme='dark'] .login-error {
  color: #ff8a80;
}

.export-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.5rem 0.25rem 0.25rem;
}

.export-format-group {
  border: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.export-format-group legend {
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.export-format-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
}

.export-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.export-actions button {
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--theme-toggle-border);
  border-radius: 4px;
  background: var(--theme-toggle-bg);
  color: var(--theme-toggle-text);
  font: inherit;
  cursor: pointer;
}

#export-submit {
  font-weight: 600;
}

.export-error {
  margin: 0;
  font-size: 0.8125rem;
  color: #b00020;
}

html[data-theme='dark'] .export-error {
  color: #ff8a80;
}

.background-task-chips {
  position: fixed;
  left: 0.75rem;
  bottom: 0.75rem;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
  z-index: 900;
  max-width: min(100vw - 1.5rem, 720px);
  pointer-events: none;
}

.background-task-chip {
  width: 220px;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--theme-toggle-border);
  border-radius: 6px;
  background: var(--theme-toggle-bg);
  color: var(--theme-toggle-text);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  pointer-events: auto;
}

.background-task-chip.is-failed {
  border-color: #b00020;
}

.background-task-chip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.background-task-chip-title {
  font-size: 0.8125rem;
  font-weight: 600;
}

.background-task-chip-cancel {
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 0.75rem;
  text-decoration: underline;
  cursor: pointer;
}

.background-task-chip-progress {
  display: block;
  width: 100%;
  height: 0.45rem;
  margin: 0;
}

.background-task-chip-progress.is-indeterminate {
  appearance: none;
  border: none;
  background: linear-gradient(
    90deg,
    rgba(128, 128, 128, 0.25) 0%,
    rgba(128, 128, 128, 0.45) 50%,
    rgba(128, 128, 128, 0.25) 100%
  );
  background-size: 200% 100%;
  animation: background-task-chip-indeterminate 1.2s linear infinite;
}

@keyframes background-task-chip-indeterminate {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.background-task-chip-message {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  line-height: 1.3;
  opacity: 0.85;
}

html[data-theme='dark'] .background-task-chip.is-failed {
  border-color: #ff8a80;
}

.app-shell {
  display: flex;
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
  overflow: hidden;
  background: var(--app-bg);
  min-height: 0;
}

.geo-panel,
.var-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.var-panel {
  padding-top: 0.75rem;
}

.panel h2,
.map-pane-header h2 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--panel-heading);
  flex-shrink: 0;
  cursor: help;
}

.map-pane-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

.map-pane-header h2 {
  margin: 0;
}

.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  flex: 1;
  min-width: 0;
}

.map-toolbar[hidden] {
  display: none !important;
}

.map-toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.map-toolbar-separator {
  flex-shrink: 0;
  align-self: stretch;
  width: 0;
  margin: 0.15rem 0.65rem;
  border-left: 1px solid var(--map-border);
}

.map-selection-status {
  margin-left: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.map-tool-draw {
  cursor: crosshair;
}

.map-tool-draw.map-right-panning {
  cursor: grabbing;
}

.map-overview-badge {
  font-size: 0.75rem;
  color: var(--badge-warning-text);
  background: var(--badge-warning-bg);
  border: 1px solid var(--badge-warning-border);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
  white-space: nowrap;
  cursor: help;
}

.map-overview-badge[hidden] {
  display: none !important;
}

#geo-search,
#var-search {
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

#geo-tree,
#var-tree {
  flex: 1;
  min-height: 0;
}

#geo-tree .dx-treeview-item-content,
#var-tree .dx-treeview-item-content {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--compact-font-size);
  line-height: calc(var(--compact-row-height) - 4px);
  padding-top: 0;
  padding-bottom: 0;
}

#geo-tree .dx-treeview-item,
#var-tree .dx-treeview-item {
  min-height: var(--compact-row-height);
  padding: 2px 6px;
}

#geo-tree .dx-treeview-item-with-checkbox .dx-treeview-item,
#var-tree .dx-treeview-item-with-checkbox .dx-treeview-item {
  padding-left: 32px;
}

#geo-tree .dx-treeview-item-with-checkbox > .dx-checkbox,
#var-tree .dx-treeview-item-with-checkbox > .dx-checkbox {
  line-height: var(--compact-checkbox-size);
  top: calc((var(--compact-row-height) - var(--compact-checkbox-size)) / 2);
  margin-top: 0;
  left: 16px;
}

#geo-tree .dx-treeview-node > .dx-treeview-toggle-item-visibility,
#var-tree .dx-treeview-node > .dx-treeview-toggle-item-visibility {
  top: calc((var(--compact-row-height) - var(--compact-toggle-size)) / 2);
  height: var(--compact-toggle-size);
  width: var(--compact-toggle-size);
  margin-top: 0;
  font: 18px/18px DXIcons;
  line-height: var(--compact-toggle-size);
}

#geo-tree .dx-treeview-node > .dx-treeview-toggle-item-visibility::before,
#var-tree .dx-treeview-node > .dx-treeview-toggle-item-visibility::before,
#geo-tree .dx-treeview-node > .dx-treeview-toggle-item-visibility.dx-treeview-toggle-item-visibility-opened::before,
#var-tree .dx-treeview-node > .dx-treeview-toggle-item-visibility.dx-treeview-toggle-item-visibility-opened::before {
  top: 0;
  left: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  line-height: 18px;
}

#geo-tree .dx-checkbox-icon,
#var-tree .dx-checkbox-icon {
  width: var(--compact-checkbox-size);
  height: var(--compact-checkbox-size);
}

#var-tree .dx-treeview-node.is-calc-locked > .dx-checkbox {
  pointer-events: none;
  opacity: 0.85;
}

.context-menu-anchor {
  position: fixed;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: 2000;
}

.main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.workspace {
  display: flex;
  flex-direction: row;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.grid-pane,
.map-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 0.75rem;
  overflow: hidden;
}

.analysis-dock {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.analysis-tabs {
  display: flex;
  flex-shrink: 0;
  align-items: stretch;
  gap: 0.15rem;
  padding: 0 0.5rem;
  border-bottom: 1px solid var(--toolbar-border);
  background: var(--app-bg);
}

.analysis-tab {
  margin: 0;
  padding: 0.4rem 0.85rem 0.35rem;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

.analysis-tab:hover {
  color: var(--text-primary);
}

.analysis-tab[aria-selected='true'] {
  color: var(--text-primary);
  font-weight: 600;
  border-bottom-color: #2563eb;
}

.analysis-tab-panels {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.analysis-tab-panel {
  display: flex;
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: 0.4rem 0.35rem;
  overflow: hidden;
}

.analysis-tab-panel[hidden] {
  display: none !important;
}

.analysis-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--map-border);
  border-radius: 4px;
  background: var(--surface-bg);
}

.analysis-panel:focus {
  outline: none;
}

.analysis-panel:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: -2px;
}

.analysis-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0.45rem 0.35rem 0.65rem;
  flex-shrink: 0;
  border-bottom: 1px solid var(--map-border);
}

.analysis-panel-header h3 {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--panel-heading);
}

.analysis-panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}

.analysis-panel-btn {
  width: 1.6rem;
  height: 1.6rem;
}

.analysis-panel-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
}

#analysis-panel-details .analysis-panel-body,
#analysis-panel-summary .analysis-panel-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#analysis-panel-charts .analysis-panel-body,
#analysis-panel-correlations .analysis-panel-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#analysis-panel-key-drivers .analysis-panel-body {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.charts-pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  position: relative;
}

.correlations-pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  position: relative;
}

.key-drivers-pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  position: relative;
}

.key-drivers-body {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.key-drivers-report {
  flex: 1;
  min-height: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--panel-bg);
}

.key-drivers-setup {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.25rem 0.15rem;
  min-width: 0;
}

.key-drivers-setup-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: var(--compact-font-size);
}

.key-drivers-setup-field[hidden],
.key-drivers-setup-field.is-hidden {
  display: none;
}

.key-drivers-setup-field > span {
  font-weight: 600;
  color: var(--toolbar-label);
}

.key-drivers-setup-field select {
  max-width: 100%;
}

.key-drivers-drivers {
  max-height: 12rem;
  overflow: auto;
  border: 1px solid var(--map-border);
  border-radius: 4px;
  padding: 0.25rem;
}

.key-drivers-driver-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.35rem;
  font-size: var(--compact-font-size);
}

.key-drivers-setup-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.35;
}

.key-drivers-setup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

#key-drivers-columns-menu button.charts-library-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
}

.correlations-body {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  flex: 1;
  min-height: 0;
  min-width: 0;
  gap: 8px;
}

.correlations-matrix-wrap,
.correlations-scatter-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
}

.correlations-matrix,
.correlations-scatter {
  flex: 1;
  min-height: 0;
  min-width: 0;
  width: 100%;
  height: 100%;
}

.clustering-scatter-axes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.25rem 0.4rem 0;
  flex: 0 0 auto;
}

#clustering-profiles .dx-datagrid-headers .dx-datagrid-table,
#clustering-profiles .dx-datagrid-rowsview .dx-datagrid-table {
  width: 100% !important;
  table-layout: fixed;
}

.correlations-coefficient {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 0.25rem;
  font-size: var(--compact-font-size);
}

.correlations-coefficient select {
  max-width: 16rem;
  font-size: var(--compact-font-size);
}

.correlations-variables-wrap {
  position: relative;
  display: inline-flex;
}

.correlations-variables-empty {
  margin: 0;
  padding: 0.4rem 0.7rem;
  color: var(--text-muted);
  font-size: var(--compact-font-size);
}

.toolbar-layout-btn.is-pressed {
  background: color-mix(in srgb, var(--accent, #0f6cbd) 18%, transparent);
}

.charts-board {
  --charts-tile: 400px;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 0.5rem;
  overflow: auto;
  padding: 0.5rem;
}

.charts-widget {
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  width: var(--charts-tile);
  height: var(--charts-tile);
  min-width: 160px;
  min-height: 160px;
  overflow: hidden;
  resize: both;
  border: 1px solid var(--map-border);
  border-radius: 4px;
  background: var(--surface-bg);
}

.charts-widget-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  padding: 0.2rem 0.25rem 0.2rem 0.5rem;
  border-bottom: 1px solid var(--map-border);
}

.charts-widget-title {
  margin: 0;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--panel-heading);
}

.charts-widget-close,
.charts-widget-maximize,
.charts-widget-menu {
  width: 1.45rem;
  height: 1.45rem;
  flex-shrink: 0;
}

.charts-board.has-maximized-widget {
  flex-wrap: nowrap;
  align-content: stretch;
  align-items: stretch;
  overflow: hidden;
}

.charts-board.has-maximized-widget .charts-widget:not(.is-maximized) {
  display: none;
}

.charts-board.has-maximized-widget .charts-widget.is-maximized {
  flex: 1 1 auto;
  width: auto !important;
  height: auto !important;
  min-width: 0;
  min-height: 0;
  resize: none;
}

.charts-widget-body,
.sunburst-chart {
  flex: 1;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  position: relative;
}

.charts-library-wrap {
  position: relative;
  display: inline-flex;
}

.charts-library-menu {
  position: fixed;
  z-index: 3500;
  display: flex;
  flex-direction: column;
  min-width: 16rem;
  max-width: min(28rem, calc(100vw - 1rem));
  max-height: 18rem;
  overflow: auto;
  padding: 0.35rem 0;
  background: var(--panel-bg);
  color: var(--text-primary);
  border: 1px solid var(--map-border);
  box-shadow: 0 4px 16px rgb(0 0 0 / 0.15);
}

.charts-library-menu[hidden] {
  display: none !important;
}

.charts-library-item {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 0.25rem 0.7rem;
  font-size: var(--compact-font-size);
  line-height: 1.35;
  cursor: pointer;
}

.charts-library-item:hover {
  background: var(--gutter-bg);
}

.charts-library-item input {
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.sunburst-chart svg {
  display: block;
  width: 100%;
  height: 100%;
}

.sunburst-chart path.is-expandable {
  cursor: pointer;
}

.sunburst-chart .sunburst-center.is-collapsible,
.sunburst-chart .sunburst-center-label.is-collapsible {
  cursor: pointer;
}

.sunburst-tooltip {
  position: fixed;
  z-index: 20000;
  max-width: 280px;
  padding: 0.4rem 0.55rem;
  border: 1px solid var(--map-border);
  border-radius: 4px;
  background: var(--surface-bg);
  color: var(--text-primary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
  font-size: var(--compact-font-size);
  line-height: 1.35;
  pointer-events: none;
}

.sunburst-tooltip-hint {
  margin-top: 0.2rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.sunburst-context-menu {
  position: fixed;
  z-index: 20010;
  min-width: 10rem;
  padding: 0.2rem 0;
  border: 1px solid var(--map-border);
  border-radius: 4px;
  background: var(--surface-bg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.sunburst-context-menu-item {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0.35rem 0.75rem;
  border: none;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: var(--compact-font-size);
  text-align: left;
  cursor: pointer;
}

.sunburst-context-menu-item:hover {
  background: var(--gutter-bg);
}

.sunburst-chart path.is-draggable {
  cursor: grab;
}

.charts-board.is-drop-target {
  outline: 2px dashed var(--accent, #0d6efd);
  outline-offset: -2px;
}

.charts-widget-timeseries .charts-ts-host,
.charts-ts-host,
.charts-ts-chart {
  flex: 1;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
}

.charts-ts-menu .dx-menu-item .dx-icon-check {
  color: var(--accent, #0d6efd);
}

.dx-overlay-wrapper:has(.charts-ts-menu) {
  z-index: 20000;
}

.count-selector {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  gap: 0.5rem;
}

.count-selector-hint {
  margin: 0;
  font-size: var(--compact-font-size);
  color: var(--text-muted);
}

.count-selector-tree {
  flex: 1;
  min-height: 0;
}

.count-selector-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.is-timeseries-drag {
  cursor: grab;
}

.area-details-pane {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
  position: relative;
}

.area-details-toolbar:empty {
  display: none;
}

.area-details-toolbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.35rem;
  border-bottom: 1px solid var(--map-border);
}

.area-details-toolbar-group {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.area-details-period-change-wrap {
  display: inline-flex;
  align-items: center;
}

.area-details-toolbar .map-toolbar-separator {
  margin: 0.15rem 0.35rem;
}

.area-details-tree {
  flex: 1;
  min-height: 0;
}

.area-details-tree[hidden],
#area-details-empty[hidden],
#summary-empty[hidden],
#summary-calculating[hidden],
#charts-board[hidden],
#charts-empty[hidden],
#correlations-matrix[hidden],
#correlations-empty[hidden],
#correlations-calculating[hidden],
#correlations-scatter-wrap[hidden],
#correlations-scatter[hidden],
#correlations-scatter-empty[hidden],
#clustering-profiles[hidden],
#clustering-empty[hidden],
#clustering-calculating[hidden],
#clustering-scatter-wrap[hidden],
#clustering-scatter[hidden],
#clustering-scatter-empty[hidden],
#key-drivers-empty[hidden],
#key-drivers-report[hidden],
#key-drivers-calculating[hidden] {
  display: none !important;
}

#area-details-tree .dx-treelist-headers,
#summary-tree .dx-treelist-headers {
  color: var(--grid-header-text);
  border-bottom: 1px solid var(--grid-header-border);
}

#area-details-tree .dx-treelist-headers .dx-header-row > td,
#summary-tree .dx-treelist-headers .dx-header-row > td {
  background-color: var(--grid-header-bg);
  color: var(--grid-header-text);
  font-weight: 600;
  font-size: var(--compact-font-size);
  padding-top: 4px;
  padding-bottom: 4px;
  vertical-align: middle;
}

#area-details-tree .dx-treelist-rowsview .dx-data-row,
#summary-tree .dx-treelist-rowsview .dx-data-row {
  height: var(--compact-row-height);
}

#area-details-tree.area-details-show-period-change .dx-treelist-rowsview .dx-data-row {
  height: auto;
  min-height: calc(var(--compact-row-height) + 14px);
}

#area-details-tree .dx-treelist-rowsview .dx-row > td,
#summary-tree .dx-treelist-rowsview .dx-row > td {
  font-size: var(--compact-font-size);
  padding-top: 2px;
  padding-bottom: 2px;
  line-height: 1.25;
  vertical-align: middle;
}

#area-details-tree .dx-header-row > td.area-details-period {
  font-weight: 500;
}

#area-details-tree .area-details-current-period,
#area-details-tree .dx-header-row .area-details-current-period {
  font-weight: 700;
}

.area-details-period-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0.05em;
  line-height: 1.2;
}

.area-details-period-change {
  font-size: 0.85em;
  font-style: italic;
  white-space: nowrap;
}

.area-details-change-up {
  color: #16a34a;
}

.area-details-change-down {
  color: #dc2626;
}

html[data-theme='dark'] .area-details-change-up {
  color: #4ade80;
}

html[data-theme='dark'] .area-details-change-down {
  color: #f87171;
}

#area-details-tree .dx-command-select,
#summary-tree .dx-command-select {
  width: 0 !important;
  min-width: 0 !important;
  max-width: 0 !important;
  padding: 0 !important;
  border: none !important;
  overflow: hidden;
}

.summary-aggregates-wrap {
  position: relative;
  display: inline-flex;
}

.summary-aggregates-menu {
  position: absolute;
  top: calc(100% + 0.2rem);
  left: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 11.5rem;
  max-height: 18rem;
  overflow: auto;
  padding: 0.35rem 0;
  background: var(--panel-bg);
  color: var(--text-primary);
  border: 1px solid var(--map-border);
  box-shadow: 0 4px 16px rgb(0 0 0 / 0.15);
}

.summary-aggregates-menu[hidden] {
  display: none !important;
}

.summary-aggregates-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.7rem;
  font-size: var(--compact-font-size);
  white-space: nowrap;
  cursor: pointer;
}

.summary-aggregates-item:hover {
  background: var(--gutter-bg);
}

.summary-calculating-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--panel-bg) 72%, transparent);
  color: var(--text-muted);
  font-size: var(--compact-font-size);
  pointer-events: none;
}

.analysis-empty {
  margin: 0;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  font-size: var(--compact-font-size);
  line-height: 1.4;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.analysis-empty strong {
  display: block;
  font-size: 1.15em;
  margin-bottom: 0.4rem;
}

.analysis-empty p {
  margin: 0 0 0.7rem;
}

.analysis-empty-tip {
  font-style: italic;
  font-weight: 600;
}

.analysis-expand-popup .dx-overlay-content {
  display: flex;
  flex-direction: column;
}

.analysis-expand-popup .dx-popup-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 0;
  overflow: hidden;
}

.analysis-expand-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
}

.analysis-expand-content .charts-pane {
  min-height: 0;
}

.analysis-expand-content .key-drivers-pane {
  min-height: 0;
}

.analysis-expand-empty {
  margin: 0;
  padding: 1.25rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.analysis-expand-empty[hidden] {
  display: none !important;
}

.main > .gutter,
.workspace > .gutter,
.analysis-tab-panel > .gutter,
.sidebar > .gutter,
.app-shell > .gutter {
  flex-shrink: 0;
  background-color: var(--gutter-bg);
  background-repeat: no-repeat;
  background-position: 50%;
}

.app-shell > .gutter.gutter-horizontal,
.workspace > .gutter.gutter-horizontal,
.analysis-tab-panel > .gutter.gutter-horizontal {
  cursor: col-resize;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='30' viewBox='0 0 6 30'%3E%3Ccircle cx='3' cy='5' r='1.2' fill='%23a0a0a0'/%3E%3Ccircle cx='3' cy='15' r='1.2' fill='%23a0a0a0'/%3E%3Ccircle cx='3' cy='25' r='1.2' fill='%23a0a0a0'/%3E%3C/svg%3E");
}

.main > .gutter.gutter-vertical,
.sidebar > .gutter.gutter-vertical {
  cursor: row-resize;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='6' viewBox='0 0 30 6'%3E%3Ccircle cx='5' cy='3' r='1.2' fill='%23a0a0a0'/%3E%3Ccircle cx='15' cy='3' r='1.2' fill='%23a0a0a0'/%3E%3Ccircle cx='25' cy='3' r='1.2' fill='%23a0a0a0'/%3E%3C/svg%3E");
}

#report-grid {
  flex: 1;
  min-height: 0;
}

#report-grid .dx-datagrid-headers {
  color: var(--grid-header-text);
  border-bottom: 1px solid var(--grid-header-border);
}

#report-grid .dx-datagrid-headers .dx-header-row > td {
  background-color: var(--grid-header-bg);
  color: var(--grid-header-text);
  font-weight: 600;
  font-size: var(--compact-font-size);
  padding-top: 4px;
  padding-bottom: 4px;
  vertical-align: middle;
}

#report-grid .dx-datagrid-content .dx-datagrid-table .dx-row > td {
  vertical-align: middle;
}

#report-grid .dx-datagrid-rowsview .dx-data-row {
  height: var(--compact-row-height);
}

#report-grid .dx-datagrid-rowsview .dx-row > td {
  font-size: var(--compact-font-size);
  padding-top: 2px;
  padding-bottom: 2px;
  line-height: 1.25;
}

#report-grid .report-grid-header-caption {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-pane-body {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.map-column {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
}

.geo-select-panel {
  flex-shrink: 0;
  border: 1px solid var(--map-border);
  border-radius: 4px;
  background: var(--surface-bg);
  margin-bottom: 0.35rem;
}

.geo-select-panel[hidden] {
  display: none !important;
}

.geo-select-panel-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem 0.75rem;
  padding: 0.45rem 0.55rem;
}

.geo-select-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0;
  min-width: 0;
}

.geo-select-close {
  align-self: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.1rem 0.35rem;
  cursor: pointer;
}

.geo-select-close:hover {
  color: var(--text-primary);
}

.geo-select-fields {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.35rem 0.65rem;
  min-width: 0;
}

.geo-select-separator {
  flex-shrink: 0;
  align-self: stretch;
  width: 0;
  margin: 0.15rem 0.65rem;
  border-left: 1px solid var(--map-border);
}

.geo-select-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  align-self: center;
}

.geo-select-field {
  display: inline-flex;
  flex-direction: column;
  gap: 0.1rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.geo-select-field input,
.geo-select-field select {
  width: 6.5rem;
  border: 1px solid var(--map-border);
  border-radius: 4px;
  padding: 0.15rem 0.35rem;
  font-size: 0.8rem;
  color: var(--text-primary);
  background: var(--surface-bg);
}

.geo-select-field-radius input {
  width: 4.5rem;
}

.geo-select-field-unit select {
  width: 3.5rem;
}

.geo-select-actions {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.35rem;
  flex-shrink: 0;
}

.geo-select-actions button {
  border: 1px solid var(--map-border);
  background: var(--surface-bg);
  color: var(--text-primary);
  border-radius: 4px;
  padding: 0.2rem 0.45rem;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
}

.geo-select-actions button:disabled {
  opacity: 0.45;
  cursor: default;
}

.geo-select-actions button:not(:disabled):hover {
  border-color: #2563eb;
  color: #2563eb;
}

.geo-select-field-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 0;
}

.geo-select-field-row input {
  flex: 1;
  min-width: 0;
}

.geo-select-geocode-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 1px solid var(--map-border);
  border-radius: 4px;
  background: var(--surface-bg);
  color: var(--text-primary);
  cursor: pointer;
}

.geo-select-geocode-btn:hover {
  border-color: #2563eb;
  color: #2563eb;
}

.geo-select-geocode-btn .map-toolbar-icon {
  width: 14px;
  height: 14px;
}

.find-address-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.25rem 0;
}

.find-address-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.find-address-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.find-address-actions button {
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--map-border);
  border-radius: 4px;
  background: var(--surface-bg);
  color: var(--text-primary);
  cursor: pointer;
}

.prompt-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.25rem 0;
}

.prompt-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.prompt-status {
  min-height: 1.1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.prompt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.prompt-actions button {
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--map-border);
  border-radius: 4px;
  background: var(--surface-bg);
  color: var(--text-primary);
  cursor: pointer;
}

.prompt-actions button:disabled {
  opacity: 0.55;
  cursor: default;
}

.find-address-actions button:first-child {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.expression-editor-popup .dx-popup-content {
  display: flex;
  flex-direction: column;
  padding: 12px 16px 10px;
}

.expression-editor {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
  min-height: 24rem;
  height: 100%;
  min-width: 0;
}

.expression-editor-expression {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 0 0 auto;
}

.expression-editor h3 {
  margin: 0;
  padding: 0.3rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.expression-editor-expression h3 {
  padding: 0;
}

.expression-editor-expression textarea {
  width: 100%;
  min-height: 7.25rem;
  resize: vertical;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--map-border);
  border-radius: 4px;
  background: var(--surface-bg);
  color: var(--text-primary);
  font-family: Consolas, 'Cascadia Mono', 'Courier New', monospace;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.expression-editor-expression textarea:focus {
  outline: 2px solid #2563eb;
  outline-offset: -1px;
}

.expression-editor-status {
  min-height: 1.15rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.expression-editor-status.is-ok {
  color: #15803d;
}

.expression-editor-status.is-error {
  color: #b00020;
}

html[data-theme='dark'] .expression-editor-status.is-ok {
  color: #86efac;
}

html[data-theme='dark'] .expression-editor-status.is-error {
  color: #ff8a80;
}

.expression-editor-pickers {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(150px, 0.75fr) minmax(96px, 0.42fr);
  gap: 0.5rem;
  flex: 1;
  min-height: 10.5rem;
}

.expression-editor-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border: 1px solid var(--map-border);
  border-radius: 4px;
  background: var(--surface-bg);
}

.expression-editor-panel h3 {
  border-bottom: 1px solid var(--map-border);
}

.expression-editor-panel-body {
  flex: 1;
  min-height: 0;
}

.expression-editor-panel-body .dx-treeview,
.expression-editor-panel-body .dx-list {
  height: 100%;
}

.expression-editor-panel-body .dx-treeview-item,
.expression-editor-panel-body .dx-list-item {
  font-size: 0.75rem;
}

.expression-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

.expression-editor-actions button {
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--map-border);
  border-radius: 4px;
  background: var(--surface-bg);
  color: var(--text-primary);
  font: inherit;
  cursor: pointer;
}

.expression-editor-actions button:disabled {
  opacity: 0.45;
  cursor: default;
}

#expression-editor-ok {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

#expression-editor-ok:disabled {
  border-color: var(--map-border);
  background: var(--surface-bg);
  color: var(--text-primary);
}

.map-pane-body > .gutter {
  flex-shrink: 0;
  background-color: var(--gutter-bg);
  background-repeat: no-repeat;
  background-position: 50%;
}

.map-pane-body > .gutter.gutter-horizontal {
  cursor: col-resize;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='6' height='30' viewBox='0 0 6 30'%3E%3Ccircle cx='3' cy='5' r='1.2' fill='%23a0a0a0'/%3E%3Ccircle cx='3' cy='15' r='1.2' fill='%23a0a0a0'/%3E%3Ccircle cx='3' cy='25' r='1.2' fill='%23a0a0a0'/%3E%3C/svg%3E");
}

.thematic-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--map-border);
  border-radius: 4px;
  background: var(--surface-bg);
  color: var(--text-primary);
}

.thematic-panel[hidden] {
  display: none !important;
}

.thematic-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  flex-shrink: 0;
  border-bottom: 1px solid var(--map-border);
}

.thematic-panel-header h3 {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--panel-heading);
}

.thematic-panel-close {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  cursor: pointer;
}

.thematic-panel-close:hover {
  background: var(--gutter-bg);
  color: var(--text-primary);
}

.thematic-panel-content {
  flex-shrink: 0;
  padding: 0.65rem;
}

.thematic-field {
  display: grid;
  grid-template-columns: 4.5rem minmax(0, 1fr);
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin-bottom: 0.55rem;
}

.thematic-field-ranges {
  align-items: start;
}

.thematic-field-ranges .thematic-field-label {
  padding-top: 0.35rem;
}

.thematic-field-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: right;
}

.thematic-field-control {
  min-width: 0;
}

.thematic-chart {
  flex: 1;
  min-height: 120px;
  padding: 0 0.65rem 0.65rem;
}

#report-map {
  flex: 1;
  min-height: 0;
  border: 1px solid var(--map-border);
  border-radius: 4px;
}

.leaflet-interactive:focus {
  outline: none;
}

.leaflet-tooltip.map-boundary-tooltip {
  font-size: 0.78rem;
  line-height: 1.4;
  white-space: pre-line !important;
  width: max-content;
  min-width: 6rem;
  max-width: 20rem;
}

.map-pane-host {
  position: relative;
}

.map-unavailable-overlay {
  position: absolute;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--surface-bg) 82%, transparent);
  pointer-events: none;
}

.map-unavailable-overlay[hidden] {
  display: none !important;
}

/* DevExtreme tooltips default to white-space: nowrap on .dx-popup-content — override with wrapper class. */
.dx-tooltip-wrapper.panel-hint-tooltip,
.dx-tooltip-wrapper.filter-hint-tooltip,
.dx-tooltip-wrapper.cell-dictionary-tooltip {
  pointer-events: none;
}

.dx-tooltip-wrapper.panel-hint-tooltip .dx-overlay-content {
  width: 26rem !important;
  max-width: 26rem !important;
  box-sizing: border-box;
  height: auto !important;
  max-height: none !important;
  line-height: normal;
  text-align: left;
}

.dx-tooltip-wrapper.filter-hint-tooltip .dx-overlay-content {
  width: 18rem !important;
  max-width: 18rem !important;
  box-sizing: border-box;
  height: auto !important;
  max-height: none !important;
  line-height: normal;
  text-align: left;
}

.dx-tooltip-wrapper.cell-dictionary-tooltip .dx-overlay-content {
  width: 18rem !important;
  max-width: 18rem !important;
  box-sizing: border-box;
  height: auto !important;
  max-height: none !important;
  line-height: normal;
  text-align: left;
}

.dx-tooltip-wrapper.panel-hint-tooltip .dx-overlay-content::before,
.dx-tooltip-wrapper.filter-hint-tooltip .dx-overlay-content::before,
.dx-tooltip-wrapper.cell-dictionary-tooltip .dx-overlay-content::before {
  display: none;
}

.dx-tooltip-wrapper.panel-hint-tooltip .dx-overlay-content .dx-popup-content,
.dx-tooltip-wrapper.filter-hint-tooltip .dx-overlay-content .dx-popup-content,
.dx-tooltip-wrapper.cell-dictionary-tooltip .dx-overlay-content .dx-popup-content {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  white-space: normal;
  overflow: hidden;
  height: auto !important;
  max-height: none !important;
}

.dx-tooltip-wrapper.panel-hint-tooltip .dx-popup-content > .dx-template-wrapper,
.dx-tooltip-wrapper.filter-hint-tooltip .dx-popup-content > .dx-template-wrapper,
.dx-tooltip-wrapper.cell-dictionary-tooltip .dx-popup-content > .dx-template-wrapper {
  display: block;
  width: 100%;
  height: auto;
  white-space: normal;
}

.panel-hint-content,
.filter-hint-content,
.cell-dictionary-content {
  display: block;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  text-align: left;
  white-space: normal;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

.panel-hint-content {
  line-height: 1.45;
  font-size: var(--compact-font-size);
}

.panel-hint-content p {
  margin: 0 0 0.65rem;
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

.panel-hint-content p:last-child {
  margin-bottom: 0;
}

.filter-hint-content,
.cell-dictionary-content {
  line-height: 1.4;
  font-size: var(--compact-font-size);
}

.fallback-page {
  min-height: 100vh;
  padding: 2rem;
  overflow: auto;
}

.fallback-root {
  max-width: 640px;
  margin: 0 auto;
}

.fallback-root h1 {
  margin: 0 0 1rem;
  font-size: 1.75rem;
}

.fallback-error {
  color: #666;
  line-height: 1.5;
}
