/* Header chrome lives in chrome.css (floating). Legacy .header unused. */
.header { display: none; }

.header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.header-title-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.header-title h1 {
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.header-project-name {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  cursor: pointer;
}

.header-project-name:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-banner {
  position: fixed;
  margin: 0;
  padding: 8px 16px;
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 0.82rem;
  text-align: center;
}

.auth-banner.hidden { display: none !important; }

.support-banner {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 8px 16px;
  background: #6d5efc;
  color: #fff;
  font-size: 0.88rem;
}

.support-banner.hidden { display: none !important; }

.support-banner button {
  background: transparent;
  color: #fff;
  border: 1px solid #fff;
  border-radius: 6px;
  padding: 2px 10px;
  font: inherit;
  cursor: pointer;
}


.sheet-apps {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sheet-apps-title {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}

.sheet-apps-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.sheet-apps-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}

a.sheet-apps-item {
  box-sizing: border-box;
}

.sheet-apps-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.sheet-apps-item .material-symbols-outlined {
  font-size: 20px;
  color: var(--text-muted);
}


.logo { color: var(--primary); }

.header-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.header-toolbar {
  display: none;
}

.header-help-desktop,
.header-action-desktop { display: flex; }
.header-help-mobile,
.header-map-mobile { display: none; }

.header-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.header-icon-btn .material-symbols-outlined { font-size: 20px; }

.header-icon-btn:hover:not(:disabled),
.header-icon-btn:active:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text);
}

.header-icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.header-icon-btn.active {
  background: var(--primary-muted);
  color: var(--primary);
}

/* Project/help sheets: layout in chrome.css. Wrappers are in-flow. */
.project-drawer,
.help-drawer {
  display: contents;
}

.project-drawer-scrim,
.help-drawer-scrim {
  display: none !important;
}

.project-drawer-panel {
  background: transparent;
}

.project-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.project-drawer-title {
  font-size: 0.92rem;
  font-weight: 600;
}

.project-drawer-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 11px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.project-drawer-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.project-drawer-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.project-drawer-storage {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin-top: auto;
}

.project-drawer-storage.is-warn { color: var(--danger); }

.help-drawer-panel {
  background: transparent;
}

.help-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.help-drawer-title {
  font-size: 0.92rem;
  font-weight: 600;
}

.help-drawer-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 11px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.help-drawer-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.help-drawer-body {
  flex: 1;
  overflow-y: auto;
}

.help-block + .help-block {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.help-block-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.help-block-title .material-symbols-outlined {
  font-size: 18px;
  color: var(--text-muted);
}

.help-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.help-list li + li { margin-top: 6px; }

.help-list strong { color: var(--text); font-weight: 600; }

.card-help .btn .material-symbols-outlined {
  font-size: 18px;
  margin-right: 4px;
}

.project-drawer-hint {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.project-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.project-list-item {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  min-width: 0;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}

/* Left accent = kind / activity. No Aktiv badge. */
.project-list-item.is-active:not(.is-selected) {
  border-color: rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.04);
}

.project-list-item.is-selected {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: none;
}

.project-list-item.accent-red {
  box-shadow: inset 3px 0 0 #e53935;
}

.project-list-item.accent-blue {
  box-shadow: inset 3px 0 0 #1e88e5;
}

.project-list-item.accent-orange {
  box-shadow: inset 3px 0 0 #fb8c00;
}

.project-list-item.accent-gray {
  box-shadow: inset 3px 0 0 #71717a;
}

.project-list-badge {
  display: none !important;
}

.project-list-open {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.project-list-open:hover { background: rgba(255, 255, 255, 0.03); }

.project-list-head {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.project-list-name {
  font-size: 0.86rem;
  font-weight: 500;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-list-badge {
  flex-shrink: 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  padding: 2px 7px;
  border-radius: 999px;
  background: #c62828;
}

.project-list-badge.is-closed,
.project-list-item:not(.is-active) .project-list-badge {
  color: #eceff1;
  background: #607d8b;
}

.project-list-meta {
  font-size: 0.7rem;
  color: var(--text-muted);
  width: 100%;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-list-line1 {
  display: flex;
  align-items: baseline;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.project-list-line1-main {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-list-line1-when {
  flex-shrink: 0;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.project-list-when-badge {
  flex-shrink: 0;
  align-self: center;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.12);
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.project-list-line2 {
  font-size: 0.72rem;
  color: var(--text-muted);
  width: 100%;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-list-actions {
  display: flex;
  flex-direction: row;
  border-left: 1px solid var(--border);
  flex-shrink: 0;
}

.project-list-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  flex: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.project-list-action:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.project-list-action.is-danger:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

.project-list-action .material-symbols-outlined { font-size: 18px; }

/* ── Project meta dialog (title / address / contacts) ── */
.project-meta-dialog {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.project-meta-dialog.hidden {
  display: none !important;
}

.project-meta-dialog-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.project-meta-dialog-panel {
  position: relative;
  z-index: 1;
  width: min(480px, 94vw);
  max-height: min(88vh, 720px);
  display: flex;
  flex-direction: column;
  background: var(--surface, #1c1c1f);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius, 12px);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.project-meta-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.project-meta-dialog-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}

.project-meta-dialog-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.project-meta-dialog-close:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.project-meta-dialog-body {
  padding: 12px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.project-meta-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.project-meta-contacts-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.project-meta-contacts-head .btn {
  padding: 5px 8px;
  font-size: 0.75rem;
}

.project-meta-contacts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.project-meta-contact-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  position: relative;
}

.project-meta-contact-row .export-field {
  min-width: 0;
}

.project-meta-phone-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
  min-width: 0;
}

.project-meta-phone-row select {
  flex: 0 0 auto;
  width: auto;
  min-width: 4.6rem;
  max-width: 5.5rem;
  padding: 7px 4px;
  font-size: 0.8rem;
}

.project-meta-phone-row input[type="tel"] {
  flex: 1 1 auto;
  min-width: 0;
}

.project-meta-contact-remove {
  grid-column: 1 / -1;
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}

.project-meta-contact-remove:hover {
  color: var(--danger);
  background: var(--danger-bg);
}

.sidebar .card + .card {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.btn .material-symbols-outlined { font-size: 18px; }

.btn:hover:not(:disabled) {
  background: var(--surface-hover);
}
.btn:disabled { opacity: 0.35; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary .material-symbols-outlined {
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  color: #fff;
}

.btn-soft {
  background: var(--surface-2);
  font-size: 0.8rem;
  padding: 7px 12px;
}

.btn-block { width: 100%; }

.btn-danger-text { color: var(--danger); }
.btn-danger-text:hover:not(:disabled) {
  background: var(--danger-bg);
}

/* Export dropdown */
.export-dropdown { position: relative; }

.btn-export .export-chevron { font-size: 16px; margin-left: -2px; }

.btn-schnellansicht .material-symbols-outlined,
.btn-export .material-symbols-outlined {
  font-size: 18px;
}

.export-header-actions .btn {
  white-space: nowrap;
}

.export-menu {
  position: fixed;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 50;
}

.export-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  padding: 12px 14px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}

.export-option:hover { background: var(--surface-hover); }
.export-option strong { font-size: 0.88rem; }
.export-option-desc { font-size: 0.75rem; color: var(--text-muted); }

/* ── Sidebar ── */
.sidebar {
  grid-area: sidebar;
  position: relative;
  z-index: 40;
  overflow-y: auto;
  padding: 12px 10px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.card {
  padding: 12px;
  border-radius: var(--radius);
  background: transparent;
  border: none;
}

.card-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.card-hint {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 10px;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--text);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  margin-top: 8px;
}

.card-subtitle {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  margin: 12px 0 8px;
}

.map-load {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.map-load .btn-block + .btn-block {
  margin-top: 8px;
}

.map-load .card-hint {
  margin-top: 8px;
}

.map-load + .btn-block {
  margin-top: 12px;
}

.map-style-pills {
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.map-style-pills .format-pill {
  flex: 1 1 calc(50% - 3px);
  padding: 8px 4px;
  font-size: 0.72rem;
}

.map-transport-toggle {
  margin-bottom: 8px;
  cursor: pointer;
}

.map-transport-toggle input {
  margin-left: auto;
}

.osm-attribution {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.4;
}

.osm-attribution a {
  color: var(--text-muted);
  text-decoration: none;
}

.osm-attribution a:hover {
  text-decoration: underline;
}

.card-actions {
  display: flex;
  gap: 6px;
  margin-top: 12px;
}

.card-actions .btn { flex: 1; }

/* Format pills */
.format-pills {
  display: flex;
  gap: 6px;
}

.format-pill {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 6px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.format-pill .material-symbols-outlined { font-size: 22px; }

.format-pill:hover {
  background: var(--surface-3);
  color: var(--text);
}

.format-pill.active {
  background: var(--primary);
  color: #fff;
}

.format-pill.active .material-symbols-outlined { color: #fff; }

/* Shape buttons (mobile dock + legacy) */
.shape-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  padding: 0;
}

.shape-btn .material-symbols-outlined { font-size: 20px; }

.shape-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.shape-btn.active {
  background: var(--primary);
  color: #fff;
}

.shape-btn.active .material-symbols-outlined {
  color: #fff;
}

.canvas-toolbar-dock {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 26;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: min(calc(100% - 440px), calc(100% - 24px));
  pointer-events: none;
  margin-top: 0;
}

.canvas-toolbar-dock-label,
.canvas-nav-hint {
  display: none;
  margin: 6px 0 0;
  padding: 4px 10px;
  max-width: min(420px, 90vw);
  border-radius: 10px;
  background: var(--chrome-bg);
  backdrop-filter: var(--chrome-blur);
  -webkit-backdrop-filter: var(--chrome-blur);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-align: center;
  pointer-events: none;
  white-space: nowrap;
}

/* Desktop: Führungshinweis under the top toolbar while navigating */
@media (min-width: 1101px) {
  .canvas-toolbar-dock-label.canvas-nav-hint:not(.hidden) {
    display: block;
  }
}

.canvas-toolbar-dock .canvas-toolbar {
  position: relative;
  top: auto;
  left: auto;
  transform: none;
  margin-top: 0;
  pointer-events: auto;
}

.canvas-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
  overflow: visible;
}

.canvas-toolbar-group {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  height: 46px;
  padding: 4px;
  box-sizing: border-box;
  background: var(--chrome-bg);
  backdrop-filter: var(--chrome-blur);
  -webkit-backdrop-filter: var(--chrome-blur);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

.canvas-toolbar-draw > .canvas-tb-btn,
.canvas-toolbar-draw > .canvas-toolbar-divider,
.canvas-toolbar-draw > .canvas-toolbar-symbols,
.canvas-toolbar-draw > .canvas-tb-more {
  flex-shrink: 0;
}

.canvas-toolbar-overflow {
  position: relative;
}

.canvas-toolbar--nav,
.canvas-toolbar--nav-stop,
.canvas-toolbar--props,
.canvas-toolbar--buildings,
.canvas-toolbar--building,
.canvas-toolbar--sphere,
.canvas-toolbar--vehicle,
.canvas-toolbar--absprache {
  width: max-content;
  justify-content: center;
}

.canvas-toolbar-3d,
.canvas-toolbar-building,
.canvas-toolbar-props,
.canvas-toolbar-vehicle,
.canvas-toolbar-absprache,
.canvas-toolbar-sphere-elev,
.canvas-toolbar-nav,
.canvas-toolbar-nav-stop,
.canvas-toolbar-export {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 4px;
  border-radius: 16px;
  background: var(--chrome-bg);
  backdrop-filter: var(--chrome-blur);
  -webkit-backdrop-filter: var(--chrome-blur);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

.canvas-toolbar-props {
  position: relative;
}

.shape-props-colors {
  display: flex;
  align-items: center;
  gap: 4px;
}

.shape-prop-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  padding: 10px 12px;
  background: var(--chrome-bg);
  backdrop-filter: var(--chrome-blur);
  -webkit-backdrop-filter: var(--chrome-blur);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
  min-width: 180px;
}

.shape-prop-popover-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.shape-prop-popover-row span {
  min-width: 2.5em;
}

.shape-prop-popover-row input[type="range"] {
  flex: 1;
  min-width: 96px;
}

.shape-prop-popover-row output {
  min-width: 1.75em;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  text-align: right;
}

.canvas-toolbar-vehicle-picks,
.canvas-toolbar-symbol-picks {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
}

.canvas-toolbar-nav-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.canvas-toolbar-nav .canvas-obj-label-field {
  flex: 0 1 9.5rem;
  min-width: 5.5rem;
}

.canvas-toolbar-vehicle-picks:not(.canvas-toolbar-symbol-picks--compact),
.canvas-toolbar-symbol-picks:not(.canvas-toolbar-symbol-picks--compact) {
  max-width: min(28rem, calc(100vw - 10rem));
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.canvas-toolbar-vehicle-picks:not(.canvas-toolbar-symbol-picks--compact)::-webkit-scrollbar,
.canvas-toolbar-symbol-picks:not(.canvas-toolbar-symbol-picks--compact)::-webkit-scrollbar {
  display: none;
}

.canvas-symbol-type-popover {
  left: 0;
  transform: none;
  padding: 4px;
}

@media (min-width: 1101px) {
  .canvas-symbol-type-popover,
  .sphere-label-popover,
  .sphere-elev-popover,
  .sphere-floor-popover {
    top: calc(100% + 8px);
    bottom: auto;
  }

}

.canvas-toolbar-sphere-elev {
  position: relative;
}

.sphere-chip-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.canvas-tb-btn.sphere-chip {
  width: auto;
  min-width: 36px;
  padding: 0 8px;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.sphere-chip-value {
  color: var(--text);
}

.canvas-tb-btn.sphere-chip-label,
.canvas-tb-btn.building-chip-label {
  max-width: 7.5rem;
  justify-content: flex-start;
  flex-shrink: 1;
}

.canvas-tb-btn.building-chip-label {
  max-width: 14rem;
}

.sphere-chip-label-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 600;
}

.sphere-chip-label.is-empty .sphere-chip-label-text {
  color: var(--text-muted);
  font-weight: 500;
}

.sphere-chip[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.1);
}

.canvas-obj-label-input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  box-sizing: border-box;
}

.canvas-obj-label-input::placeholder {
  color: var(--text-muted);
}

.canvas-obj-label-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.22);
}

.canvas-toolbar-absprache .absprache-toolbar-ort {
  width: min(14rem, 42vw);
  min-width: 7rem;
  flex: 1 1 auto;
  height: 36px;
  margin: 0 2px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 500;
}

.canvas-toolbar-absprache .absprache-toolbar-ort:disabled {
  opacity: 0.55;
}

.sphere-label-popover {
  left: 0;
  right: 0;
  transform: none;
  padding: 6px;
}

.sphere-elev-popover {
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 8px;
}

.sphere-elev-popover output {
  font-size: 0.72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.sphere-elev-slider-wrap {
  width: 36px;
  height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sphere-elev-slider {
  width: 132px;
  height: 28px;
  margin: 0;
  transform: rotate(-90deg);
  accent-color: var(--primary);
}

.sphere-floor-popover {
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px;
}

.sphere-floor-popover .sphere-floor-step-btn {
  width: 36px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  padding: 0;
}

.sphere-floor-popover .sphere-floor-step-btn .material-symbols-outlined {
  font-size: 22px;
  line-height: 1;
}

.sphere-floor-popover .sphere-floor-step-btn:hover:not(:disabled) {
  background: var(--surface-hover);
}

.sphere-floor-popover .sphere-floor-step-btn:disabled {
  opacity: 0.38;
  cursor: default;
}

.sphere-floor-popover input[type="number"] {
  width: 3.4ch;
  margin: 0;
  padding: 2px 0;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  -moz-appearance: textfield;
  appearance: textfield;
}

.sphere-floor-popover input[type="number"]::-webkit-inner-spin-button,
.sphere-floor-popover input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.canvas-shapes-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px;
  background: var(--chrome-bg);
  backdrop-filter: var(--chrome-blur);
  -webkit-backdrop-filter: var(--chrome-blur);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

.canvas-shape-pick {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
}

.canvas-shape-pick:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.canvas-shape-pick.active {
  background: var(--primary);
  color: #fff;
}

.canvas-shape-pick .material-symbols-outlined { font-size: 22px; }

.canvas-toolbar-draw,
.canvas-toolbar-nav,
.canvas-toolbar-nav-stop {
  display: flex;
  align-items: center;
  gap: 4px;
  width: max-content;
}

.canvas-toolbar-group.hidden { display: none; }

.canvas-toolbar-symbols {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.canvas-toolbar-divider {
  width: 1px;
  height: 28px;
  margin: 0 4px;
  background: var(--border-strong);
  flex-shrink: 0;
}

.canvas-tb-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 11px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  padding: 0;
  flex-shrink: 0;
}

.canvas-tb-btn .material-symbols-outlined { font-size: 20px; }

.canvas-tb-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text);
}

.canvas-tb-btn.active,
.canvas-tb-btn.is-active,
.canvas-tb-btn.canvas-tb-active,
.canvas-tb-btn.shape-btn.active {
  background: var(--primary);
  color: #fff;
}

.canvas-tb-btn.active .material-symbols-outlined,
.canvas-tb-btn.is-active .material-symbols-outlined,
.canvas-tb-btn.canvas-tb-active .material-symbols-outlined,
.canvas-tb-btn.shape-btn.active .material-symbols-outlined {
  color: #fff;
}

.canvas-tb-btn:disabled {
  opacity: 0.38;
  cursor: default;
}

.canvas-tb-symbol {
  width: 36px;
  height: 36px;
  padding: 1px;
  background: transparent;
  border: 2px solid transparent;
  border-radius: 11px;
  box-sizing: border-box;
}

.canvas-tb-btn.canvas-tb-symbol:hover:not(:disabled):not(.active) {
  background: var(--surface-hover);
}

.canvas-tb-btn.canvas-tb-symbol.active,
.canvas-tb-btn.canvas-tb-symbol.active:hover:not(:disabled) {
  background: transparent;
  border-color: var(--primary);
  color: inherit;
}

.canvas-tb-symbol img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.canvas-tb-more {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text);
}

.canvas-toolbar-overflow .canvas-overflow-popover {
  top: calc(100% + 8px);
  left: auto;
  right: 0;
  transform: none;
  min-width: 200px;
  padding: 4px;
  background: var(--chrome-bg);
  backdrop-filter: var(--chrome-blur);
  -webkit-backdrop-filter: var(--chrome-blur);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}

@media (max-width: 1100px) {
  .canvas-toolbar-overflow .canvas-overflow-popover {
    top: auto;
    bottom: calc(100% + 8px);
    left: auto;
    right: 0;
    transform: none;
  }
}

.canvas-overflow-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.canvas-overflow-item .material-symbols-outlined {
  font-size: 20px;
  color: var(--text-muted);
}

.canvas-overflow-item:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
}

.canvas-overflow-item:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.canvas-overflow-item.active {
  background: var(--primary);
  color: #fff;
}

.canvas-overflow-item.active .material-symbols-outlined {
  color: #fff;
}

.canvas-overflow-item--mobile {
  display: none;
}

.canvas-overflow-sep {
  display: none;
  height: 1px;
  margin: 4px 8px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
}

.canvas-tb-btn-finish .material-symbols-outlined {
  font-size: 22px;
}

.canvas-tb-btn-finish:not(:disabled) {
  background: var(--primary);
  color: #fff;
}

.canvas-tb-btn-finish:not(:disabled) .material-symbols-outlined {
  color: #fff;
}

.canvas-symbol-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 240px;
  overflow-y: auto;
  min-width: 220px;
}

.canvas-symbol-popover .symbol-grid {
  grid-template-columns: repeat(3, 1fr);
}

.shapes-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.shape-pick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 0.76rem;
  cursor: pointer;
  transition: background 0.15s;
}

.shape-pick-btn:hover {
  background: var(--surface-3);
}

.shape-pick-btn .material-symbols-outlined { font-size: 22px; }

.nav-toolbar .btn.nav-btn-active {
  background: rgba(59, 130, 246, 0.12);
  color: var(--nav-accent);
}

.corner-handle-route {
  border-color: var(--nav-accent);
  color: var(--nav-accent);
}

.corner-handle-route-finish {
  border-color: var(--primary);
  color: var(--primary);
}

.corner-handle-route-finish:hover {
  background: var(--primary-muted);
}

.corner-handle-route-waiting {
  border-color: var(--nav-accent);
  color: var(--nav-accent);
}

.corner-handle-route-waiting:hover,
.corner-handle-route-waiting.active {
  background: rgba(59, 130, 246, 0.12);
  color: var(--nav-accent);
}

/* Symbol panel */
.symbol-panel {
  margin-top: 8px;
  padding: 8px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  max-height: 220px;
  overflow-y: auto;
}

.symbol-panel-title {
  margin: 0 0 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.symbol-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.symbol-item {
  aspect-ratio: 1;
  padding: 4px;
  border: 2px solid transparent;
  border-radius: 11px;
  background: transparent;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 0.15s, border-color 0.15s;
}

.symbol-item:hover:not(.active) {
  background: var(--surface-hover);
}

.symbol-item.active,
.symbol-item.active:hover {
  background: transparent;
  border-color: var(--primary);
}

.symbol-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

/* Sliders */
.sliders {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slider-row {
  display: grid;
  grid-template-columns: 42px 1fr 28px;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.slider-row input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
  height: 4px;
}

.slider-hint {
  margin: -4px 0 0;
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.35;
}

.slider-row output {
  font-size: 0.78rem;
  color: var(--text);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Mini switches */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.82rem;
  cursor: pointer;
}

.switch-row input { display: none; }

.mini-switch {
  width: 36px;
  height: 20px;
  background: var(--surface-3);
  border-radius: 10px;
  position: relative;
  border: 1px solid var(--border);
  transition: background 0.2s;
}

.mini-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}

.switch-row input:checked + .mini-switch {
  background: var(--primary);
  border-color: var(--primary);
}

.switch-row input:checked + .mini-switch::after {
  transform: translateX(16px);
  background: #fff;
}

/* ── Clear dialog ── */
.clear-dialog {
  position: fixed;
  inset: 0;
  z-index: 320;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  pointer-events: none;
}

.clear-dialog.open {
  pointer-events: auto;
}

.clear-dialog-scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.clear-dialog.open .clear-dialog-scrim {
  opacity: 1;
}

.clear-dialog-panel {
  position: relative;
  width: min(100%, 380px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transform: translateY(10px) scale(0.98);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.clear-dialog.open .clear-dialog-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.clear-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.clear-dialog-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.clear-dialog-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.clear-dialog-close:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.clear-dialog-body {
  padding: 14px 16px 8px;
}

.clear-dialog-hint {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.clear-dialog-options {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.clear-dialog-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.clear-dialog-option:hover:not(.is-disabled) {
  background: var(--surface-hover);
}

.clear-dialog-option.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.clear-dialog-option input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.clear-dialog-option-label {
  flex: 1;
  font-size: 0.86rem;
  font-weight: 500;
}

.clear-dialog-count {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.clear-dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px 16px;
}

/* ── Swiss address autocomplete ── */
.swiss-address-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.swiss-address-list {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  z-index: 40;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  max-height: 220px;
  overflow-y: auto;
  background: var(--surface, #1c1c1f);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm, 8px);
  box-shadow: var(--shadow, 0 8px 24px rgba(0, 0, 0, 0.35));
}

.swiss-address-list.hidden {
  display: none !important;
}

.swiss-address-option {
  padding: 8px 10px;
  font-size: 0.84rem;
  color: var(--text);
  cursor: pointer;
}

.swiss-address-option:hover,
.swiss-address-option:focus {
  background: var(--surface-hover, rgba(255, 255, 255, 0.06));
}
