:root {
  --app-radius: 8px;
  --app-gap: 12px;
  --app-pad: 16px;
  --app-font: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  --app-widget-panel-min-width: 18rem;
  --app-widget-panel-width: min(20rem, calc(100vw - 48px));
  --app-widget-gallery-width: min(30rem, calc(100vw - 48px));
  --app-widget-panel-max-height: min(26rem, calc(100vh - 96px));
}

body {
  --app-bg: var(--calcite-color-background);
  --app-surface: var(--calcite-color-foreground-1);
  --app-surface-raised: var(--calcite-color-foreground-2);
  --app-border: var(--calcite-color-border-1);
  --app-border-subtle: var(--calcite-color-border-2);
  --app-text: var(--calcite-color-text-1);
  --app-text-muted: var(--calcite-color-text-2);
  --app-text-dim: var(--calcite-color-text-3);
  --app-muted: var(--app-text-muted);
  --app-accent: var(--calcite-color-brand);
  --app-scrollbar-muted-foreground: 218 11% 45%;
  --app-scrollbar-foreground: 222 47% 11%;
  --app-scrollbar-thumb: hsl(var(--app-scrollbar-muted-foreground) / 0.45);
  --app-scrollbar-thumb-hover: hsl(var(--app-scrollbar-foreground) / 0.35);
  --app-scrollbar-thumb-active: hsl(var(--app-scrollbar-foreground) / 0.45);
  /*
   * Categorical series, for charts whose colours tell groups apart. The first is the accent, so a
   * one-series chart and the app's controls agree; the rest are mid-tone hues that hold contrast on
   * both the light and the dark surface. "Other" is deliberately the quietest.
   */
  --app-series-1: var(--calcite-color-brand);
  --app-series-2: #e8912e;
  --app-series-3: #35ac46;
  --app-series-4: #8f5bd6;
  --app-series-5: #d9467a;
  --app-series-6: #1aa39a;
  --app-series-7: #c7a414;
  --app-series-8: #6c86b8;
  --app-series-other: var(--calcite-color-border-input);
}

body.calcite-mode-dark {
  --app-scrollbar-muted-foreground: 218 11% 65%;
  --app-scrollbar-foreground: 210 20% 98%;
}

/*
 * Accent overrides the brand token rather than sitting beside it, so a Calcite button and a chart
 * bar are the same colour. The old accent only reached the shell's own rules, which is why a coral
 * app still had Calcite-blue buttons. Selector is (0,1,1) so it wins over the mode class that
 * defines the default brand on this same element.
 */
:root[data-accent="coral"] body {
  --calcite-color-brand: #d83020;
  --calcite-color-brand-hover: #a82b1e;
  --calcite-color-brand-press: #7c1f16;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: var(--app-scrollbar-thumb) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 999px;
  box-shadow: none;
}

*::-webkit-scrollbar-corner {
  background: transparent;
  box-shadow: none;
}

*::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background-color: var(--app-scrollbar-thumb);
  background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
  background-color: var(--app-scrollbar-thumb-hover);
}

*::-webkit-scrollbar-thumb:active {
  background-color: var(--app-scrollbar-thumb-active);
}

/**
 * The shell hides its unused regions with the hidden attribute, and the region classes below set a
 * display value. Author styles beat the user-agent hidden rule regardless of specificity, so
 * without this a hidden region still lays out: an empty side region takes a row of the map's grid and
 * an empty footer draws a bordered strip.
 */
[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  flex-direction: column;
  background: var(--app-bg);
  color: var(--app-text);
  font-family: var(--app-font);
  font-size: 14px;
  line-height: 1.45;
}

h1,
h2,
p,
ul {
  margin: 0;
}

#app-title {
  font-size: 20px;
  font-weight: 600;
}

#app-subtitle {
  color: var(--app-text-muted);
}

#app-view {
  position: relative;
  min-height: 0;
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  overflow: hidden;
}

.region-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--app-text-muted);
}

.block {
  padding: var(--app-pad);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
}

.indicator-label {
  font-size: 12px;
  color: var(--app-text-muted);
}

.indicator-value {
  margin-top: 4px;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  color: var(--app-accent);
}

.indicator-meta {
  margin-top: 6px;
  font-size: 11px;
  color: var(--app-text-muted);
  word-break: break-word;
}

/* Accent is reserved for a live value; an observed snapshot reads as ordinary text. */
.block-indicator[data-state="observed"] .indicator-value,
.block-indicator[data-state="observed-stale"] .indicator-value {
  color: var(--app-text);
}

.block-indicator[data-state="unavailable"] .indicator-value {
  color: var(--app-text-muted);
}

.category-bars {
  margin-top: var(--app-gap);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.category-row {
  display: grid;
  grid-template-columns: minmax(0, 6.5rem) minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.category-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--app-text-muted);
}

.category-track {
  height: 8px;
  border-radius: 999px;
  background: var(--app-border);
  overflow: hidden;
}

.category-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--app-accent);
}

/* Donut */
.category-donut {
  margin-top: var(--app-gap);
  display: flex;
  align-items: center;
  gap: 16px;
}

.category-donut-ring {
  position: relative;
  width: 120px;
  height: 120px;
  flex: none;
}

.category-donut-ring svg {
  display: block;
}

.category-donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.category-donut-total {
  font-size: 21px;
  font-weight: 650;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  color: var(--app-text);
}

.category-donut-cap {
  margin-top: 2px;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--app-text-muted);
}

.category-donut-legend {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.category-legend-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.category-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.category-legend-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--app-text-muted);
}

.category-legend-pct {
  font-variant-numeric: tabular-nums;
  color: var(--app-text);
}

.category-value {
  font-variant-numeric: tabular-nums;
  color: var(--app-text);
}

.block-category-chart[data-state="unavailable"] .category-fill {
  background: var(--app-text-muted);
}

/* Gauge */
.gauge-dial {
  position: relative;
  margin-top: var(--app-gap);
  width: 120px;
  height: 120px;
}

.gauge-dial svg {
  display: block;
}

.gauge-readout {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.gauge-value {
  font-size: 21px;
  font-weight: 650;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  color: var(--app-accent);
}

.gauge-range {
  margin-top: 2px;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--app-text-muted);
  font-variant-numeric: tabular-nums;
}

.block-gauge[data-state="observed"] .gauge-value,
.block-gauge[data-state="observed-stale"] .gauge-value {
  color: var(--app-text);
}

.block-gauge[data-state="unavailable"] .gauge-value {
  color: var(--app-text-muted);
}

/* List */
.list-rows {
  margin-top: var(--app-gap);
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.list-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--app-border);
  font-size: 12px;
}

.list-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.list-row-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--app-text);
}

.list-row-subtitle {
  flex: none;
  color: var(--app-text-muted);
  font-variant-numeric: tabular-nums;
}

/* Table. A slot has a fixed width, so the table scrolls inside its own card rather than
   widening the panel and pushing the map out of the layout. */
.table-scroll {
  margin-top: var(--app-gap);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th,
.data-table td {
  padding: 5px 8px 5px 0;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--app-border);
}

.data-table th {
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--app-text-muted);
}

.data-table td {
  color: var(--app-text);
  font-variant-numeric: tabular-nums;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* Stack: a row or column of elements inside one slot. Its children keep their own card borders,
   so the stack itself draws nothing — it only decides the axis. */
.block-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.block-stack-title {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--app-text-muted);
}

.block-stack-body {
  display: flex;
  gap: var(--app-gap);
  min-width: 0;
}

.block-stack[data-direction="row"] > .block-stack-body {
  flex-direction: row;
}

.block-stack[data-direction="row"] > .block-stack-body > .block {
  flex: 1 1 0;
  min-width: 0;
}

.block-stack[data-direction="column"] > .block-stack-body {
  flex-direction: column;
}

.block-text {
  color: var(--app-text);
  white-space: pre-wrap;
}

/* Markdown output. A markdown block builds its own paragraphs, so it must not also inherit the
   pre-wrap that keeps a plain block's newlines. */
.block-text:has(.text-paragraph),
.block-text:has(.text-list) {
  white-space: normal;
}

.text-paragraph + .text-paragraph,
.text-paragraph + .text-list,
.text-list + .text-paragraph {
  margin-top: 8px;
}

.text-list {
  padding-left: 18px;
}

.block-text code {
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--app-bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
}

.block-text a {
  color: var(--app-accent);
}

#app-error {
  margin: var(--app-pad);
  padding: var(--app-pad);
  border: 1px solid var(--app-accent);
  border-radius: var(--app-radius);
  background: var(--app-surface);
}


.app-header {
  display: flex;
  align-items: center;
  gap: var(--app-gap);
  padding: clamp(8px, 1.8dvh, 14px) 24px;
  border-bottom: 1px solid var(--app-border);
  background: var(--app-surface);
}

.app-identity { min-width: 0; flex: 1 1 auto; }
.app-header:has(> .app-region-header:not([hidden])) .app-identity {
  flex: 0 1 auto;
  max-width: 42%;
}
.app-main {
  display: grid;
  grid-template-areas: "view";
  grid-template-columns: minmax(0, 1fr);
  gap: var(--app-gap);
  flex: 1;
  min-width: 0;
  min-height: 0;
  padding: var(--app-gap);
  overflow-x: clip;
}
.app-main:has(> .app-region-left:not([hidden])) {
  grid-template-areas: "left view";
  grid-template-columns: minmax(0, min(var(--app-left-region-width, 20rem), 30%)) minmax(0, 1fr);
}
.app-main:has(> .app-region-right:not([hidden])) {
  grid-template-areas: "view right";
  grid-template-columns: minmax(0, 1fr) minmax(0, min(var(--app-right-region-width, 20rem), 30%));
}
.app-main:has(> .app-region-left:not([hidden]) + #app-view + .app-region-right:not([hidden])) {
  grid-template-areas: "left view right";
  grid-template-columns: minmax(0, min(var(--app-left-region-width, 20rem), 25%)) minmax(0, 1fr) minmax(0, min(var(--app-right-region-width, 20rem), 25%));
}
.app-region {
  min-width: 0;
  color: var(--app-text);
}
.app-region-left, .app-region-right {
  display: flex;
  flex-direction: column;
  gap: var(--app-gap);
  overflow-x: hidden;
  overflow-y: auto;
}
.app-region-left { grid-area: left; }
.app-region-right { grid-area: right; }
#app-view {
  grid-area: view;
  width: 100%;
  height: 100%;
}
.app-region-header {
  display: flex;
  flex: 1;
  align-items: center;
  gap: var(--app-gap);
}
.app-region-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: var(--app-gap);
  padding: 12px 24px;
  border-top: 1px solid var(--app-border);
  background: var(--app-surface);
}
.app-region-title, .app-block-title {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.25;
  display: flex;
  align-items: center;
  gap: 6px;
}

/*
 * A title icon is a label, not a control: it takes the muted text colour so it reads as part of the
 * heading rather than competing with the value below it, and it never shrinks when the title wraps.
 */
.app-block-title > .app-icon, .app-region-title > .app-icon {
  flex: none;
  color: var(--app-text-muted);
}

.app-block-title-text { min-width: 0; }
/*
 * A block is a calcite-card, which already pads its content and draws its own edge. The shell keeps
 * one edge — its own, in the shell's radius — and turns the card's off, or every block reads as a
 * box inside a box.
 */
.app-block {
  display: block;
  padding: 0;
  border: 1px solid var(--app-border);
  border-radius: 6px;
  background: var(--app-surface);
  --calcite-card-border-color: transparent;
  --calcite-card-background-color: transparent;
  --calcite-card-shadow: none;
  animation: app-rise 360ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.app-block-value { margin: 6px 0 0; font-size: 1.75rem; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.app-block-unit, .app-block-description, .app-block-trend { margin-left: 6px; color: var(--app-muted); font-size: 0.85rem; }
.app-block-unit { font-weight: 400; }
.app-block-description, .app-block-trend { margin: 6px 0 0; }
.app-block-empty { margin: 10px 0 0; color: var(--app-muted); font-size: 0.85rem; }

/*
 * A card is measured before it is drawn. Until the first read lands the slot shimmers at roughly the
 * height its content will take, and the "Reading…" line stays out of the way; the status line only
 * speaks when it has something to say — a stale value or one that could not be read.
 */
.app-block-live[data-state="pending"] {
  min-height: 2.75rem;
  margin-top: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--app-border-subtle) 25%, var(--app-surface-raised) 50%, var(--app-border-subtle) 75%);
  background-size: 200% 100%;
  animation: app-shimmer 1.2s linear infinite;
}
.app-block-live-status { margin: 8px 0 0; font-size: 0.75rem; color: var(--app-text-dim); }
.app-block-live[data-state="pending"] + .app-block-live-status,
.app-block-live[data-state="live"] + .app-block-live-status { display: none; }
.app-block-live[data-state="stale"] + .app-block-live-status { color: var(--calcite-color-status-warning); }
.app-block-live[data-state="unavailable"] + .app-block-live-status { color: var(--calcite-color-status-danger); }
.app-block:has(> .app-block-live[data-filtered]) > .app-block-title::after {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  margin-left: auto;
  border-radius: 50%;
  background: var(--app-accent);
}

.app-block-value-row { display: flex; align-items: center; gap: 14px; }
.app-block-value-text { min-width: 0; }
.app-gauge { position: relative; flex: none; width: 64px; height: 64px; margin-top: 6px; }
.app-gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.app-gauge circle { fill: none; stroke-width: 6; }
.app-gauge-track { stroke: var(--app-border-subtle); }
.app-gauge-arc { stroke: var(--app-accent); stroke-linecap: round; transition: stroke-dashoffset 900ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.app-gauge[data-met="true"] .app-gauge-arc { stroke: var(--calcite-color-status-success); }
.app-gauge-percent { position: absolute; inset: 0; display: grid; place-items: center; font-size: 0.75rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.app-block-list { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.app-block-list-item { display: grid; gap: 2px; }
.app-block-list-item span { color: var(--app-muted); font-size: 0.85rem; }
.app-md-table-wrap { max-width: 100%; margin-top: 10px; overflow-x: auto; }
.app-block-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.app-block-table th, .app-block-table td { padding: 6px; border-bottom: 1px solid var(--app-border); text-align: left; }
.app-block-table th { color: var(--app-muted); font-weight: 600; }

.app-block-chart { display: grid; gap: 6px; margin-top: 12px; }
.app-block-chart-row, .app-donut-row {
  display: grid;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 3px 4px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: opacity 200ms ease, background-color 150ms ease;
}
.app-block-chart-row { grid-template-columns: minmax(72px, 1.3fr) minmax(32px, 1.7fr) auto; }
.app-block-chart-row:hover:not([disabled]), .app-donut-row:hover:not([disabled]) { background: var(--app-surface-raised); }
.app-block-chart-row:focus-visible, .app-donut-row:focus-visible { outline: 2px solid var(--app-accent); outline-offset: 1px; }
.app-block-chart-row[disabled], .app-donut-row[disabled] { cursor: default; }
[data-has-selection] > .app-block-chart-row:not([data-selected]),
[data-has-selection] .app-donut-row:not([data-selected]) { opacity: 0.4; }
.app-block-chart-track { display: block; height: 8px; border-radius: 999px; background: var(--app-border-subtle); overflow: hidden; }
.app-block-chart-bar { display: block; height: 100%; border-radius: inherit; background: var(--app-accent); transition: width 700ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.app-block-chart-label, .app-block-chart-value { min-width: 0; overflow: hidden; font-size: 0.8rem; color: var(--app-muted); text-overflow: ellipsis; white-space: nowrap; }
.app-block-chart-value { color: var(--app-text); font-variant-numeric: tabular-nums; }

.app-block-donut { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 12px; }
.app-donut-figure { position: relative; flex: none; width: 128px; height: 128px; }
.app-donut-figure svg { width: 100%; height: 100%; }
.app-donut-figure circle { fill: none; stroke-width: 5.2; }
.app-donut-track { stroke: var(--app-border-subtle); }
.app-donut-slice { transition: stroke-dasharray 800ms cubic-bezier(0.2, 0.8, 0.2, 1), stroke-dashoffset 800ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 200ms ease; }
[data-has-selection] .app-donut-slice:not([data-selected]) { opacity: 0.3; }
.app-donut-slice[data-selectable] { cursor: pointer; }
.app-donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.app-donut-total { font-size: 1.2rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.app-donut-caption { font-size: 0.7rem; color: var(--app-muted); }
.app-donut-legend { display: grid; flex: 1 1 9rem; gap: 2px; min-width: 0; }
.app-donut-row { grid-template-columns: 10px minmax(0, 1fr) auto; font-size: 0.8rem; }
.app-donut-swatch { width: 10px; height: 10px; border-radius: 2px; }
.app-donut-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-donut-share { color: var(--app-muted); font-variant-numeric: tabular-nums; }

.app-trend { margin-top: 6px; }
.app-trend-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.app-trend-latest { margin: 0; }
.app-trend-delta {
  padding: 1px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--app-accent) 14%, transparent);
  color: var(--app-accent);
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.app-trend-delta[data-direction="up"]::before { content: "▲ "; font-size: 0.6rem; }
.app-trend-delta[data-direction="down"]::before { content: "▼ "; font-size: 0.6rem; }
.app-trend-latest-label { font-size: 0.75rem; color: var(--app-muted); }
.app-trend-plot { position: relative; height: 88px; margin-top: 8px; }
.app-trend-plot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.app-trend-line { fill: none; stroke: var(--app-accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; transition: d 800ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.app-trend-area { fill: color-mix(in srgb, var(--app-accent) 16%, transparent); stroke: none; transition: d 800ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.app-trend-hits { position: absolute; inset: 0; display: flex; }
.app-trend-hit { flex: 1; border-radius: 2px; }
.app-trend-hit:hover { background: color-mix(in srgb, var(--app-accent) 10%, transparent); }
.app-trend-axis { display: flex; justify-content: space-between; margin-top: 4px; font-size: 0.7rem; color: var(--app-muted); }

.app-block-selector .app-block-live { margin-top: 10px; }
.app-selector-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.app-selector-select, .app-selector-range { display: block; width: 100%; }

.app-md { display: grid; gap: 8px; }
.app-md-heading { margin: 4px 0 0; font-size: 0.95rem; font-weight: 600; }
.app-md-h1 { font-size: 1.05rem; }
.app-md-list { margin: 0; padding-left: 1.25rem; display: grid; gap: 4px; }
.app-md code { padding: 0 4px; border-radius: 3px; background: var(--app-surface-raised); font-size: 0.85em; }
.app-md a { color: var(--app-accent); }
.app-block-report .app-md, .app-block-text .app-md { margin-top: 6px; }
.app-block-text > .app-md:first-child { margin-top: 0; }

.app-region-body { display: contents; }
.app-region-left > .app-region-body, .app-region-right > .app-region-body { display: flex; flex-direction: column; gap: var(--app-gap); }
.app-region-header > .app-region-body { display: flex; flex: 1; align-items: stretch; gap: var(--app-gap); }
.app-region-header > .app-region-body > .app-block { flex: 1 1 0; min-width: 8.5rem; }
.app-region-header .app-block-value { margin-top: 2px; font-size: 1.35rem; }
.app-region-header .app-block-description, .app-region-header .app-block-live-status { display: none; }
.app-region-footer > .app-region-body { display: flex; flex: 1; flex-wrap: wrap; gap: var(--app-gap); }
.app-region-footer > .app-region-body > .app-block { flex: 1 1 16rem; min-width: 0; }
.app-region-fold { margin-left: auto; }
.app-main { transition: grid-template-columns 240ms ease; }
.app-region[data-collapsed] { overflow: hidden; }
.app-region[data-collapsed] > .app-region-body { display: none; }
.app-region[data-collapsed] > .app-region-title { flex-direction: column-reverse; align-items: center; }
.app-region[data-collapsed] .app-region-fold { margin-left: 0; }
.app-region[data-collapsed] .app-region-title-text { writing-mode: vertical-rl; white-space: nowrap; }
.app-region-left[data-collapsed] .app-region-title-text { transform: rotate(180deg); }

.app-enter { animation: app-rise 420ms cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--app-enter-index, 0) * 40ms); }
@keyframes app-rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes app-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) {
  .app-block, .app-enter, .app-block-live[data-state="pending"] { animation: none; }
  .app-main, .app-gauge-arc, .app-block-chart-bar, .app-donut-slice, .app-trend-line, .app-trend-area { transition: none; }
}

/* The Preview iframe follows the Nova canvas; rearrange authored regions when that canvas narrows. */
@media (max-width: 900px) {
  .app-header {
    align-items: stretch;
    flex-wrap: wrap;
    padding-inline: var(--app-gap);
  }
  .app-header:has(> .app-region-header:not([hidden])) .app-identity {
    flex-basis: 100%;
    max-width: none;
  }
  .app-region-header {
    width: 100% !important;
    height: auto !important;
    max-height: min(14rem, 36dvh);
    flex-basis: 100%;
    flex-wrap: wrap;
    overflow-y: auto;
  }
  .app-region-header > .app-region-body {
    flex-wrap: wrap;
  }
  .app-region-header > .app-region-body > .app-block {
    flex-basis: 12rem;
    min-width: 0;
  }
  .app-main,
  .app-main:has(> .app-region-left:not([hidden])),
  .app-main:has(> .app-region-right:not([hidden])) {
    grid-template-areas: "view" "left" "right";
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(10rem, 1fr) auto auto;
    padding: 8px;
  }
  .app-main:has(> .app-region-left:not([hidden]) + #app-view + .app-region-right:not([hidden])) {
    grid-template-areas: "view view" "left right";
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: minmax(10rem, 1fr) auto;
  }
  .app-region-left,
  .app-region-right {
    width: 100%;
    height: auto !important;
    max-height: min(12rem, 32dvh);
  }
  .app-region-footer {
    width: 100% !important;
    height: auto !important;
    max-height: min(12rem, 32dvh);
    overflow-y: auto;
    padding-inline: var(--app-gap);
  }
}

@media (max-width: 480px) {
  .app-region-header > .app-region-body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }
  .app-main:has(> .app-region-left:not([hidden]) + #app-view + .app-region-right:not([hidden])) {
    grid-template-areas: "view" "left" "right";
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(8rem, 1fr) auto auto;
  }
  .app-region-left,
  .app-region-right,
  .app-region-footer {
    max-height: min(10rem, 26dvh);
  }
}
.app-code-mount {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 1px;
  overflow-x: auto;
}
.app-code-mount > * { max-width: 100%; }
[hidden] { display: none !important; }

.app-native-map-contents {
  position: absolute;
  inset-block: 24px 54px;
  inset-inline-end: 72px;
  display: block;
  inline-size: min(321px, calc(100vw - 96px));
  max-inline-size: calc(100vw - 96px);
  block-size: auto;
  max-block-size: none;
  overflow: hidden;
  border: 1px solid #ebebeb;
  background: #ffffff;
  box-shadow: none;
}

.app-native-map-contents-host {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
}

.app-native-map-contents-host > * { pointer-events: auto; }

.app-native-map-navigation {
  --app-native-map-control-surface: #fcfcfc;
  --app-native-map-control-icon: #4a4a4a;
  --app-native-map-control-icon-hover: rgb(249 134 49);
  --app-native-map-control-icon-pressed: rgb(206 87 0);
  --app-native-map-control-divider: #dadada;
  --app-native-map-control-shadow: 0 2px 4px -1px rgb(0 0 0 / 4%), 0 4px 8px -1px rgb(0 0 0 / 8%);

  position: absolute;
  inset-inline-end: 24px;
  inset-block-end: 54px;
  display: flex;
  inline-size: 40px;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.app-native-map-navigation .app-native-map-toggle,
.app-native-map-navigation .app-native-map-navigation-button {
  appearance: none;
  display: grid;
  inline-size: 40px;
  block-size: 40px;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border: 0;
  border-radius: 2px;
  color: var(--app-native-map-control-icon);
  background: var(--app-native-map-control-surface);
  box-shadow: var(--app-native-map-control-shadow);
  cursor: pointer;
  transition: color 150ms ease;
}

.app-native-map-navigation .app-native-map-toggle:hover,
.app-native-map-navigation .app-native-map-navigation-button:hover {
  color: var(--app-native-map-control-icon-hover);
}

.app-native-map-navigation .app-native-map-toggle:active,
.app-native-map-navigation .app-native-map-navigation-button:active {
  color: var(--app-native-map-control-icon-pressed);
}

.app-native-map-navigation .app-native-map-toggle:focus-visible,
.app-native-map-navigation .app-native-map-navigation-button:focus-visible {
  outline: 2px solid var(--app-native-map-control-icon-hover);
  outline-offset: 2px;
}

.app-native-map-zoom {
  position: relative;
  display: flex;
  inline-size: 40px;
  block-size: 80px;
  flex-direction: column;
  overflow: hidden;
  border-radius: 2px;
  box-shadow: var(--app-native-map-control-shadow);
}

.app-native-map-zoom::after {
  position: absolute;
  inset-block-start: calc(50% - 0.5px);
  inset-inline-start: 8px;
  inline-size: 24px;
  block-size: 1px;
  background: var(--app-native-map-control-divider);
  content: '';
  pointer-events: none;
}

.app-native-map-zoom .app-native-map-navigation-button {
  box-shadow: none;
}

.app-native-map-zoom-in { border-radius: 2px 2px 0 0; }
.app-native-map-zoom-out { border-radius: 0 0 2px 2px; }

.app-native-map-navigation .app-native-map-compass {
  inline-size: 48px;
  block-size: 48px;
  border-radius: 50%;
}

.app-native-map-navigation-proxy { display: none; }

.app-native-map-contents-slider {
  display: flex;
  inline-size: 200%;
  block-size: 100%;
  transition: transform 300ms ease-out;
}

.app-native-map-contents-slider[data-view='basemap'] { transform: translateX(-50%); }

/* Map presentation owns the full Electron viewport; the app shell gutter is App-mode-only. */
body.app-map-presentation .app-main {
  gap: 0;
  padding: 0;
  transition: none;
}

body.app-map-presentation #app-view {
  min-inline-size: 0;
  min-block-size: 0;
  inline-size: 100%;
  block-size: 100%;
  border: 0;
  border-radius: 0;
}

body.app-map-presentation #app-view .esri-view-root,
body.app-map-presentation #app-view .esri-view-surface {
  border-radius: 0;
}

body.app-map-presentation #app-view .esri-view-surface:focus,
body.app-map-presentation #app-view .esri-view-surface:focus::after {
  outline: none;
}

/* Map presentation follows the Figma canvas spacing for the SDK's built-in navigation controls. */
body.app-map-presentation #app-view .esri-ui-top-left,
body.app-map-presentation #app-view .esri-ui-top-right { inset-block-start: 24px; }
body.app-map-presentation #app-view .esri-ui-top-left { inset-inline-start: 24px; }
body.app-map-presentation #app-view .esri-ui-top-right { inset-inline-end: 24px; }
body.app-map-presentation #app-view .esri-ui-bottom-left { inset-block-end: 54px; }
body.app-map-presentation #app-view .esri-ui-bottom-right { inset-block-end: 54px; }
body.app-map-presentation #app-view .esri-ui-bottom-left { inset-inline-start: 24px; }
body.app-map-presentation #app-view .esri-ui-bottom-right { inset-inline-end: 24px; }

body.app-map-presentation #app-view .esri-component {
  border: 1px solid var(--app-border);
  border-radius: 4px;
  box-shadow: var(--calcite-shadow-sm);
}

.app-native-map-page {
  display: flex;
  flex: 0 0 50%;
  min-inline-size: 0;
  block-size: 100%;
  flex-direction: column;
  overflow: hidden;
  background: var(--app-surface);
}

.app-native-map-header {
  display: flex;
  min-block-size: 51px;
  align-items: center;
  padding: 0 4px 0 12px;
  border-bottom: 1px solid var(--app-border);
}

.app-native-map-header h2 {
  min-inline-size: 0;
  flex: 1;
  margin: 0;
  overflow: hidden;
  color: var(--app-text);
  font-family: var(--app-font);
  font-size: 16px;
  font-weight: 500;
  line-height: 22px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-native-icon-button {
  display: inline-flex;
  inline-size: 32px;
  block-size: 32px;
  flex: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 3px;
  color: var(--app-text-dim);
  background: transparent;
  cursor: pointer;
}

.app-native-icon-button:hover { color: var(--app-accent); }
.app-native-icon-button:disabled { cursor: not-allowed; opacity: 0.4; }

.app-native-map-page-body {
  display: flex;
  min-block-size: 0;
  flex: 1;
  flex-direction: column;
  padding-top: 10px;
}

.app-native-active-basemap {
  display: flex;
  block-size: 75px;
  flex: none;
  margin: 0 10px 10px;
  padding: 1px;
  overflow: hidden;
  border: 1px solid var(--app-border);
  color: var(--app-text);
  background: var(--app-surface);
  cursor: pointer;
  text-align: start;
}

.app-native-basemap-preview {
  display: flex;
  inline-size: 110px;
  block-size: 100%;
  flex: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--app-text-muted);
  background: var(--app-surface-raised);
}

.app-native-basemap-preview img { inline-size: 100%; block-size: 100%; object-fit: cover; }

.app-native-active-basemap-label {
  display: flex;
  min-inline-size: 0;
  flex: 1;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  font-family: var(--app-font);
  font-size: 14px;
  font-weight: 500;
  line-height: 19.25px;
}

.app-native-active-basemap-label span {
  min-inline-size: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-native-active-basemap:hover .app-native-active-basemap-label { background: var(--app-surface-raised); }

.app-native-layer-heading {
  display: flex;
  min-block-size: 32px;
  align-items: center;
  padding: 0 10px 0 20px;
  color: var(--app-text);
  font-size: 14px;
  font-weight: 500;
}

.app-native-layer-heading > span { min-inline-size: 0; flex: 1; }

.app-native-layer-tree {
  min-block-size: 0;
  flex: 1;
  margin-inline: 10px;
  overflow: auto;
}

.app-native-layer-node { position: relative; }

.app-native-layer-row {
  position: relative;
  display: flex;
  min-block-size: 24px;
  align-items: center;
  gap: 4px;
  padding-inline: calc(var(--layer-depth) * 20px) 0;
  color: var(--app-text);
  background: var(--app-surface);
}

.app-native-layer-row:hover { background: var(--app-surface-raised); }
.app-native-layer-row.is-dragging { opacity: 0.55; }
.app-native-layer-row.is-drag-over { box-shadow: inset 0 2px 0 var(--app-accent); }
.app-native-layer-disclosure { inline-size: 24px; block-size: 24px; }
.app-native-layer-visibility { inline-size: 24px; block-size: 24px; }
.app-native-layer-glyph { flex: none; }

.app-native-layer-label {
  min-inline-size: 0;
  flex: 1;
  overflow: hidden;
  color: var(--app-text);
  font-size: 12px;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-native-layer-legend {
  position: relative;
  display: grid;
  padding-left: calc((var(--layer-depth) + 1) * 20px + 20px);
  color: var(--app-text);
  background: var(--app-surface);
}

.app-native-layer-legend::before {
  position: absolute;
  inset-block: 0;
  inset-inline-start: calc((var(--layer-depth) + 1) * 20px + 10px);
  inline-size: 1px;
  background: var(--app-border);
  content: '';
}

.app-native-legend-row {
  display: flex;
  min-block-size: 24px;
  align-items: center;
  gap: 8px;
}

.app-native-legend-swatch {
  display: flex;
  inline-size: 16px;
  block-size: 16px;
  flex: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.app-native-legend-label {
  min-inline-size: 0;
  overflow: hidden;
  color: var(--app-text);
  font-size: 12px;
  line-height: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-native-legend-loading {
  display: flex;
  min-block-size: 24px;
  align-items: center;
  padding-left: calc((var(--layer-depth) + 1) * 20px + 20px);
}

.app-native-layer-menu-trigger { inline-size: 24px; block-size: 24px; }

.app-native-layer-menu {
  position: absolute;
  z-index: 3;
  inset-block-start: calc(100% - 2px);
  inset-inline-end: 0;
  display: grid;
  inline-size: 208px;
  padding: 4px;
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  box-shadow: var(--calcite-shadow-sm);
}

.app-native-layer-menu-item {
  display: flex;
  min-block-size: 32px;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border: 0;
  color: var(--app-text);
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: start;
}

.app-native-layer-menu-item:hover { background: var(--app-surface-raised); }
.app-native-layer-menu-item.is-danger { color: var(--calcite-color-status-danger); }

.app-native-basemap-empty {
  display: flex;
  min-block-size: 140px;
  align-items: center;
  justify-content: center;
  color: var(--app-text-dim);
  font-size: 13px;
}

.app-native-layer-empty {
  display: flex;
  min-block-size: 140px;
  align-items: center;
  justify-content: center;
}

.app-native-layer-empty-image {
  display: block;
  inline-size: 140px;
  block-size: 140px;
  flex: none;
  object-fit: contain;
}

.app-native-layer-empty-image--dark { display: none; }
html[data-theme='dark'] .app-native-layer-empty-image--light { display: none; }
html[data-theme='dark'] .app-native-layer-empty-image--dark { display: block; }

.app-native-map-search {
  display: flex;
  min-block-size: 32px;
  flex: none;
  align-items: center;
  gap: 12px;
  margin: 0 10px 10px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--app-text);
  background: var(--app-surface);
}

.app-native-map-search:focus-within { border-color: var(--app-border); }
.app-native-map-search input { min-inline-size: 0; inline-size: 100%; border: 0; outline: 0; color: var(--app-text); background: transparent; font: inherit; font-size: 14px; line-height: 16px; }
.app-native-map-search input::placeholder { color: var(--app-text); opacity: 0.5; }

.app-native-basemap-body { display: flex; min-block-size: 0; flex: 1; flex-direction: column; padding-top: 16px; }
.app-native-terrain-row { display: flex; min-block-size: 40px; align-items: center; gap: 12px; padding: 0 12px 8px; color: var(--app-text); font-size: 14px; font-weight: 500; }
.app-native-terrain-row > span { min-inline-size: 0; flex: 1; }
.app-native-terrain-row calcite-switch { --calcite-color-brand: var(--app-accent); }
.app-native-basemap-body .app-native-map-search { margin-inline: 12px; border-color: var(--app-border); }
.app-native-basemap-list { display: grid; min-block-size: 0; flex: 1; grid-auto-rows: 94px; align-content: start; gap: 8px; margin-top: 2px; padding: 0 12px 12px; overflow-y: auto; }

.app-native-basemap-card {
  display: flex;
  block-size: 94px;
  min-block-size: 94px;
  align-items: center;
  padding: 0;
  border: 1px solid var(--app-border);
  color: var(--app-text);
  background: var(--app-surface);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  text-align: start;
}

.app-native-basemap-card:hover { background: var(--app-surface-raised); }
.app-native-basemap-card .app-native-basemap-preview { inline-size: 138px; }
.app-native-basemap-card > span:last-child { min-inline-size: 0; padding: 12px; overflow-wrap: anywhere; }

.app-native-basemap-skeleton {
  block-size: 94px;
  border: 1px solid var(--app-border);
  background: linear-gradient(90deg, var(--app-surface-raised), var(--app-surface), var(--app-surface-raised));
  background-size: 200% 100%;
  animation: app-native-basemap-loading 1.2s linear infinite;
}

@keyframes app-native-basemap-loading { to { background-position: -200% 0; } }

.geo-view-selection-dial {
  --geo-view-selection-dial-foreground: rgb(20 20 20);
  --geo-view-selection-dial-card: rgb(255 255 255);
  --geo-view-selection-dial-primary: rgb(249 134 49);
  --geo-view-selection-dial-primary-hover: rgb(244 136 65);
  --geo-view-selection-dial-border: rgb(222 222 222);
  --geo-view-selection-dial-action-hover: rgb(242 242 242);
  position: absolute;
  inset: 0;
  z-index: 20;
  overflow: hidden;
  pointer-events: auto;
}

.geo-view-selection-dial__positioner {
  position: absolute;
  inset: 0 auto auto 0;
  z-index: 2;
  inline-size: 0;
  block-size: 0;
  pointer-events: none;
}

.geo-view-selection-dial__status {
  position: absolute;
  inset: 12px 12px auto;
  margin: 0;
  padding: 8px 12px;
  color: var(--geo-view-selection-dial-foreground);
  background: var(--geo-view-selection-dial-card);
  border: 1px solid var(--geo-view-selection-dial-border);
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  pointer-events: none;
}

.geo-view-selection-dial__wheel {
  position: absolute;
  inline-size: 0;
  block-size: 0;
  transform-origin: 0 0;
  animation: geo-view-selection-dial-enter 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
  pointer-events: none;
}

.geo-view-selection-dial__location-point {
  position: absolute;
  z-index: 1;
  inline-size: 10px;
  block-size: 10px;
  transform: translate(-50%, -50%);
  border: 2px solid white;
  border-radius: 50%;
  background: var(--geo-view-selection-dial-primary);
  box-shadow: 0 2px 5px rgb(0 0 0 / 0.28);
  pointer-events: none;
}

@keyframes geo-view-selection-dial-enter {
  from { opacity: 0; transform: rotate(-55deg) scale(0.96); }
  to { opacity: 1; transform: rotate(0deg) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .geo-view-selection-dial__wheel { animation: none; }
}

.geo-view-selection-dial__menu-background {
  position: absolute;
  z-index: 0;
  inline-size: 170px;
  block-size: 170px;
  transform: translate(-50%, -50%);
  max-inline-size: none;
  backface-visibility: hidden;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.geo-view-selection-dial__menu-background-line {
  position: absolute;
  z-index: 1;
  inline-size: 170px;
  block-size: 170px;
  max-inline-size: none;
  transform: translate(-50%, -50%);
  backface-visibility: hidden;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.geo-view-selection-dial__close,
.geo-view-selection-dial__action {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--geo-view-selection-dial-foreground);
  box-shadow: none;
  cursor: pointer;
  pointer-events: auto;
}

.geo-view-selection-dial__close {
  inline-size: 40px;
  block-size: 40px;
  color: var(--geo-view-selection-dial-primary);
}

.geo-view-selection-dial__close::before {
  position: absolute;
  inset: 4px;
  border: 2px solid var(--geo-view-selection-dial-primary);
  border-radius: inherit;
  background: var(--geo-view-selection-dial-card);
  content: '';
}

.geo-view-selection-dial__close > * {
  position: relative;
  z-index: 1;
}

.geo-view-selection-dial__action {
  inline-size: 56px;
  block-size: 56px;
  flex-direction: column;
  gap: 2px;
  font: inherit;
  font-size: 12px;
  isolation: isolate;
  overflow: visible;
}

.geo-view-selection-dial__action::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  box-sizing: border-box;
  border: 1px solid var(--geo-view-selection-dial-border);
  border-radius: 50%;
  background: var(--geo-view-selection-dial-card);
  box-shadow: 0 4px 4px rgb(0 0 0 / 0.08), 0 2px 2px rgb(0 0 0 / 0.04);
  content: '';
}

.geo-view-selection-dial__action:hover:not(:disabled),
.geo-view-selection-dial__action:focus-visible:not(:disabled) {
  background: transparent;
}

.geo-view-selection-dial__action:hover:not(:disabled)::before,
.geo-view-selection-dial__action:focus-visible:not(:disabled)::before {
  background: var(--geo-view-selection-dial-action-hover);
}

.geo-view-selection-dial__action--agentic {
  color: var(--geo-view-selection-dial-foreground);
}

.geo-view-selection-dial__action--agentic:hover:not(:disabled),
.geo-view-selection-dial__action--agentic:focus-visible:not(:disabled) {
  color: var(--geo-view-selection-dial-foreground);
}

.geo-view-selection-dial__suggest-hover-effect,
.geo-view-selection-dial__suggest-thinking-effect {
  position: absolute;
  inset: 50% auto auto 50%;
  max-inline-size: none;
  transform: translate3d(-50%, -50%, 0);
  backface-visibility: hidden;
  pointer-events: none;
  user-select: none;
}

.geo-view-selection-dial__suggest-hover-effect {
  z-index: 1;
  inline-size: 89px;
  block-size: 89px;
  border-radius: 50%;
  clip-path: circle(30px at center);
  object-fit: contain;
  opacity: 0;
  transition: opacity 150ms ease;
}

.geo-view-selection-dial__action--agentic:is(:hover, :focus-visible):not(:disabled)
  .geo-view-selection-dial__suggest-hover-effect,
.geo-view-selection-dial__action--thinking .geo-view-selection-dial__suggest-hover-effect {
  opacity: 1;
}

.geo-view-selection-dial__action--thinking .geo-view-selection-dial__suggest-hover-effect,
.geo-view-selection-dial__suggest-thinking-effect {
  animation: geo-view-selection-dial-thinking-background 2.4s linear infinite;
}

.geo-view-selection-dial__suggest-thinking-effect {
  z-index: 0;
  inline-size: 112px;
  block-size: 112px;
}

@keyframes geo-view-selection-dial-thinking-background {
  from { transform: translate3d(-50%, -50%, 0) rotate(0deg); }
  to { transform: translate3d(-50%, -50%, 0) rotate(360deg); }
}

.geo-view-selection-dial__action:disabled {
  opacity: 0.45;
  cursor: default;
}

.geo-view-selection-dial__action-icon {
  position: relative;
  z-index: 1;
  inline-size: 16px;
  block-size: 16px;
  display: inline-flex;
  flex: 0 0 16px;
  align-items: center;
  justify-content: center;
}

.geo-view-selection-dial__action-icon calcite-icon,
.geo-view-selection-dial__ask-icon,
.geo-view-selection-dial__suggest-icon { display: block; inline-size: 16px; block-size: 16px; }

.geo-view-selection-dial__action-label {
  position: relative;
  z-index: 1;
  display: block;
  inline-size: 50px;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-native-selection-popup.app-native-buffer-popup {
  --geo-view-selection-dial-foreground: rgb(20 20 20);
  --geo-view-selection-dial-card: rgb(255 255 255);
  --geo-view-selection-dial-primary: rgb(249 134 49);
  --geo-view-selection-dial-primary-hover: rgb(222 110 27);
  --geo-view-selection-dial-border: rgb(222 222 222);
  inline-size: min(24rem, calc(100% - 24px));
  max-block-size: none;
}
.app-native-selection-popup.app-native-buffer-popup calcite-panel { max-block-size: none; overflow: visible; }
.app-native-buffer-content { display: flex; flex-direction: column; gap: 12px; }
.app-native-buffer-label { color: rgb(74 74 74); font-size: 12px; line-height: 16px; }
.app-native-buffer-content [role='status'] { margin: 0; color: rgb(74 74 74); font-size: 12px; line-height: 1.45; }
.app-native-buffer-actions { display: flex; justify-content: flex-end; }
.app-native-buffer-actions calcite-button {
  --calcite-button-background-color: var(--geo-view-selection-dial-primary);
  --calcite-button-background-color-hover: var(--geo-view-selection-dial-primary-hover);
  --calcite-button-border-color: var(--geo-view-selection-dial-primary);
  --calcite-button-text-color: rgb(255 255 255);
  flex: none;
}

.app-native-selection-popup {
  --app-native-selection-primary: rgb(249 134 49);
  --app-native-selection-primary-hover: rgb(222 110 27);
  --app-native-selection-primary-press: rgb(206 87 0);
  position: absolute;
  z-index: 4;
  inset: 12px 12px auto auto;
  inline-size: min(26rem, calc(100% - 24px));
  max-block-size: min(32rem, calc(100% - 24px));
}

.app-native-selection-popup calcite-panel {
  --calcite-panel-corner-radius: 0;
  --calcite-panel-border-color: var(--app-border);
  --calcite-panel-background-color: var(--app-surface);
  --calcite-panel-header-background-color: var(--app-surface-raised);
  --calcite-panel-footer-background-color: var(--app-surface-raised);
  --calcite-panel-header-content-space: 14px 16px 10px;
  --calcite-panel-space: 16px;
  border: 1px solid var(--app-border);
  border-radius: 0;
  background: var(--app-surface);
  box-shadow: var(--calcite-shadow-md);
  max-block-size: var(--geo-view-selection-popup-available-height, calc(100vh - 24px));
  overflow: hidden;
}

.geo-view-overlay-close-button {
  inline-size: 40px;
  block-size: 40px;
}

.geo-view-selection-popup__content {
  display: flex;
  min-block-size: 0;
  block-size: min(27rem, calc(var(--geo-view-selection-popup-available-height, 32rem) - 4.5rem));
  max-block-size: calc(var(--geo-view-selection-popup-available-height, 32rem) - 4.5rem);
  flex-direction: column;
  gap: 12px;
}

.geo-view-selection-popup__chips,
.geo-view-selection-popup__nav-actions,
.geo-view-selection-popup__footer,
.geo-view-selection-popup__footer-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.geo-view-selection-popup__nav-actions { justify-content: flex-end; }

.geo-view-selection-popup__sections {
  display: flex;
  min-block-size: 0;
  flex: 1 1 auto;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.geo-view-selection-popup__sdk-feature {
  display: block;
  inline-size: 100%;
  min-inline-size: 0;
  color: var(--app-text);
  --calcite-color-foreground-1: var(--app-surface);
  --calcite-color-foreground-2: var(--app-surface-raised);
  --calcite-color-border-1: var(--app-border);
  --calcite-color-text-1: var(--app-text);
  --calcite-color-text-2: var(--app-text-muted);
}

.geo-view-selection-popup__footer {
  align-items: center;
  justify-content: space-between;
}

.geo-view-selection-popup__footer-secondary { flex: 1 1 auto; }

#app-native-selection-attach {
  --calcite-color-brand: var(--app-native-selection-primary);
  --calcite-color-brand-hover: var(--app-native-selection-primary-hover);
  --calcite-color-brand-press: var(--app-native-selection-primary-press);
  --calcite-button-border-color: var(--app-native-selection-primary);
  --calcite-button-text-color: var(--app-native-selection-primary);
}

.app-sdk-widget-panel {
  display: block;
  min-inline-size: min(var(--app-widget-panel-min-width), calc(100vw - 48px));
  inline-size: var(--app-widget-panel-width);
  max-inline-size: calc(100vw - 48px);
  block-size: var(--app-widget-panel-max-height);
  max-block-size: var(--app-widget-panel-max-height);
  overflow: auto;
  background: var(--app-surface);
}

/*
 * A gallery is a thumbnail grid, not a list.
 *
 * The SDK basemap gallery reflows to one item per row below roughly 30rem, so
 * at the shared panel width it renders as a tall narrow strip of thumbnails
 * while a layer list at the same width looks correct. Widening
 * --app-widget-panel-min-width does not fix it: a min below the panel's own
 * inline-size never applies. The width is the knob, and a gallery needs its
 * own. Written as a compound selector so it wins regardless of rule order.
 */
.app-sdk-widget-panel.app-sdk-widget-gallery {
  inline-size: var(--app-widget-gallery-width);
}

/*
 * The bridge that used to sit here is gone, and it had to go rather than merely being unnecessary.
 * It pointed the Calcite foreground token at the shell's own surface variable to drag one Calcite
 * panel into the shell palette. Now that the shell surface is itself defined as that same Calcite
 * token, the declaration is a reference cycle, and a cycle makes both properties invalid at
 * computed-value time: the panel would lose its background entirely. The two palettes are one
 * palette now, so there is nothing left to bridge.
 */
