:root {
  --map-blue: #2563eb;
  --point: #7c3aed;
  --station: #ca8a04;
  --danger: #ef4444;
  --error-bg: #fff1f2;
  --error-line: #fecaca;
  --comfortable: #16a34a;
  --near-limit: #eab308;
  --unknown: #647084;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.procedure-sweep-main {
  width: min(1680px, 100%);
  height: calc(100vh - var(--header-height) - var(--footer-height));
  margin: 0 auto;
  padding: 20px 24px 32px;
  overflow-y: auto;
  overflow-x: hidden;
}

.workspace-intro {
  margin-bottom: 14px;
}

.workspace-intro > div {
  padding: 0;
  border: 0;
  background: transparent;
}

.procedure-workspace-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: var(--app-radius-card);
  padding: 18px 20px;
  background:
    linear-gradient(108deg, #ffffff 0%, #f9fbfc 63%, #eaf6f7 100%);
  box-shadow: var(--app-card-shadow);
}

.procedure-title-group {
  min-width: 0;
}

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

.workspace-intro h1 {
  margin: 3px 0 6px;
  color: var(--ink);
  font-size: clamp(22px, 2vw, 29px);
  font-weight: 760;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.workspace-intro p,
.workspace-panel p,
.empty-state {
  color: #344054;
  font-size: 14px;
  line-height: 1.48;
}

.workspace-intro p {
  max-width: 760px;
  margin: 0;
}

.workflow-toolbar {
  position: sticky;
  top: 6px;
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--app-radius-card);
  padding: 9px;
  background: rgba(250, 252, 253, 0.96);
  box-shadow: 0 10px 28px rgba(7, 19, 33, 0.1);
  backdrop-filter: blur(10px);
}

.workspace-view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #edf2f6;
}

.workspace-view-tabs button {
  min-width: 106px;
  gap: 7px;
  color: var(--muted);
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.workspace-view-tabs button.is-active,
.workspace-view-tabs button[aria-pressed="true"] {
  color: var(--accent-dark);
  border-color: var(--accent-line);
  background: #ffffff;
  box-shadow: 0 2px 7px rgba(7, 19, 33, 0.08);
}

.workflow-runner {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}

.workflow-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  max-width: 290px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 680;
}

.workflow-status::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(8, 127, 140, 0.1);
}

.workflow-status[data-status="error"] {
  color: var(--fail);
}

.workflow-status[data-status="error"]::before {
  background: var(--fail);
  box-shadow: 0 0 0 4px rgba(185, 28, 28, 0.1);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.procedure-sweep-shell [hidden] {
  display: none !important;
}

.procedure-sweep-shell[data-active-workspace-view="setup"] .workspace-grid {
  grid-template-columns: minmax(0, 1fr);
}

.procedure-sweep-shell[data-active-workspace-view="setup"] :is(
  .examples-panel,
  .scenario-panel,
  .service-volume-panel,
  .dme-station-eligibility-panel,
  .station-selection-panel,
  .scenario-files-panel
) {
  grid-column: 1;
}

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

.workspace-panel {
  min-width: 0;
  padding: 18px;
  border-color: var(--line);
  box-shadow: var(--app-card-shadow);
}

.summary-card .label-row,
.station-usage-summary .label-row {
  display: inline-flex;
  vertical-align: middle;
}

.summary-card .label-text,
.station-usage-summary .label-text {
  display: inline;
}

.procedure-sweep-main .app-help-button,
.procedure-sweep-main .info-tooltip-button,
.procedure-sweep-main .app-help-popover,
.procedure-sweep-main .info-popover,
.procedure-sweep-main .app-help-popover strong,
.procedure-sweep-main .info-popover strong,
.procedure-sweep-main .app-help-popover span,
.procedure-sweep-main .info-popover span {
  text-transform: none;
}

.procedure-sweep-main .app-help-popover,
.procedure-sweep-main .info-popover {
  color: #344054;
  font-size: 12px;
  font-weight: 520;
  line-height: 1.4;
}

.procedure-sweep-main .app-help-popover strong,
.procedure-sweep-main .info-popover strong {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 760;
}

.procedure-sweep-main .app-help-popover span,
.procedure-sweep-main .info-popover span {
  color: #344054;
  font-size: 12px;
  font-weight: 520;
}

.map-panel,
.request-panel,
.results-panel,
.diagnostics-panel,
.plots-panel {
  grid-column: 1 / -1;
}

.panel-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 4px;
  margin-bottom: 13px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

.focus-toggle {
  flex: 0 0 auto;
}

.panel-heading-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.workspace-panel p {
  margin: 0 0 12px;
}

.example-loader,
.scenario-file-actions,
.panel-action-row,
.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}

.example-loader select {
  min-height: 44px;
}

.example-loader {
  margin-bottom: 0;
}

.scenario-library-intro {
  max-width: 920px;
}

.scenario-library-controls {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) minmax(190px, 1fr);
  gap: 10px;
  align-items: end;
}

.scenario-library-controls label {
  min-width: 0;
}

.scenario-library-count {
  margin: 10px 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.scenario-library-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-height: 440px;
  overflow-y: auto;
  padding: 2px 4px 4px 2px;
  scrollbar-color: rgba(100, 112, 132, 0.42) transparent;
  scrollbar-width: thin;
}

.scenario-library-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px;
  background: #ffffff;
}

.scenario-library-card.is-active {
  border-color: rgba(15, 118, 110, 0.54);
  background: #f0fdfa;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.08);
}

.scenario-library-card-heading,
.scenario-library-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}

.scenario-type-badge,
.scenario-active-badge,
.scenario-library-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 820;
  line-height: 1.2;
}

.scenario-type-badge.synthetic {
  color: #0f5f59;
  background: #ccfbf1;
}

.scenario-type-badge.illustration {
  color: #7c2d12;
  background: #ffedd5;
}

.scenario-active-badge {
  color: #1d4ed8;
  background: #dbeafe;
}

.scenario-library-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.3;
}

.scenario-library-card p {
  flex: 1 1 auto;
  margin: 0;
  font-size: 12px;
  line-height: 1.42;
}

.scenario-library-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.scenario-library-facts span {
  min-width: 0;
  color: #344054;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.scenario-library-facts strong {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.scenario-library-tags span {
  min-height: 20px;
  color: #475467;
  background: #eef2f6;
}

.scenario-library-card button {
  align-self: flex-start;
  min-height: 34px;
  margin-top: 2px;
  padding: 6px 10px;
}

.scenario-library-empty {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

.scenario-file-actions {
  margin-bottom: 12px;
}

.example-loader label {
  flex: 1 1 200px;
}

.scenario-save-form {
  margin-top: 8px;
}

.scenario-file-status {
  min-height: 20px;
  margin-top: 10px;
  color: #166534;
  font-size: 13px;
  font-weight: 760;
}

.scenario-file-status[data-status="error"] {
  color: #b91c1c;
}

.visually-hidden-file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

.editor-form .checkbox-field {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.eligibility-rule-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.eligibility-rule-copy strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 780;
  line-height: 1.45;
}

.eligibility-rule-copy .field-note {
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
}

.procedure-sweep-shell input[type="checkbox"],
.editor-form .checkbox-field input[type="checkbox"],
.selected-editor .checkbox-field input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  max-width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  margin: 0;
  flex: 0 0 auto;
}

.procedure-sweep-map:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.2);
  outline-offset: 2px;
}

.advanced-editor,
.advanced-json-block {
  margin-top: 12px;
}

.advanced-editor[open] summary {
  margin-bottom: 10px;
}

.advanced-json-block[open] summary {
  margin-bottom: 10px;
}

.map-toolbar {
  margin-bottom: 8px;
}

.map-view-toolbar {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  display: grid;
  justify-items: end;
  gap: 5px;
  max-width: calc(100% - 16px);
}

.map-zoom-controls,
.map-sample-navigation {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
}

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

.map-sample-navigation[hidden] + .map-quick-send {
  display: none;
}

.map-quick-send {
  box-sizing: border-box;
  width: 140px;
  max-width: 100%;
  min-width: 0;
  min-height: 32px;
  padding: 5px 8px;
  font-size: 11px;
  line-height: 1.15;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.map-view-button {
  min-width: 32px;
  min-height: 32px;
  padding: 5px 8px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.map-sample-nav-button {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.map-sample-nav-button svg {
  width: 15px;
  height: 15px;
  display: block;
  fill: currentColor;
}

.map-view-button:hover,
.map-view-button:focus-visible {
  border-color: rgba(15, 118, 110, 0.42);
  background: #ffffff;
  color: var(--ink);
}

.map-view-button:disabled,
.map-view-button:disabled:hover,
.map-view-button:disabled:focus-visible {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.78);
  color: rgba(52, 64, 84, 0.58);
  cursor: not-allowed;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.overlay-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.overlay-controls label {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 8px;
  color: #344054;
  background: var(--surface-raised);
  font-size: 12px;
  font-weight: 760;
}

.map-readout {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
  color: #344054;
  font-size: 13px;
}

.map-readout span {
  color: var(--muted);
  font-weight: 800;
}

.svg-map-frame {
  position: relative;
  height: clamp(560px, 68vh, 780px);
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #f8fafc;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6), 0 10px 26px rgba(7, 19, 33, 0.08);
}

.map-viewport {
  position: relative;
}

.procedure-sweep-map {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  touch-action: none;
  user-select: none;
}

.map-background {
  fill: #f5f8fa;
}

.grid-line {
  stroke: #d9e3ea;
  stroke-width: 1;
}

.grid-line.origin {
  stroke: #94a3b8;
  stroke-width: 1.5;
}

.service-volume-range-circle {
  fill: none;
  pointer-events: none;
  stroke: rgba(17, 24, 39, 0.46);
  stroke-width: 1.4;
}

.service-volume-range-circle.is-out-of-range {
  stroke-dasharray: 7 5;
}

.service-volume-range-hit-area {
  cursor: help;
  fill: none;
  pointer-events: stroke;
  stroke: transparent;
  stroke-width: 12;
}

.service-volume-hover-label {
  filter: drop-shadow(0 4px 9px rgba(24, 33, 47, 0.24));
  pointer-events: none;
}

.service-volume-hover-label rect {
  fill: rgba(17, 24, 39, 0.92);
  stroke: rgba(255, 255, 255, 0.8);
  stroke-width: 1;
}

.service-volume-hover-label-text {
  fill: #ffffff;
  font-size: 12px;
  font-weight: 780;
}

.grid-label,
.object-label {
  fill: #475467;
  font-size: 12px;
  font-weight: 760;
  paint-order: stroke;
  pointer-events: none;
  stroke: #ffffff;
  stroke-width: 3px;
  text-anchor: middle;
}

.procedure-leg {
  fill: none;
  stroke: var(--map-blue);
  stroke-linecap: round;
  stroke-width: 4;
}

.result-segment {
  fill: none;
  stroke-linecap: round;
  stroke-width: 7;
  opacity: 1;
}

.result-segment.comfortable,
.sample-marker.comfortable {
  stroke: var(--comfortable);
  fill: var(--comfortable);
}

.result-segment.near-limit,
.sample-marker.near-limit {
  stroke: var(--near-limit);
  fill: var(--near-limit);
}

.result-segment.fail,
.sample-marker.fail {
  stroke: var(--danger);
  fill: var(--danger);
}

.result-segment.unknown,
.sample-marker.unknown {
  stroke: var(--unknown);
  fill: var(--unknown);
}

.sample-marker {
  cursor: default;
  stroke: #ffffff;
  stroke-width: 2.5;
  filter: drop-shadow(0 3px 7px rgba(24, 33, 47, 0.22));
}

.sample-hover-label {
  filter: drop-shadow(0 3px 8px rgba(24, 33, 47, 0.22));
  opacity: 0.94;
  pointer-events: none;
}

.sample-hover-label rect {
  fill: rgba(7, 19, 33, 0.9);
  stroke: rgba(255, 255, 255, 0.72);
  stroke-width: 1;
}

.sample-hover-label-title,
.sample-hover-label-key,
.sample-hover-label-value {
  fill: #ffffff;
}

.sample-hover-label-title {
  font-size: 11px;
  font-weight: 800;
}

.sample-hover-label-key,
.sample-hover-label-value {
  font-size: 10px;
}

.sample-hover-label-key {
  fill: #a9bacd;
  font-weight: 650;
}

.sample-hover-label-value {
  font-weight: 760;
}

.sample-marker.is-selected {
  stroke: #111827;
  stroke-width: 4;
}

.sample-marker.is-worst {
  stroke: #7f1d1d;
}

.station-switch-marker {
  fill: #ffffff;
  stroke: #7c3aed;
  stroke-width: 3.2;
  pointer-events: none;
}

.selected-station-ray {
  stroke: rgba(15, 118, 110, 0.72);
  stroke-dasharray: 6 5;
  stroke-linecap: round;
  stroke-width: 2.5;
}

.hpl-circle,
.hal-circle {
  fill: none;
  pointer-events: none;
}

.hpl-circle {
  stroke: #2563eb;
  stroke-dasharray: 7 5;
  stroke-width: 2;
}

.hal-circle {
  stroke: #dc2626;
  stroke-width: 2.5;
}

.map-legend,
.selected-sample-map-summary {
  margin-top: 10px;
}

.map-detail-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.map-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  color: #344054;
  font-size: 12px;
  font-weight: 760;
}

.map-legend span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
}

.legend-swatch {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 1px var(--line);
}

.legend-swatch.comfortable {
  background: var(--comfortable);
}

.legend-swatch.near-limit {
  background: var(--near-limit);
}

.legend-swatch.fail {
  background: #dc2626;
}

.legend-swatch.unknown {
  background: var(--unknown);
}

.legend-swatch.station-switch {
  border: 3px solid #7c3aed;
  border-radius: 2px;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(124, 58, 237, 0.16);
  transform: rotate(45deg);
}

.legend-swatch.station-eligible {
  border-color: #15803d;
  border-radius: 2px;
  background: #dcfce7;
}

.legend-swatch.station-acquiring {
  border-color: #b45309;
  border-radius: 2px;
  background: #fef3c7;
}

.legend-swatch.station-range {
  border-color: #c2410c;
  border-radius: 2px;
  background: #fff7ed;
}

.legend-swatch.station-elevation {
  border-color: #be185d;
  border-radius: 2px;
  background: #fdf2f8;
}

.legend-swatch.station-service {
  border-color: #64748b;
  border-radius: 2px;
  background: #f8fafc;
}

.selected-sample-map-inset {
  display: none;
}

.selected-sample-map-inset-grid {
  display: grid;
  gap: 8px;
  margin: 0;
}

.selected-sample-map-inset-grid div {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.selected-sample-map-inset-grid dt {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.selected-sample-map-inset-grid dd {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 840;
  text-align: right;
  white-space: nowrap;
}

.metric-line-swatch {
  flex: 0 0 auto;
  width: 28px;
  border-top: 3px solid currentColor;
}

.metric-line-swatch.hpl {
  border-top-color: #2563eb;
  border-top-style: dashed;
}

.metric-line-swatch.hal {
  border-top-color: #dc2626;
}

@media (min-width: 980px) {
  .map-viewport .map-legend {
    position: absolute;
    inset: auto auto 12px 12px;
    z-index: 2;
    width: min(340px, calc(100% - 24px));
    grid-template-columns: 1fr;
    margin-top: 0;
    padding: 9px 10px;
    border: 1px solid rgba(148, 163, 184, 0.42);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 18px rgba(24, 33, 47, 0.14);
    backdrop-filter: blur(4px);
  }

  .map-viewport .selected-sample-map-inset:not([hidden]) {
    position: absolute;
    inset: auto 12px 12px auto;
    z-index: 2;
    display: block;
    width: min(220px, calc(100% - 24px));
    padding: 10px 11px;
    border: 1px solid rgba(148, 163, 184, 0.42);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 18px rgba(24, 33, 47, 0.14);
    backdrop-filter: blur(4px);
  }
}

.map-sample-summary-card {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
}

.map-sample-summary-card div {
  min-width: 0;
}

.map-sample-summary-card .wide {
  grid-column: span 2;
}

.map-sample-summary-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.map-sample-summary-card strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.station-marker {
  cursor: grab;
  filter: drop-shadow(0 4px 8px rgba(24, 33, 47, 0.22));
}

.station-marker-frame {
  fill: #f8fafc;
  stroke: #111827;
  stroke-width: 2.4;
}

.station-marker-dot {
  fill: #111827;
  stroke: none;
}

.station-marker-hit-area {
  cursor: grab;
  fill: transparent;
  stroke: none;
}

.station-marker.is-disabled .station-marker-frame {
  stroke: #647084;
}

.station-marker.is-disabled .station-marker-dot {
  fill: #647084;
}

.station-marker.is-result-selected .station-marker-frame {
  fill: #dcfce7;
  stroke: #15803d;
}

.station-marker.is-result-selected .station-marker-dot,
.station-marker.is-result-eligible .station-marker-dot {
  fill: #15803d;
}

.station-marker.is-result-eligible .station-marker-frame {
  stroke: #15803d;
}

.station-marker.is-result-acquiring .station-marker-frame {
  fill: #fef3c7;
  stroke: #b45309;
  stroke-dasharray: 3 2;
}

.station-marker.is-result-acquiring .station-marker-dot {
  fill: #b45309;
}

.station-marker.is-result-range .station-marker-frame {
  stroke: #c2410c;
}

.station-marker.is-result-range .station-marker-dot {
  fill: #c2410c;
}

.station-marker.is-result-elevation .station-marker-frame {
  stroke: #be185d;
}

.station-marker.is-result-elevation .station-marker-dot {
  fill: #be185d;
}

.station-marker.is-result-service .station-marker-frame,
.station-marker.is-result-unavailable .station-marker-frame {
  stroke: #64748b;
  stroke-dasharray: 3 2;
}

.station-marker.is-result-service .station-marker-dot,
.station-marker.is-result-unavailable .station-marker-dot {
  fill: #64748b;
}

.point-marker {
  cursor: grab;
  fill: var(--point);
  stroke: #ffffff;
  stroke-width: 3;
  filter: drop-shadow(0 4px 8px rgba(24, 33, 47, 0.22));
}

.station-marker.is-selected .station-marker-frame {
  stroke: #111827;
  stroke-width: 4;
}

.point-marker.is-selected {
  stroke: #111827;
  stroke-width: 4;
}

.station-marker.is-dragging,
.station-marker-frame.is-dragging,
.station-marker-dot.is-dragging,
.station-marker-hit-area.is-dragging,
.point-marker.is-dragging {
  cursor: grabbing;
}

.item-list {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 9px;
  background: #ffffff;
}

.item-row.is-selected {
  border-color: rgba(15, 118, 110, 0.5);
  background: #eefdfa;
}

.item-row button {
  min-height: 32px;
  padding: 5px 9px;
}

.item-title {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 820;
  overflow-wrap: anywhere;
}

.item-meta {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.selected-editor {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.selected-editor .editor-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.selected-editor .checkbox-field {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}

.selected-editor .checkbox-field input {
  width: auto;
  min-height: auto;
}

.full-row {
  grid-column: 1 / -1;
}

.field-note {
  color: var(--muted-text);
  font-size: 0.84rem;
  line-height: 1.45;
  margin: 0;
}

.validation-panel,
.diagnostic-list {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.validation-message,
.diagnostic-message {
  min-width: 0;
  border: 1px solid var(--warning-line);
  border-radius: 7px;
  padding: 8px 10px;
  color: #7c2d12;
  background: var(--warning-bg);
  font-size: 13px;
  line-height: 1.42;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.validation-message.error {
  border-color: var(--error-line);
  color: var(--danger);
  background: var(--error-bg);
}

.validation-message.ok {
  border-color: #bbf7d0;
  color: #166534;
  background: #ecfdf3;
}

#request-json-preview,
[data-raw-response-preview] {
  width: 100%;
  min-height: 380px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: #111827;
  background: #0f172a;
  color: #e5edf8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.45;
}

[data-raw-response-preview] {
  min-height: 260px;
  margin-top: 10px;
}

.stale-indicator,
.run-progress {
  margin: 10px 0;
  border: 1px solid var(--warning-line);
  border-radius: 7px;
  padding: 8px 10px;
  color: #7c2d12;
  background: var(--warning-bg);
  font-size: 13px;
  font-weight: 760;
}

.run-progress {
  position: relative;
  display: grid;
  gap: 7px;
  overflow: hidden;
  border-color: #bfdbfe;
  color: #1e3a8a;
  background: #eff6ff;
}

.run-progress progress {
  width: min(260px, 100%);
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #dbeafe;
}

.run-progress progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #dbeafe;
}

.run-progress progress::-webkit-progress-value {
  border-radius: 999px;
  background: #2563eb;
}

.run-progress progress::-moz-progress-bar {
  border-radius: 999px;
  background: #2563eb;
}

.api-error-panel {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.summary-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.station-usage-card {
  margin-top: 12px;
}

.station-usage-summary {
  padding: 12px;
}

.station-usage-summary h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.station-usage-table-scroll {
  overflow-x: auto;
}

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

.station-usage-table th,
.station-usage-table td {
  border-bottom: 1px solid var(--line);
  padding: 7px 8px;
  text-align: left;
}

.station-usage-table th {
  color: var(--muted);
  background: var(--band);
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.station-eligibility-diagnostics {
  margin-top: 12px;
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  overflow: hidden;
  background: var(--surface-raised);
}

.station-eligibility-diagnostics h3 {
  margin: 0 0 4px;
}

.station-eligibility-table-scroll {
  width: 100%;
  max-width: 100%;
  margin-top: 10px;
  overflow-x: auto;
}

.station-eligibility-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 12px;
}

.station-eligibility-table th,
.station-eligibility-table td {
  border-bottom: 1px solid var(--line);
  padding: 7px 8px;
  text-align: left;
  vertical-align: top;
}

.station-eligibility-table th {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.summary-card {
  padding: 11px;
  background: var(--band);
}

.summary-card span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.summary-card strong {
  display: block;
  margin-top: 7px;
  color: var(--ink);
  font-size: 15px;
  overflow-wrap: anywhere;
}

.sample-table-scroll {
  max-height: 460px;
  margin-top: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.sample-table th,
.sample-table td {
  border-bottom: 1px solid var(--line);
  padding: 8px 9px;
  text-align: left;
  vertical-align: top;
}

.sample-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: var(--band);
  font-size: 11px;
  font-weight: 820;
  text-transform: uppercase;
}

.sample-table tr.is-selected td {
  background: #eefdfa;
}

.sample-table button {
  min-height: 28px;
  padding: 4px 8px;
}

.sample-details {
  display: grid;
  gap: 12px;
}

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

.detail-card,
.warning-group {
  padding: 12px;
}

.detail-card h3,
.warning-group h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.warning-group {
  max-height: 460px;
  overflow: auto;
}

.warning-group-list {
  display: grid;
  gap: 8px;
}

.warning-item {
  display: block;
}

.warning-item summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  cursor: pointer;
}

.warning-item summary span,
.warning-item-detail {
  min-width: 0;
  overflow-wrap: anywhere;
}

.warning-item summary strong {
  color: #7c2d12;
  white-space: nowrap;
}

.warning-item-detail {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  color: #344054;
  font-size: 12px;
}

.detail-card dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.detail-card dl div {
  display: grid;
  grid-template-columns: minmax(94px, 0.8fr) minmax(0, 1.2fr);
  gap: 8px;
}

.detail-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-card dd {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.plot-grid {
  min-width: 0;
  width: 100%;
}

.procedure-sweep-chart-shell {
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

.procedure-sweep-chart-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 9px;
  background: #f8fafc;
}

.procedure-sweep-chart-status-key,
.procedure-sweep-chart-metric-guide {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 7px 12px;
  align-items: center;
}

.procedure-sweep-chart-status-key span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #475467;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.procedure-sweep-chart-status-key i {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: var(--status-color);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--status-color) 70%, #ffffff);
}

.chart-reset-zoom {
  min-width: 94px;
  min-height: 42px;
  flex: 0 0 auto;
}

.procedure-sweep-chart-metric-guide {
  margin-bottom: 3px;
  color: #344054;
  font-size: 11px;
  font-weight: 720;
}

.procedure-sweep-chart-metric-guide > span,
.procedure-sweep-chart-metric-guide .label-row {
  min-width: 0;
}

.procedure-sweep-echart {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  touch-action: pan-y;
}

.procedure-sweep-chart-readout {
  min-height: 20px;
  margin: 4px 0 0;
  color: #344054;
  font-size: 12px;
  font-weight: 720;
  overflow-wrap: anywhere;
}

.procedure-sweep-chart-note {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.raw-response-block {
  margin-top: 12px;
}

.procedure-sweep-shell.is-focus-mode .workspace-grid {
  grid-template-columns: 1fr;
}

.procedure-sweep-shell.is-focus-mode .workspace-panel:not(.is-focused-panel) {
  display: none;
}

.procedure-sweep-shell.is-focus-mode .is-focused-panel {
  grid-column: 1 / -1;
  position: static;
}

.procedure-sweep-shell.is-focus-mode .sample-table-scroll,
.procedure-sweep-shell.is-focus-mode .warning-group {
  max-height: 70vh;
}

.empty-state {
  margin: 0;
  border: 1px dashed var(--line);
  border-radius: 7px;
  padding: 10px;
  background: var(--band);
}

@media (max-width: 1100px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .procedure-sweep-shell[data-active-workspace-view="setup"] .workspace-grid {
    grid-template-columns: 1fr;
  }

  .procedure-sweep-shell[data-active-workspace-view="setup"] :is(
    .examples-panel,
    .scenario-panel,
    .service-volume-panel,
    .dme-station-eligibility-panel,
    .station-selection-panel,
    .scenario-files-panel
  ) {
    grid-column: 1;
  }

  .scenario-library-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .procedure-sweep-main {
    padding: 14px;
  }

  .workflow-toolbar {
    position: static;
    grid-template-columns: 1fr;
  }

  .procedure-workspace-header {
    min-height: 94px;
    padding: 15px 16px;
  }

  .workflow-status {
    display: none;
  }

  .workspace-view-tabs,
  .workflow-runner {
    justify-content: stretch;
  }

  .workspace-view-tabs button,
  .workflow-runner button {
    flex: 1 1 140px;
  }

  .workspace-panel {
    padding: 14px;
  }

  .editor-form,
  .selected-editor .editor-form {
    grid-template-columns: 1fr;
  }

  .scenario-library-controls,
  .scenario-library-list {
    grid-template-columns: 1fr;
  }

  .svg-map-frame {
    height: 56vh;
    min-height: 420px;
  }

  .overlay-controls,
  .summary-card-grid,
  .sample-detail-grid,
  .map-legend,
  .map-sample-summary-card {
    grid-template-columns: 1fr;
  }

  .map-sample-summary-card .wide {
    grid-column: auto;
  }

}

@media (max-width: 540px) {
  .procedure-sweep-main {
    padding: 10px;
  }

  .workspace-panel {
    padding: 12px;
  }

  .procedure-workspace-header {
    min-height: 84px;
    padding: 12px;
  }

  .workspace-intro h1 {
    font-size: 20px;
  }

  .workspace-intro p {
    display: none;
  }

  .workspace-view-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .workspace-view-tabs button {
    min-width: 0;
  }

  .procedure-sweep-chart-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .procedure-sweep-chart-status-key {
    gap: 6px 9px;
  }

  .procedure-sweep-chart-status-key span,
  .procedure-sweep-chart-metric-guide {
    font-size: 10px;
  }

  .chart-reset-zoom {
    width: 100%;
    min-height: 44px;
  }

  .procedure-sweep-chart-note {
    font-size: 10px;
  }

  .map-toolbar button,
  .panel-action-row button {
    font-size: 12px;
  }

  .map-toolbar button,
  .panel-action-row button {
    flex: 1 1 150px;
  }

  #request-json-preview {
    min-height: 300px;
  }
}
