/* Map Editor — greenfield product shell (ME-1) */

.map-editor-root {
  --map-editor-bg: var(--color-bg, #0f172a);
  --map-editor-surface: var(--color-surface, #162033);
  --map-editor-border: color-mix(in srgb, var(--color-border, #94a3b8) 55%, transparent);
  --map-editor-text: var(--color-text, #f8fafc);
  --map-editor-muted: var(--color-muted, #94a3b8);
  --map-editor-accent: var(--color-accent, #60a5fa);
  --kiosk-accent: var(--map-editor-accent);
  --kiosk-accent-deep: color-mix(in oklab, var(--kiosk-accent) 55%, black);
  --kiosk-accent-darken: color-mix(in oklab, var(--kiosk-accent) 70%, black);
  --kiosk-white: #ffffff;
  --kiosk-font: "Helvetica Neue", Inter, Arial, system-ui, sans-serif;
  --map-editor-select-handle-fill: var(--color-surface-elevated, #ffffff);
  --map-editor-ds-anchor-fill: var(--color-bg, #0f172a);
  --map-editor-canvas-bg: #111827;
  --map-shape-fill: color-mix(in srgb, var(--map-editor-accent) 35%, transparent);
  --map-shape-stroke: var(--map-editor-accent);
  --map-boundary-fill: color-mix(in srgb, var(--map-editor-accent) 20%, transparent);
  --map-boundary-stroke: color-mix(in srgb, var(--map-editor-accent) 85%, black);
  --map-route-node-stroke: #15803d;
  --map-route-edge-stroke: #22c55e;
  --map-route-preview-stroke: #f97316;
  --map-route-preview-snap: #fbbf24;
  --map-route-pen-preview-stroke: color-mix(in srgb, var(--map-route-edge-stroke) 45%, transparent);
  --map-diagnostic-error: #ef4444;
  --map-diagnostic-warning: #f59e0b;
  --map-diagnostic-route: #f97316;
  --map-editor-field-height: 2.25rem;
  --map-editor-field-padding-x: 0.65rem;
  --map-editor-field-radius: 8px;
  --map-editor-field-font-size: 0.75rem;
  --map-editor-field-font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --map-editor-field-line-height: 1.25;

  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  color: var(--map-editor-text);
  background: var(--map-editor-bg);
}

/* Mud popovers portal under body — mirror editor tokens so list/icons use scheme text color. */
body:has(.map-editor-root) {
  --map-editor-bg: var(--color-bg, #0f172a);
  --map-editor-surface: var(--color-surface, #162033);
  --map-editor-border: color-mix(in srgb, var(--color-border, #94a3b8) 55%, transparent);
  --map-editor-text: var(--color-text, #f8fafc);
  --map-editor-muted: var(--color-muted, #94a3b8);
  --map-editor-accent: var(--color-accent, #60a5fa);
  --map-editor-field-font-size: 0.75rem;
  --map-editor-field-font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --map-editor-field-line-height: 1.25;
}

.map-editor-root.is-fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  z-index: 1400;
  box-sizing: border-box;
  overflow: hidden;
}

body:has(.map-editor-root.is-fullscreen) {
  overflow: hidden;
}

/* MudSelect/dialog layers must sit above .map-editor-root.is-fullscreen (z-index 1400). */
.map-editor-floor-select-popover {
  z-index: 1800 !important;
}

.map-editor-field-popover {
  z-index: 1800 !important;
}

body:has(.map-editor-root) .map-editor-field-popover,
body:has(.location-embed-page) .map-editor-field-popover {
  width: max-content !important;
  max-width: min(28rem, calc(100vw - 2rem)) !important;
  max-height: min(24rem, calc(100vh - 6rem)) !important;
}

body:has(.map-editor-root) .map-editor-field-popover.mud-popover-relative-width,
body:has(.location-embed-page) .map-editor-field-popover.mud-popover-relative-width {
  width: max-content !important;
}

body:has(.map-editor-root) .map-editor-field-popover .mud-paper,
body:has(.location-embed-page) .map-editor-field-popover .mud-paper {
  width: auto !important;
  min-width: unset !important;
  max-width: min(28rem, calc(100vw - 2rem)) !important;
  background: var(--map-editor-surface) !important;
  color: var(--map-editor-text) !important;
  border: 1px solid var(--map-editor-border) !important;
  box-shadow: var(--shadow-md, 0 8px 24px rgb(0 0 0 / 0.22)) !important;
}

body:has(.map-editor-root) .map-editor-field-popover .mud-list,
body:has(.location-embed-page) .map-editor-field-popover .mud-list {
  width: max-content;
  min-width: 100%;
  max-height: min(22rem, calc(100vh - 8rem)) !important;
  overflow-y: auto !important;
  padding: 0.25rem 0 !important;
}

body:has(.map-editor-root) .map-editor-field-popover .mud-list-item,
body:has(.location-embed-page) .map-editor-field-popover .mud-list-item {
  display: flex;
  align-items: center;
  color: var(--map-editor-text) !important;
  font-size: var(--map-editor-field-font-size) !important;
  font-family: var(--map-editor-field-font-family) !important;
  font-weight: 400 !important;
  line-height: var(--map-editor-field-line-height) !important;
  letter-spacing: normal !important;
  min-height: var(--map-editor-field-height) !important;
  white-space: nowrap !important;
}

body:has(.map-editor-root) .map-editor-field-popover .mud-list-item:hover,
body:has(.map-editor-root) .map-editor-field-popover .mud-list-item:focus-visible,
body:has(.map-editor-root) .map-editor-field-popover .mud-list-item.mud-selected-item,
body:has(.location-embed-page) .map-editor-field-popover .mud-list-item:hover,
body:has(.location-embed-page) .map-editor-field-popover .mud-list-item:focus-visible,
body:has(.location-embed-page) .map-editor-field-popover .mud-list-item.mud-selected-item {
  background: color-mix(in srgb, var(--map-editor-accent) 12%, transparent) !important;
}

body:has(.map-editor-root) .map-editor-field-popover .mud-list-item-text,
body:has(.location-embed-page) .map-editor-field-popover .mud-list-item-text {
  min-width: max-content !important;
  margin: 0 !important;
  font-size: inherit !important;
  font-family: inherit !important;
  font-weight: inherit !important;
  line-height: inherit !important;
  letter-spacing: inherit !important;
  white-space: nowrap !important;
}

body:has(.map-editor-root.is-fullscreen) .mud-popover,
body:has(.map-editor-root.is-fullscreen) .mud-picker-popover,
body:has(.map-editor-root.is-fullscreen) .mud-picker-inline-paper {
  z-index: 1800 !important;
  pointer-events: auto !important;
}

body:has(.map-editor-root.is-fullscreen) .mud-overlay,
body:has(.map-editor-root.is-fullscreen) .mud-overlay-dialog {
  z-index: 1650 !important;
}

body:has(.map-editor-root.is-fullscreen) .mud-dialog-container,
body:has(.map-editor-root.is-fullscreen) .mud-dialog {
  z-index: 1700 !important;
}

/* Boot overlay — frosted glass + Q contour run (login register border colors) */
@property --me-boot-angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.map-editor-boot-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--map-editor-bg, #0f172a) 55%, transparent),
      color-mix(in srgb, var(--map-editor-bg, #0f172a) 72%, transparent)
    );
  -webkit-backdrop-filter: blur(48px) saturate(160%);
  backdrop-filter: blur(48px) saturate(160%);
  opacity: 1;
  visibility: visible;
  transition: opacity 0.32s ease, visibility 0.32s ease;
  pointer-events: auto;
}

.map-editor-boot-overlay.is-fading {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.map-editor-boot-mark {
  position: relative;
  width: min(132px, 28vw);
  aspect-ratio: 82.2 / 72.6;
}

.map-editor-boot-mark__svg {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.map-editor-boot-mark__fill {
  fill: #fff;
}

.map-editor-boot-mark__halo {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    conic-gradient(
      from var(--me-boot-angle),
      rgb(255 255 255 / 0.28) 0deg,
      rgb(255 255 255 / 0.28) 250deg,
      #ffd23f 280deg,
      #31d7a4 300deg,
      #4da3ff 320deg,
      #a855f7 340deg,
      rgb(255 255 255 / 0.28) 360deg
    );
  -webkit-mask-image: url("/brand/q-logo-stroke.svg?v=2");
  mask-image: url("/brand/q-logo-stroke.svg?v=2");
  -webkit-mask-mode: alpha;
  mask-mode: alpha;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  animation: map-editor-boot-border-run 2.8s linear infinite;
  pointer-events: none;
}

@keyframes map-editor-boot-border-run {
  to {
    --me-boot-angle: 360deg;
  }
}

.map-editor-boot-progress {
  position: relative;
  width: min(160px, 32vw);
  height: 1px;
  margin-top: 132px;
  border-radius: 999px;
  flex-shrink: 0;
  background: rgb(255 255 255 / 0.18);
  isolation: isolate;
}

.map-editor-boot-progress__bar {
  position: absolute;
  top: -1px;
  left: 0;
  width: 40%;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #ffd23f 25%,
    #31d7a4 50%,
    #4da3ff 75%,
    transparent 100%
  );
  will-change: transform;
  animation: map-editor-boot-progress-slide 1.6s ease-in-out infinite;
}

@keyframes map-editor-boot-progress-slide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

@media (prefers-reduced-motion: reduce) {
  .map-editor-boot-mark__halo {
    animation: none;
    background:
      linear-gradient(
        90deg,
        rgb(255 255 255 / 0.45),
        #ffd23f,
        #31d7a4,
        #4da3ff,
        #a855f7,
        rgb(255 255 255 / 0.45)
      );
  }

  .map-editor-boot-overlay {
    transition: none;
  }
}

.map-editor-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-shrink: 0;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--map-editor-border);
  background: var(--map-editor-surface);
}

.map-editor-title-block {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.map-editor-title-block h1 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.3;
}

.map-editor-eyebrow {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--map-editor-accent);
}

.map-editor-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--map-editor-border);
  border-radius: 8px;
  background: transparent;
  color: var(--map-editor-text);
  cursor: pointer;
}

.map-editor-icon-button:hover {
  border-color: var(--map-editor-accent);
  color: var(--map-editor-accent);
}

.map-editor-icon-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.map-editor-header-history {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.map-editor-floor-select {
  min-width: 8rem;
  max-width: 10rem;
}

.map-editor-floor-select .mud-input-root {
  margin-top: 0;
}

.map-editor-draft-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  padding: 0.75rem;
  border-bottom: 1px solid var(--map-editor-border);
}

.map-editor-draft-stats div {
  display: grid;
  gap: 0.15rem;
  padding: 0.5rem;
  border: 1px solid var(--map-editor-border);
  border-radius: 8px;
  text-align: center;
}

.map-editor-draft-stats span {
  font-size: 0.6875rem;
  color: var(--map-editor-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.map-editor-draft-stats strong {
  font-size: 1rem;
  color: var(--map-editor-text);
}

.map-editor-inspector-empty {
  padding: 1rem;
  font-size: 0.8125rem;
  color: var(--map-editor-muted);
}

.map-editor-inspector-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0;
}

.map-editor-inspector-form > .mud-button-root,
.map-editor-inspector-form > .map-editor-inspector-actions {
  margin: 0 0.75rem 0.75rem;
}

.map-editor-inspector-panels,
.map-editor-accordion-panels {
  background: transparent;
}

.map-editor-inspector-panels .mud-expand-panel,
.map-editor-accordion-panels .mud-expand-panel {
  border-bottom: 1px solid var(--map-editor-border);
  background: transparent;
}

.map-editor-inspector-panels .mud-expand-panel-header,
.map-editor-accordion-panels .mud-expand-panel-header {
  min-height: 2.25rem;
  padding: 0 0.75rem;
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--map-editor-muted);
}

.map-editor-inspector-panels .mud-expand-panel-content,
.map-editor-accordion-panels .mud-expand-panel-content {
  padding: 0.5rem 0.75rem 0.75rem;
}

.map-editor-inspector-panel-body,
.map-editor-sidebar-panel-body {
  display: grid;
  gap: 0.65rem;
}

.map-editor-sidebar-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.map-editor-sidebar-defaults-link {
  justify-self: start;
  padding-inline: 0.25rem;
}

.map-editor-accordion-title {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  min-width: 0;
}

.map-editor-accordion-title .material-symbols-rounded {
  font-size: 1rem;
  color: var(--map-editor-accent);
}

.map-editor-layer-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8125rem;
  color: var(--map-editor-text);
}

.map-editor-layer-toggle-row .map-editor-layer-count {
  margin-left: auto;
}

.map-editor-reference-toolbar .mud-icon-button-root {
  margin-left: auto;
}

.map-editor-reference-toolbar.is-selected {
  border-radius: var(--radius-sm, 4px);
  background: var(--map-editor-selection-bg, color-mix(in srgb, var(--map-editor-accent) 16%, transparent));
  outline: 1px solid color-mix(in srgb, var(--map-editor-accent) 45%, transparent);
  padding: 0.15rem 0.25rem;
}

.map-editor-sidebar-panel-body .map-editor-layer-opacity {
  margin: 0;
  padding: 0 0.25rem;
}

.map-editor-route-lock-scale {
  margin-top: 0.35rem;
}

.map-editor-sidebar-panel-body .map-editor-route-test-hint {
  margin: 0.15rem 0 0;
  font-size: 0.6875rem;
  line-height: 1.35;
  color: var(--map-editor-muted);
}

.map-editor-inspector-section {
  margin-top: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--map-editor-muted);
}

.map-editor-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.map-editor-header-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
}

.map-editor-header-preview-overlay {
  flex: 0 0 auto;
  margin: 0;
  white-space: nowrap;
}

.map-editor-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--map-editor-border);
  font-size: 0.75rem;
  color: var(--map-editor-muted);
}

.map-editor-status-pill__icon {
  font-size: 1rem;
  line-height: 1;
}

.map-editor-status-pill__spinner {
  width: 0.85rem;
  height: 0.85rem;
  border: 2px solid var(--map-editor-border);
  border-top-color: var(--map-editor-accent, var(--color-primary, #2563eb));
  border-radius: 50%;
  animation: map-editor-status-spin 0.7s linear infinite;
}

.map-editor-status-pill__spinner[hidden],
.map-editor-status-pill__icon[hidden] {
  display: none !important;
}

@keyframes map-editor-status-spin {
  to {
    transform: rotate(360deg);
  }
}

.map-editor-layout {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(240px, 300px);
  grid-template-rows: minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

/* Desktop shell: keep 3 columns even if a later rule regresses. */
.map-editor-root.is-fullscreen > .map-editor-layout {
  display: grid !important;
  grid-template-columns: minmax(220px, 260px) minmax(0, 1fr) minmax(240px, 300px) !important;
  grid-template-rows: minmax(0, 1fr) !important;
}

.map-editor-sidebar,
.map-editor-inspector {
  overflow: auto;
  border-color: var(--map-editor-border);
  background: var(--map-editor-surface);
}

.map-editor-sidebar {
  border-right: 1px solid var(--map-editor-border);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.map-editor-settings-subtitle {
  margin: 0.65rem 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--map-editor-muted);
}

.map-editor-settings-hint {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  color: var(--map-editor-muted);
}

.map-editor-settings-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.35rem 0 0.65rem;
}

.map-editor-settings-upload {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  margin: 0.35rem 0;
  padding: 0.35rem 0.75rem;
  border: 1px dashed var(--map-editor-border);
  border-radius: 8px;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--map-editor-text, inherit);
}

.map-editor-settings-upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.map-editor-settings-upload.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.map-editor-settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.65rem;
}

.map-editor-settings-feedback {
  padding: 0.75rem;
  border-top: 1px solid var(--map-editor-border);
  flex-shrink: 0;
}

.map-editor-settings-footer {
  margin-top: auto;
  padding: 0.75rem;
  border-top: 1px solid var(--map-editor-border);
  flex-shrink: 0;
}

.map-editor-inspector {
  border-left: 1px solid var(--map-editor-border);
}

.map-editor-panel-title {
  margin: 0;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--map-editor-border);
}

.map-editor-layer-list {
  display: grid;
  gap: 0.35rem;
  padding: 0.75rem;
}

.map-editor-layer-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--map-editor-border);
  border-radius: 8px;
  font-size: 0.8125rem;
  color: var(--map-editor-muted);
}

.map-editor-layer-count {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--map-editor-text);
}

.map-editor-layer-item .material-symbols-rounded {
  font-size: 1.125rem;
  color: var(--map-editor-accent);
}

.map-editor-canvas-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.map-editor-canvas-column.is-toolbar-grouped,
.map-editor-canvas-column.has-toolbar-flyout {
  overflow: visible;
}

.map-editor-toolbar {
  --map-editor-toolbar-row-height: 2.25rem;
  --map-editor-toolbar-rows: 3;
  --map-editor-toolbar-gap: 0.35rem;
  --map-editor-toolbar-pad-y: 0.5rem;
  /* Extra slack so 3 button rows never clip / never need a scrollbar. */
  --map-editor-toolbar-safety: 0.35rem;
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: flex-start;
  gap: var(--map-editor-toolbar-gap);
  row-gap: var(--map-editor-toolbar-gap);
  padding: var(--map-editor-toolbar-pad-y) 0.75rem;
  height: calc(
    (var(--map-editor-toolbar-row-height) * var(--map-editor-toolbar-rows))
    + (var(--map-editor-toolbar-gap) * (var(--map-editor-toolbar-rows) - 1))
    + (var(--map-editor-toolbar-pad-y) * 2)
    + var(--map-editor-toolbar-safety)
    + 1px
  );
  min-height: calc(
    (var(--map-editor-toolbar-row-height) * var(--map-editor-toolbar-rows))
    + (var(--map-editor-toolbar-gap) * (var(--map-editor-toolbar-rows) - 1))
    + (var(--map-editor-toolbar-pad-y) * 2)
    + var(--map-editor-toolbar-safety)
    + 1px
  );
  max-height: calc(
    (var(--map-editor-toolbar-row-height) * var(--map-editor-toolbar-rows))
    + (var(--map-editor-toolbar-gap) * (var(--map-editor-toolbar-rows) - 1))
    + (var(--map-editor-toolbar-pad-y) * 2)
    + var(--map-editor-toolbar-safety)
    + 1px
  );
  flex-shrink: 0;
  overflow: hidden;
  overflow-x: hidden;
  overflow-y: hidden;
  border-bottom: 1px solid var(--map-editor-border);
  background: var(--map-editor-surface);
  box-sizing: border-box;
}

.map-editor-toolbar.is-layout-compact {
  --map-editor-toolbar-rows: 1;
  --map-editor-toolbar-pad-y: 0.35rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
}

.map-editor-toolbar.is-layout-grouped {
  --map-editor-toolbar-rows: 1;
  --map-editor-toolbar-pad-y: 0.35rem;
  flex-wrap: nowrap;
  overflow: visible;
  overflow-x: auto;
  overflow-y: visible;
  z-index: 4;
}


.map-editor-toolbar.is-layout-compact .map-editor-tool-btn > span:not(.material-symbols-rounded),
.map-editor-toolbar.is-layout-compact .map-editor-toolbar-layout-btn > span:not(.material-symbols-rounded) {
  display: none;
}

.map-editor-toolbar.is-layout-compact .map-editor-tool-btn,
.map-editor-toolbar.is-layout-compact .map-editor-toolbar-layout-btn {
  padding: 0 0.45rem;
  min-width: var(--map-editor-toolbar-row-height, 2.25rem);
  justify-content: center;
}

.map-editor-toolbar-group {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--map-editor-toolbar-gap);
  position: relative;
}

/* Full layout: keep 3-row toolbar, but do not break by group blocks. */
.map-editor-toolbar.is-layout-full .map-editor-toolbar-group.is-flat-mode {
  display: contents;
}

.map-editor-toolbar.is-layout-full .map-editor-toolbar-group.is-flat-mode::before {
  content: none;
}

.map-editor-toolbar-group.is-flat-mode + .map-editor-toolbar-group.is-flat-mode::before {
  content: "";
  display: block;
  width: 1px;
  align-self: stretch;
  margin: 0.2rem 0.1rem;
  background: var(--map-editor-border);
  flex-shrink: 0;
}

.map-editor-toolbar.is-layout-grouped .map-editor-toolbar-group {
  flex-wrap: nowrap;
}

.map-editor-toolbar-group-trigger .map-editor-toolbar-group-chevron {
  font-size: 1rem;
  opacity: 0.7;
}

.map-editor-toolbar-group-trigger.is-open .map-editor-toolbar-group-chevron {
  transform: rotate(180deg);
}

.map-editor-toolbar-flyout {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  gap: var(--map-editor-toolbar-gap);
  max-width: min(28rem, 80vw);
  padding: 0.5rem;
  border: 1px solid var(--map-editor-border);
  border-radius: 10px;
  background: var(--map-editor-surface);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.18));
}

.map-editor-toolbar-flyout .map-editor-transform-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--map-editor-toolbar-gap);
}

.map-editor-toolbar-dismiss {
  position: fixed;
  inset: 0;
  z-index: 5;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: default;
}

.map-editor-toolbar-layout {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  margin-left: auto;
  padding: 0.15rem;
  border: 1px solid var(--map-editor-border);
  border-radius: 10px;
  background: color-mix(in srgb, var(--map-editor-surface) 88%, var(--map-editor-border));
  flex-shrink: 0;
}

.map-editor-toolbar-layout-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  height: calc(var(--map-editor-toolbar-row-height, 2.25rem) - 0.3rem);
  padding: 0 0.5rem;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--map-editor-muted);
  font-size: 0.75rem;
  cursor: pointer;
}

.map-editor-toolbar-layout-btn .material-symbols-rounded {
  font-size: 1.05rem;
}

.map-editor-toolbar-layout-btn:hover:not(:disabled) {
  color: var(--map-editor-text);
}

.map-editor-toolbar-layout-btn.is-active {
  border-color: var(--map-editor-accent);
  color: var(--map-editor-accent);
  background: color-mix(in srgb, var(--map-editor-accent) 12%, transparent);
}

.map-editor-sidebar-upload {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.5rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--map-editor-border);
  border-radius: 8px;
  color: var(--map-editor-muted);
  font-size: 0.8125rem;
  cursor: pointer;
}

.map-editor-sidebar-upload .material-symbols-rounded {
  font-size: 1.125rem;
}

.map-editor-sidebar-upload:hover:not(.is-disabled) {
  border-color: var(--map-editor-accent);
  color: var(--map-editor-text);
}

.map-editor-sidebar-upload.is-disabled {
  opacity: 0.55;
  pointer-events: none;
  cursor: default;
}

.map-editor-sidebar-upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.map-editor-transform-bar {
  display: contents;
}

.map-editor-layer-item--toggle {
  gap: 0.35rem;
}

.map-editor-layer-opacity {
  margin: -0.15rem 0 0.35rem 0.35rem;
  padding: 0 0.5rem 0.25rem 1.75rem;
}

.map-editor-layer-item--muted {
  opacity: 0.55;
}

.map-editor-shape-tree {
  display: grid;
  gap: 0.25rem;
  margin: 0 0.75rem 0.5rem 1.75rem;
  max-height: 12rem;
  overflow: auto;
}

.map-editor-floor-list {
  display: grid;
  gap: 0.25rem;
  margin: 0 0.5rem 0.5rem;
  max-height: 16rem;
  overflow: auto;
}

.map-editor-floor-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  width: 100%;
  padding: 0.15rem 0.25rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--map-editor-text);
  font-size: 0.75rem;
}

.map-editor-floor-list-button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  padding: 0.2rem 0.35rem;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font-size: inherit;
  text-align: left;
  cursor: pointer;
}

.map-editor-floor-list-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-editor-floor-list-flags {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
  flex-shrink: 0;
}

.map-editor-floor-list-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--map-editor-muted, var(--color-muted));
  cursor: pointer;
}

.map-editor-floor-list-flag:hover:not(:disabled) {
  color: var(--map-editor-text);
  background: color-mix(in srgb, var(--map-editor-text) 8%, transparent);
}

.map-editor-floor-list-flag.is-off {
  color: var(--map-editor-muted, var(--color-muted));
  opacity: 0.55;
}

.map-editor-floor-list-flag.is-danger:hover:not(:disabled) {
  color: var(--color-danger, #c62828);
}

.map-editor-floor-list-flag:disabled {
  opacity: 0.4;
  cursor: default;
}

.map-editor-floor-list-flag .material-symbols-rounded {
  font-size: 1rem;
}

.map-editor-floor-list-item.is-hidden .map-editor-floor-list-name {
  opacity: 0.55;
  text-decoration: line-through;
}

.map-editor-floor-list-item:hover,
.map-editor-floor-list-item.is-selected {
  background: color-mix(in srgb, var(--map-editor-accent, var(--color-accent)) 8%, transparent);
}

.map-editor-floor-list-item.is-selected {
  border-color: color-mix(in srgb, var(--map-editor-accent, var(--color-accent)) 35%, transparent);
}

.map-editor-floor-list-button:hover {
  background: color-mix(in srgb, var(--map-editor-text) 6%, transparent);
}

.map-editor-shape-tree-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  width: 100%;
  padding: 0.15rem 0.25rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--map-editor-text);
  font-size: 0.75rem;
}

.map-editor-shape-tree-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
  padding: 0.2rem 0.35rem;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font-size: inherit;
  text-align: left;
  cursor: pointer;
}

.map-editor-shape-tree-flags {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  flex-shrink: 0;
}

.map-editor-shape-tree-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--map-editor-muted, var(--map-editor-text));
  cursor: pointer;
}

.map-editor-shape-tree-flag:hover:not(:disabled) {
  color: var(--map-editor-text);
  background: var(--map-editor-hover-bg, rgb(255 255 255 / 0.06));
}

.map-editor-shape-tree-flag.is-off {
  color: var(--map-editor-muted, var(--map-editor-text));
  opacity: 0.85;
}

.map-editor-shape-tree-flag:disabled {
  opacity: 0.45;
  cursor: default;
}

.map-editor-shape-tree-flag .material-symbols-rounded {
  font-size: 1rem;
}

.map-editor-shape-tree-item.is-hidden .map-editor-shape-tree-name {
  opacity: 0.55;
}

.map-editor-shape-tree-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.map-editor-shape-tree-tools,
.map-editor-layer-search-tools {
  display: grid;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem 0.25rem;
}

/* Shared layer list search + inline filter (Shapes tree, POI layer). */
.map-editor-layer-search {
  position: relative;
  width: 100%;
  min-width: 0;
}

.map-editor-layer-search .mud-input-control {
  width: 100%;
  margin: 0;
}

.map-editor-layer-search .mud-input-adornment {
  color: var(--map-editor-muted);
}

.map-editor-layer-search .mud-input > input {
  padding-inline-end: 2.25rem;
}

.map-editor-layer-search .mud-input > input::placeholder {
  color: var(--map-editor-muted);
  opacity: 1;
}

.map-editor-layer-filter-menu {
  position: absolute;
  inset-inline-end: 0.15rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

.map-editor-layer-filter-button {
  width: 1.75rem;
  height: 1.75rem;
  min-width: 1.75rem;
  min-height: 1.75rem;
  padding: 0;
  border: none !important;
  box-shadow: none !important;
  background: transparent !important;
  color: var(--map-editor-muted);
}

.map-editor-layer-filter-button:hover,
.map-editor-layer-filter-button:focus-visible {
  color: var(--map-editor-text, inherit);
  background: transparent !important;
}

.map-editor-layer-filter-button .mud-icon-root,
.map-editor-layer-filter-button .mud-button-label {
  font-size: 1.125rem;
}

.map-editor-layer-warning {
  margin-left: auto;
  min-width: 1.25rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--color-warning, #f59e0b);
  color: var(--color-on-warning, #111827);
  font-size: 0.68rem;
  font-weight: 600;
  text-align: center;
}

.map-editor-poi-panel {
  display: grid;
  gap: 0.65rem;
  padding: 0;
}

.map-editor-poi-panel .map-editor-layer-search-tools {
  margin: 0;
}

.map-editor-poi-panel > .mud-alert,
.map-editor-poi-panel > .map-editor-route-test-hint {
  margin-inline: 0.5rem;
}

.map-editor-poi-list {
  display: grid;
  gap: 0.25rem;
  padding: 0 0.5rem 0.5rem;
}

.map-editor-poi-list-item {
  display: grid;
  gap: 0.15rem;
}

.map-editor-poi-list-item.has-error .map-editor-poi-list-button {
  border-color: var(--color-warning, #f59e0b);
}

.map-editor-poi-list-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--map-editor-border);
  border-radius: var(--radius-sm, 0.35rem);
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.map-editor-poi-list-button:hover {
  background: var(--map-editor-hover-bg, rgb(255 255 255 / 0.06));
}

.map-editor-poi-badge {
  font-size: 0.65rem;
  opacity: 0.85;
}

.map-editor-shape-tree-item:hover,
.map-editor-shape-tree-item.is-selected {
  background: var(--map-editor-surface-raised, rgba(255, 255, 255, 0.04));
  border-color: var(--map-editor-border, rgba(255, 255, 255, 0.08));
}

.map-editor-shape-tree-item.is-selected {
  border-color: var(--map-editor-accent);
  background: color-mix(in srgb, var(--map-editor-accent) 10%, transparent);
}

.map-editor-shape-tree-button:hover {
  background: transparent;
}

.map-editor-shape-tree-type {
  font-size: 0.6875rem;
  color: var(--map-editor-muted);
  text-transform: uppercase;
}

.map-editor-plan-upload {
  position: relative;
  cursor: pointer;
}

.map-editor-plan-upload.is-disabled {
  opacity: 0.55;
  pointer-events: none;
  cursor: default;
}

.map-editor-plan-upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.map-editor-plan-upload.is-disabled input[type="file"] {
  cursor: default;
}

.map-editor-tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: var(--map-editor-toolbar-row-height, 2.25rem);
  box-sizing: border-box;
  padding: 0 0.65rem;
  border: 1px solid var(--map-editor-border);
  border-radius: 8px;
  background: transparent;
  color: var(--map-editor-muted);
  font-size: 0.8125rem;
  cursor: pointer;
  flex-shrink: 0;
}

.map-editor-tool-btn .material-symbols-rounded {
  font-size: 1.125rem;
}

/* Direct Select: same near_me cursor as Select, solid fill (stroke color). */
.map-editor-tool-btn .map-editor-tool-icon-svg {
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  display: block;
}

.map-editor-tool-btn:hover:not(:disabled) {
  border-color: var(--map-editor-accent);
  color: var(--map-editor-text);
}

.map-editor-tool-btn.is-active {
  border-color: var(--map-editor-accent);
  color: var(--map-editor-accent);
  background: color-mix(in srgb, var(--map-editor-accent) 12%, transparent);
}

.map-editor-tool-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.map-editor-route-hint {
  padding: 0.35rem 0.75rem;
  border-bottom: 1px solid var(--map-editor-border);
  font-size: 0.75rem;
  color: var(--color-danger, #f87171);
  background: color-mix(in srgb, var(--color-danger, #f87171) 8%, transparent);
}

.map-editor-canvas-toasts {
  position: absolute;
  z-index: 6;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.4rem;
  width: min(28rem, calc(100% - 1.5rem));
  pointer-events: none;
}

.map-editor-canvas-toast {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.5rem 0.5rem 0.75rem;
  border: 1px solid var(--map-editor-border);
  border-radius: 8px;
  font-size: 0.75rem;
  line-height: 1.35;
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.28));
  pointer-events: auto;
  backdrop-filter: blur(8px);
}

.map-editor-canvas-toast > span {
  flex: 1 1 auto;
  min-width: 0;
  padding-top: 0.1rem;
}

.map-editor-canvas-toast--error {
  color: var(--color-danger, #f87171);
  border-color: color-mix(in srgb, var(--color-danger, #f87171) 45%, var(--map-editor-border));
  background: color-mix(in srgb, var(--color-danger, #f87171) 16%, var(--map-editor-surface));
}

.map-editor-canvas-toast--info {
  color: var(--map-editor-text);
  background: color-mix(in srgb, var(--map-editor-surface) 92%, transparent);
}

.map-editor-canvas-toast--warning {
  color: var(--color-warning, #fbbf24);
  border-color: color-mix(in srgb, var(--color-warning, #fbbf24) 45%, var(--map-editor-border));
  background: color-mix(in srgb, var(--color-warning, #fbbf24) 14%, var(--map-editor-surface));
}

.map-editor-canvas-toast--action {
  background: color-mix(in srgb, var(--map-editor-surface) 92%, transparent);
}

.map-editor-canvas-toast-dismiss {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  align-self: flex-start;
  margin: 0;
  padding: 0.1rem;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  line-height: 1;
}

.map-editor-canvas-toast-dismiss:hover {
  background: color-mix(in srgb, currentColor 12%, transparent);
}

.map-editor-canvas-toast-dismiss .material-symbols-rounded {
  font-size: 1rem;
}

.map-editor-canvas-toast-action {
  flex: 1 1 auto;
  border: none;
  background: transparent;
  color: var(--map-editor-accent);
  font: inherit;
  cursor: pointer;
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.map-editor-canvas-toast-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  text-decoration: none;
}

.map-editor-route-test {
  display: grid;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--map-editor-border);
}

.map-editor-route-test-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--map-editor-muted);
}

.map-editor-extrude-preview {
  display: grid;
  gap: 0.35rem;
  justify-items: center;
  padding: 0.5rem 0;
}

.map-editor-extrude-preview-label {
  margin: 0;
  font-size: 0.7rem;
  color: var(--map-editor-muted);
}

.map-editor-extrude-preview-stage {
  width: 72px;
  height: 72px;
  perspective: 220px;
  display: grid;
  place-items: center;
}

.map-editor-extrude-preview-cube {
  width: 36px;
  height: 36px;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 120ms ease-out;
}

.map-editor-extrude-preview-face {
  position: absolute;
  inset: 0;
  border: 1px solid color-mix(in srgb, var(--map-editor-accent, #60a5fa) 70%, transparent);
  background: color-mix(in srgb, var(--map-editor-accent, #60a5fa) 18%, transparent);
  opacity: 0.92;
}

.map-editor-extrude-preview-face.front {
  transform: translateZ(18px);
}

.map-editor-extrude-preview-face.back {
  transform: rotateY(180deg) translateZ(18px);
}

.map-editor-extrude-preview-face.right {
  transform: rotateY(90deg) translateZ(18px);
}

.map-editor-extrude-preview-face.left {
  transform: rotateY(-90deg) translateZ(18px);
}

.map-editor-extrude-preview-face.top {
  transform: rotateX(90deg) translateZ(18px);
}

.map-editor-extrude-preview-face.bottom {
  transform: rotateX(-90deg) translateZ(18px);
}

.map-editor-route-test-result {
  font-size: 0.75rem;
  color: var(--map-editor-text);
}

.map-editor-route-qr {
  display: grid;
  gap: 0.35rem;
  justify-items: start;
}

.map-editor-route-qr-link {
  font-size: 0.75rem;
  color: var(--color-link, var(--color-primary, #60a5fa));
}

.map-editor-transitions,
.map-editor-diagnostics {
  display: grid;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--map-editor-border);
}

.map-editor-accordion-panels .map-editor-transitions {
  border-top: none;
  padding: 0;
}

.map-editor-sidebar-panel-body .map-editor-shape-tree {
  margin: 0;
  max-height: 14rem;
}

.map-editor-sidebar-panel-body .map-editor-floor-list {
  margin: 0 0 0.5rem;
  max-height: 16rem;
}

.map-editor-sidebar-panel-body .map-editor-shape-tree-tools,
.map-editor-sidebar-panel-body .map-editor-layer-search-tools {
  margin: 0;
}

.map-editor-transition-list,
.map-editor-diagnostics-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.map-editor-transition-item {
  display: grid;
  gap: 0.35rem;
  font-size: 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--map-editor-border);
}

.map-editor-transition-legs {
  list-style: none;
  margin: 0;
  padding: 0 0 0 0.5rem;
  display: grid;
  gap: 0.2rem;
}

.map-editor-transition-leg-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--map-editor-accent, #60a5fa);
  cursor: pointer;
  font-size: 0.72rem;
  text-align: left;
}

.map-editor-transition-leg-link:hover {
  text-decoration: underline;
}

.map-editor-transition-type {
  display: block;
  color: var(--map-editor-muted);
  font-size: 0.7rem;
}

.map-editor-diagnostic-item {
  font-size: 0.75rem;
  line-height: 1.35;
}

.map-editor-diagnostic-item--error {
  color: var(--color-danger, #f87171);
}

.map-editor-diagnostic-item--warning {
  color: var(--color-warning, #fbbf24);
}

.map-editor-diagnostic-button {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  cursor: pointer;
}

.map-editor-diagnostic-item.is-clickable .map-editor-diagnostic-button:hover {
  text-decoration: underline;
}

.map-editor-diagnostic-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1, 4px);
  margin-top: var(--space-1, 4px);
}

.map-editor-diagnostic-action {
  font-size: 0.6875rem;
  padding: 2px 6px;
  border: 1px solid var(--color-border, #334155);
  border-radius: var(--radius-sm, 4px);
  background: var(--color-surface-2, #1e293b);
  color: var(--color-text, #e2e8f0);
  cursor: pointer;
}

.map-editor-diagnostic-action:hover {
  border-color: var(--color-primary, #38bdf8);
}

.map-editor-header-hint {
  font-size: 0.75rem;
  color: var(--color-text-muted, #94a3b8);
  max-width: 14rem;
}

.map-editor-edit-lock-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm, 4px);
  background: color-mix(in srgb, var(--color-warning, #fbbf24) 20%, transparent);
  color: var(--color-text, #f8fafc);
  font-size: 0.75rem;
}

.map-editor-publish-history-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.map-editor-publish-export {
  margin-top: 0.5rem;
}

.map-editor-interaction-preview {
  position: absolute;
  z-index: 20;
  min-width: 12rem;
  max-width: 16rem;
  padding: 0.65rem 1.75rem 0.65rem 0.75rem;
  border-radius: var(--radius-md, 0.5rem);
  border: 1px solid var(--map-editor-border);
  background: var(--map-editor-panel-bg, var(--color-surface, #111827));
  box-shadow: var(--shadow-md, 0 8px 24px rgb(0 0 0 / 0.25));
  pointer-events: none;
}

.map-editor-interaction-preview__close,
.map-editor-kiosk-preview__close {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--map-editor-muted, #94a3b8);
  cursor: pointer;
  pointer-events: auto;
  line-height: 1;
  font-size: 1.1rem;
}

.map-editor-interaction-preview__close:hover,
.map-editor-kiosk-preview__close:hover {
  color: var(--map-editor-text, #f8fafc);
  background: color-mix(in srgb, currentColor 12%, transparent);
}

.map-editor-interaction-preview__title {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.85rem;
}

.map-editor-interaction-preview__body {
  font-size: 0.78rem;
  color: var(--color-text-muted, #94a3b8);
  white-space: pre-wrap;
}

.map-editor-interaction-preview__action {
  margin-top: 0.5rem;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm, 0.35rem);
  border: 1px solid var(--map-editor-border);
  background: var(--color-primary, #6366f1);
  color: var(--color-on-primary, #fff);
  font-size: 0.75rem;
}

.map-editor-press-popup {
  position: absolute;
  inset: 0;
  z-index: 24;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: transparent;
  pointer-events: auto;
}

.map-editor-press-popup .map-studio-canvas-popup-inner {
  position: relative;
  max-width: min(26.25rem, 100%);
  max-height: 100%;
  border-radius: 1rem;
  filter:
    drop-shadow(0 22px 28px rgb(0 0 0 / 0.42))
    drop-shadow(0 6px 12px rgb(0 0 0 / 0.28));
}

.map-editor-press-popup .map-studio-canvas-popup-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  width: 2rem;
  height: 2rem;
  border: 1px solid color-mix(in srgb, var(--kiosk-white, #fff) 18%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--kiosk-card-bg, #1f2937) 45%, transparent);
  color: var(--kiosk-white, #fff);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.map-editor-press-popup .map-studio-poi-card-btn {
  pointer-events: auto;
  cursor: pointer;
  border: none;
}

.map-editor-press-route-start-backdrop {
  position: absolute;
  inset: 0;
  z-index: 26;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  pointer-events: auto;
  background: color-mix(in srgb, var(--color-bg, #0f172a) 35%, transparent);
}

.map-editor-press-route-start {
  position: relative;
  width: min(22rem, 100%);
  max-height: min(60vh, 24rem);
  overflow: auto;
  padding: 1rem 1rem 0.75rem;
  border-radius: var(--radius-md, 0.75rem);
  border: 1px solid var(--map-editor-border, rgba(148, 163, 184, 0.25));
  background: var(--map-editor-panel-bg, rgba(15, 23, 42, 0.96));
  box-shadow: var(--shadow-lg, 0 16px 40px rgba(0, 0, 0, 0.35));
}

.map-editor-press-route-start__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  border-radius: var(--radius-sm, 0.35rem);
  background: transparent;
  color: var(--map-editor-muted, #94a3b8);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.map-editor-press-route-start__title {
  margin: 0 2rem 0.35rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text, #e2e8f0);
}

.map-editor-press-route-start__target {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  color: var(--color-text-muted, #94a3b8);
}

.map-editor-press-route-start__list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.map-editor-press-route-start__item {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--map-editor-border, rgba(148, 163, 184, 0.25));
  border-radius: var(--radius-sm, 0.35rem);
  background: var(--color-surface, rgba(30, 41, 59, 0.65));
  color: var(--color-text, #e2e8f0);
  text-align: left;
  cursor: pointer;
  font-size: 0.875rem;
}

.map-editor-press-route-start__item:hover {
  border-color: var(--color-primary, #6366f1);
  background: color-mix(in srgb, var(--color-primary, #6366f1) 12%, transparent);
}

.map-editor-press-transition-backdrop {
  position: absolute;
  inset: 0;
  z-index: 27;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  pointer-events: auto;
  background: color-mix(in srgb, var(--color-bg, #0f172a) 35%, transparent);
}

.map-editor-press-transition {
  position: relative;
  width: min(20rem, 100%);
  padding: 1rem 1rem 0.85rem;
  border-radius: var(--radius-md, 0.75rem);
  border: 1px solid var(--map-editor-border, rgba(148, 163, 184, 0.25));
  background: var(--map-editor-panel-bg, rgba(15, 23, 42, 0.96));
  box-shadow: var(--shadow-lg, 0 16px 40px rgba(0, 0, 0, 0.35));
}

.map-editor-press-transition__close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border: none;
  border-radius: var(--radius-sm, 0.35rem);
  background: transparent;
  color: var(--map-editor-muted, #94a3b8);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
}

.map-editor-press-transition__title {
  margin: 0 2rem 0.5rem 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-text, #e2e8f0);
}

.map-editor-press-transition__copy {
  margin: 0 0 0.85rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--color-text-muted, #94a3b8);
}

.map-editor-press-transition__action {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--color-primary, #6366f1);
  border-radius: var(--radius-sm, 0.35rem);
  background: color-mix(in srgb, var(--color-primary, #6366f1) 18%, transparent);
  color: var(--color-text, #e2e8f0);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.map-editor-press-transition__action:hover {
  background: color-mix(in srgb, var(--color-primary, #6366f1) 28%, transparent);
}

.map-editor-kiosk-preview {
  position: absolute;
  z-index: 12;
  pointer-events: none;
}

.map-editor-kiosk-preview__bezel {
  position: relative;
  width: 200px;
  padding: 0.5rem;
  border-radius: var(--radius-md, 0.5rem);
  border: 2px solid var(--map-editor-border);
  background: var(--map-editor-surface, #162033);
  box-shadow: var(--shadow-md, 0 8px 24px rgba(0, 0, 0, 0.35));
}

.map-editor-kiosk-preview__header {
  display: block;
  font-size: 0.7rem;
  color: var(--map-editor-muted);
  margin-bottom: 0.35rem;
}

.map-editor-kiosk-preview__title {
  display: block;
  font-size: 0.85rem;
}

.map-editor-kiosk-preview__meta {
  margin: 0.25rem 0 0.5rem;
  font-size: 0.72rem;
  color: var(--map-editor-muted);
}

.map-editor-kiosk-preview__map {
  height: 72px;
  border-radius: var(--radius-sm, 0.35rem);
  border: 1px dashed var(--map-editor-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--map-editor-muted);
  background: color-mix(in srgb, var(--map-editor-accent) 12%, transparent);
}

.map-editor-diagnostic-code {
  display: block;
  font-family: var(--font-mono, monospace);
  font-size: 0.68rem;
  opacity: 0.85;
}

.map-editor-publish-panel {
  margin: 0 0.75rem 0.75rem;
  padding: 0.75rem;
  border: 1px solid var(--map-editor-border);
  border-radius: var(--radius-md, 0.5rem);
  background: var(--map-editor-panel-bg, var(--color-surface, #111827));
  display: grid;
  gap: 0.75rem;
}

.map-editor-publish-heading {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.map-editor-publish-heading small {
  display: block;
  color: var(--map-editor-muted);
  font-size: 0.75rem;
}

.map-editor-publish-diff,
.map-editor-publish-history {
  display: grid;
  gap: 0.35rem;
}

.map-editor-rollout-panel {
  display: grid;
  gap: 0.35rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--map-editor-border);
}

.map-editor-rollout-summary {
  margin: 0;
  font-size: 0.8rem;
  color: var(--map-editor-muted);
}

.map-editor-publish-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.75rem;
  color: var(--map-editor-muted);
}

.map-editor-published-badge {
  align-self: center;
  font-size: 0.75rem;
  color: var(--color-success, #34d399);
}

.map-editor-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
  background:
    linear-gradient(var(--map-editor-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--map-editor-border) 1px, transparent 1px),
    var(--map-editor-canvas-bg);
  background-size: 24px 24px, 24px 24px, auto;
}

.map-editor-canvas-wrap canvas {
  display: block;
}

.map-editor-canvas-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  max-width: 20rem;
  padding: 0.75rem 1rem;
  border: 1px dashed var(--map-editor-border);
  border-radius: 8px;
  font-size: 0.8125rem;
  text-align: center;
  color: var(--map-editor-muted);
  pointer-events: none;
}

.map-editor-spa-bottom {
  --map-editor-level-space: clamp(44px, 13vw, 84px);
  --map-editor-bb-size: min(72px, calc((100vw - var(--map-editor-level-space)) / 5));

  flex-shrink: 0;
  height: 64px;
  width: 100%;
  max-width: 100%;
  background: linear-gradient(
    90deg,
    color-mix(in oklab, var(--kiosk-accent-deep) 70%, black) 0%,
    var(--kiosk-accent-deep) 50%,
    color-mix(in oklab, var(--kiosk-accent-deep) 85%, black) 100%
  );
  border-radius: var(--kiosk-nav-panel-radius, 0px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--kiosk-white);
  font-family: var(--kiosk-font);
  user-select: none;
  overflow: hidden;
}

.map-editor-spa-bottom-side {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
}

.map-editor-spa-bottom-side.right {
  justify-content: flex-end;
}

.map-editor-spa-bb-btn {
  flex: 0 1 var(--map-editor-bb-size);
  width: var(--map-editor-bb-size);
  max-width: 72px;
  min-width: 0;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  appearance: none;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: background 0.15s ease;
  padding: 0;
}

.map-editor-spa-bb-btn:hover:not(:disabled) {
  background: rgba(0, 0, 0, 0.12);
}

.map-editor-spa-bb-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.map-editor-spa-bb-btn svg {
  width: min(26px, 62%);
  height: min(26px, 62%);
  stroke: var(--kiosk-white);
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-editor-spa-bb-btn.target svg {
  stroke-width: 1.8;
}

.map-editor-spa-level {
  flex: 0 1 var(--map-editor-level-space);
  width: var(--map-editor-level-space);
  min-width: 0;
  box-sizing: border-box;
  padding: 0 clamp(4px, 2vw, 20px);
  font-size: 22px;
  font-weight: 300;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-editor-empty-stage {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.map-editor-empty-inner {
  max-width: 28rem;
  text-align: center;
  display: grid;
  gap: 0.75rem;
}

.map-editor-empty-inner .material-symbols-rounded {
  font-size: 3rem;
  color: var(--map-editor-accent);
}

.map-editor-tile-accent {
  background:
    radial-gradient(circle at 88% 12%, color-mix(in srgb, var(--map-editor-accent) 22%, transparent), transparent 32%),
    var(--color-surface);
}

@media (max-width: 1024px) {
  .map-editor-layout,
  .map-editor-root.is-fullscreen > .map-editor-layout {
    grid-template-columns: 1fr !important;
    grid-template-rows: minmax(0, 12rem) minmax(280px, 1fr) minmax(0, 12rem) !important;
  }

  .map-editor-sidebar,
  .map-editor-inspector {
    max-height: 12rem;
  }
}

/* Inspector field rows — label left, control right (color picker is the reference). */
.map-editor-field-row,
.map-editor-color-field {
  position: relative;
  display: grid;
  grid-template-columns: minmax(5.5rem, 38%) minmax(0, 1fr);
  align-items: center;
  gap: 0.65rem;
  margin: 0.35rem 0;
}

.map-editor-field-row.is-tall {
  align-items: start;
}

.map-editor-field-row.is-tall .map-editor-field-label {
  padding-top: 0.5rem;
}

.map-editor-field-label,
.map-editor-color-label {
  font-size: 0.8125rem;
  color: var(--map-editor-muted);
}

.map-editor-field-control {
  min-width: 0;
  width: 100%;
}

.map-editor-icon-marker-icon-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  width: 100%;
}

.map-editor-icon-marker-icon-preview {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  line-height: 1;
  color: var(--map-editor-text, #f8fafc);
}

.map-editor-icon-marker-icon-preview svg {
  width: 1.35rem;
  height: 1.35rem;
  display: block;
  fill: currentColor;
}

.map-editor-icon-marker-icon-preview svg path {
  fill: currentColor;
}

.map-editor-icon-marker-icon-field .map-editor-field-input {
  flex: 1 1 auto;
  min-width: 0;
}

.map-editor-icon-marker-option {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  color: inherit;
}

.map-editor-icon-marker-option-preview {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  font-size: 1.15rem;
  line-height: 1;
  color: inherit;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 20;
}

.map-editor-icon-marker-option-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
}

.map-editor-icon-marker-select-popover .mud-list-item-text {
  overflow: visible;
}

/* Portaled autocomplete list: force scheme text on labels + Material glyphs (override Mud theme). */
body:has(.map-editor-root) .map-editor-icon-marker-select-popover .mud-paper,
body:has(.map-editor-root) .map-editor-icon-marker-select-popover .mud-list,
body:has(.map-editor-root) .map-editor-icon-marker-select-popover .mud-list-item,
body:has(.map-editor-root) .map-editor-icon-marker-select-popover .mud-list-item-text,
body:has(.map-editor-root) .map-editor-icon-marker-select-popover .mud-typography,
body:has(.map-editor-root) .map-editor-icon-marker-select-popover .map-editor-icon-marker-option,
body:has(.map-editor-root) .map-editor-icon-marker-select-popover .map-editor-icon-marker-option-preview,
body:has(.map-editor-root) .map-editor-icon-marker-select-popover .map-editor-icon-marker-option-label,
body:has(.map-editor-root) .map-editor-icon-marker-select-popover .material-symbols-rounded {
  color: var(--map-editor-text) !important;
}

.map-editor-icon-marker-custom {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  width: 100%;
  min-width: 0;
}

.map-editor-icon-marker-custom-preview {
  width: 2.25rem;
  height: 2.25rem;
  object-fit: contain;
  border: 1px solid var(--map-editor-border, color-mix(in srgb, var(--color-border) 55%, transparent));
  border-radius: var(--radius-sm, 6px);
  background: var(--map-editor-bg, var(--color-surface));
}

.map-editor-icon-marker-custom .map-editor-field-hint {
  font-size: 0.75rem;
  color: var(--map-editor-muted, var(--color-muted));
  line-height: 1.35;
}

.map-editor-icon-marker-custom .map-editor-sidebar-upload {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--map-editor-border, color-mix(in srgb, var(--color-border) 55%, transparent));
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  font-size: 0.8125rem;
}

.map-editor-icon-marker-custom .map-editor-sidebar-upload input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.map-editor-icon-marker-custom .map-editor-sidebar-upload.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.map-editor-color-field-control {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.map-editor-color-eyedropper {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--map-editor-field-height);
  height: var(--map-editor-field-height);
  padding: 0;
  border: 1px solid var(--map-editor-border);
  border-radius: var(--map-editor-field-radius);
  background: var(--map-editor-bg);
  color: var(--map-editor-text);
  cursor: pointer;
}

.map-editor-color-eyedropper .material-symbols-rounded {
  font-size: 1.125rem;
}

.map-editor-color-eyedropper:hover:not(:disabled) {
  border-color: var(--map-editor-accent);
  color: var(--map-editor-accent);
}

.map-editor-color-eyedropper.is-active {
  border-color: var(--map-editor-accent);
  color: var(--map-editor-accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--map-editor-accent) 45%, transparent);
}

.map-editor-color-eyedropper:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.map-editor-color-field-control .map-editor-color-preview {
  flex: 1 1 auto;
  min-width: 0;
}

.map-editor-field-control .mud-input-control,
.map-editor-field-control .map-editor-field-input.mud-input-control {
  width: 100%;
  min-height: 0;
  margin: 0 !important;
  padding: 0;
}

.map-editor-field-control .mud-input-root {
  margin-top: 0 !important;
}

.map-editor-field-control .mud-input-control-input-container {
  display: flex;
  align-items: center;
  width: 100%;
  height: var(--map-editor-field-height);
  min-height: var(--map-editor-field-height);
  margin: 0;
  background: var(--map-editor-bg);
  border: 1px solid var(--map-editor-border);
  border-radius: var(--map-editor-field-radius);
  box-sizing: border-box;
}

.map-editor-field-row.is-tall .map-editor-field-control .mud-input-control-input-container {
  height: auto;
  min-height: 0;
  align-items: stretch;
}

.map-editor-field-control .mud-input-label,
.map-editor-field-control .mud-input-helper-text {
  display: none !important;
}

.map-editor-field-control .mud-input-control-input-container:hover {
  border-color: var(--map-editor-accent);
}

.map-editor-field-control .mud-input-control-input-container:focus-within {
  border-color: var(--map-editor-accent);
}

.map-editor-field-control .mud-input.mud-input-outlined,
.map-editor-field-control .mud-select .mud-input-outlined,
.map-editor-field-control .mud-input-number-control .mud-input {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  margin-top: 0;
  padding: 0;
  background: transparent;
  color: var(--map-editor-text);
}

.map-editor-field-row.is-tall .map-editor-field-control .mud-input.mud-input-outlined {
  height: auto;
  min-height: 4.5rem;
  align-items: stretch;
}

.map-editor-field-control .mud-input-outlined-border,
.map-editor-field-control fieldset.mud-input-outlined-border {
  display: none !important;
}

.map-editor-field-control fieldset.mud-input-outlined-border legend {
  display: none !important;
  width: 0;
  max-width: 0;
}

.map-editor-field-control .mud-input.mud-input-outlined:focus-within .mud-input-outlined-border,
.map-editor-field-control .mud-input.mud-input-outlined:hover .mud-input-outlined-border {
  border-width: 0 !important;
}

.map-editor-field-control .mud-input > input,
.map-editor-field-control .mud-input-number-control .mud-input > input {
  flex: 1 1 auto;
  display: block;
  width: auto;
  min-width: 0;
  height: auto;
  margin: 0 !important;
  padding: 0 var(--map-editor-field-padding-x) !important;
  border: 0;
  color: var(--map-editor-text) !important;
  font-size: var(--map-editor-field-font-size);
  font-family: var(--map-editor-field-font-family);
  font-weight: 400;
  line-height: var(--map-editor-field-line-height);
  letter-spacing: normal;
  background: transparent !important;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* MudSelect: text + chevron live inside .mud-select-input — must be a horizontal row. */
.map-editor-field-control .mud-select .mud-select-input {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 100%;
  margin: 0 !important;
  padding: 0 0 0 var(--map-editor-field-padding-x) !important;
  border: 0;
  color: var(--map-editor-text) !important;
  font-size: var(--map-editor-field-font-size);
  font-family: var(--map-editor-field-font-family);
  font-weight: 400;
  line-height: var(--map-editor-field-line-height);
  letter-spacing: normal;
  background: transparent !important;
  box-sizing: border-box;
  overflow: hidden;
  cursor: pointer;
}

.map-editor-field-control .mud-select .mud-select-input input,
.map-editor-field-control .mud-select .mud-select-input > .mud-input-slot {
  flex: 1 1 auto;
  display: block;
  width: auto;
  min-width: 0;
  height: auto;
  margin: 0 !important;
  padding: 0 0.25rem 0 0 !important;
  border: 0;
  color: inherit !important;
  font: inherit !important;
  line-height: inherit !important;
  letter-spacing: inherit !important;
  background: transparent !important;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-editor-field-control .mud-select .mud-select-input .mud-input-adornment-end {
  position: static !important;
  flex: 0 0 1.35rem;
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  align-self: center !important;
  width: 1.35rem !important;
  min-width: 1.35rem !important;
  height: auto !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 0 0.2rem 0 0 !important;
  pointer-events: none;
  color: var(--map-editor-muted) !important;
}

.map-editor-field-control .mud-select .mud-select-input .mud-input-adornment-end .mud-icon-root,
.map-editor-field-control .mud-select .mud-select-input .mud-input-adornment-end svg {
  display: block;
  width: 1.125rem !important;
  height: 1.125rem !important;
  font-size: 1.125rem !important;
  line-height: 1 !important;
}

/* Fallback when chevron is a direct child of .mud-input-outlined (not nested in .mud-select-input). */
.map-editor-field-control .mud-select .mud-input-outlined > .mud-input-adornment-end {
  position: static !important;
  flex: 0 0 1.35rem;
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  align-self: center !important;
  width: 1.35rem !important;
  min-width: 1.35rem !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 0.2rem 0 0 !important;
  pointer-events: none;
  color: var(--map-editor-muted) !important;
}

.map-editor-field-control .mud-select .mud-input-outlined > .mud-input-adornment-end .mud-icon-root,
.map-editor-field-control .mud-select .mud-input-outlined > .mud-input-adornment-end svg {
  display: block;
  width: 1.125rem !important;
  height: 1.125rem !important;
  font-size: 1.125rem !important;
  line-height: 1 !important;
}

.map-editor-field-control .mud-select .mud-input-outlined > .mud-select-input,
.map-editor-field-control .mud-select .mud-input-outlined > input.mud-select-input {
  padding-right: 0.25rem !important;
}

.map-editor-field-control .mud-input > textarea {
  height: auto;
  min-height: 4.5rem;
  line-height: var(--map-editor-field-line-height);
  font-size: var(--map-editor-field-font-size);
  font-family: var(--map-editor-field-font-family);
  padding: 0.5rem var(--map-editor-field-padding-x);
  resize: vertical;
}

.map-editor-field-control .mud-input-number-control .mud-input {
  position: relative;
  overflow: hidden;
}

.map-editor-field-control .mud-input-number-control .mud-input > input {
  padding-right: calc(var(--map-editor-field-padding-x) + 1.35rem) !important;
}

.map-editor-field-control .mud-input-numeric-spin {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 100%;
  margin: 0;
  padding: 0;
}

.map-editor-field-control .mud-input-numeric-spin button {
  width: 1.35rem;
  min-width: 1.35rem;
  height: 50%;
  min-height: 0;
  margin: 0;
  padding: 0;
}

.map-editor-field-control .mud-input-numeric-spin .mud-icon-root {
  width: 0.75rem;
  height: 0.75rem;
  font-size: 0.75rem;
}

.map-editor-field-control .mud-select .mud-chip {
  height: 1.125rem;
  margin: 0 0.2rem 0 0;
  padding: 0 0.35rem;
  font-size: 0.6875rem;
}

.map-editor-field-control .mud-input-adornment-start {
  flex: 0 0 auto;
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  align-self: center !important;
  margin-inline: 0.35rem 0;
  color: var(--map-editor-muted);
}

.map-editor-field-control .mud-input-adornment-start .mud-icon-root,
.map-editor-field-control .mud-input-adornment-start svg {
  display: block;
  width: 1.125rem !important;
  height: 1.125rem !important;
  font-size: 1.125rem !important;
  line-height: 1 !important;
}

/* Non-select end adornments only — select chevron styled above. */
.map-editor-field-control .mud-input:not(.mud-select-input) .mud-input-adornment-end,
.map-editor-field-control .mud-input-number-control .mud-input-adornment-end {
  flex: 0 0 auto;
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: center !important;
  align-self: center !important;
  margin-inline: 0 0.15rem;
  color: var(--map-editor-muted);
}

.map-editor-field-control .mud-input-control.mud-disabled .mud-input-control-input-container,
.map-editor-field-control .mud-input-control.mud-disabled {
  opacity: 0.45;
}

.map-editor-field-control .map-editor-field-input.mud-input-control {
  width: 100%;
}

.map-editor-field-row.is-dialog {
  margin: 0;
}

.map-editor-color-preview {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  height: var(--map-editor-field-height);
  min-height: var(--map-editor-field-height);
  padding: 0 calc(var(--map-editor-field-padding-x) - 0.05rem);
  border: 1px solid var(--map-editor-border);
  border-radius: var(--map-editor-field-radius);
  background: var(--map-editor-bg);
  color: var(--map-editor-text);
  cursor: pointer;
  box-sizing: border-box;
}

.map-editor-color-preview:hover:not(:disabled) {
  border-color: var(--map-editor-accent);
}

.map-editor-color-preview:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.map-editor-color-swatch {
  flex: 0 0 1.25rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--map-editor-text) 25%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--map-editor-bg) 40%, transparent);
}

.map-editor-color-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--map-editor-field-font-size);
  font-family: var(--map-editor-field-font-family);
  line-height: var(--map-editor-field-line-height);
}

.map-editor-color-picker-control {
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

body:has(.map-editor-root.is-fullscreen) .mud-picker-popover {
  position: fixed !important;
  inset: auto 1rem 1rem auto !important;
  max-width: min(22.5rem, calc(100vw - 2rem)) !important;
  max-height: min(38.75rem, calc(100vh - 2rem)) !important;
  overflow: auto !important;
  transform-origin: bottom right !important;
}

body:has(.map-editor-root.is-fullscreen) .mud-picker-popover .mud-paper {
  max-width: 100% !important;
  max-height: min(38.75rem, calc(100vh - 2rem)) !important;
  overflow: auto !important;
  background: var(--map-editor-surface) !important;
  border-color: var(--map-editor-border) !important;
  color: var(--map-editor-text) !important;
}

body:has(.map-editor-root.is-fullscreen) .mud-picker-popover .mud-typography {
  color: var(--map-editor-text) !important;
}
