:root {
  --bg: #f1f1f1;
  --grid: #cae1ff;
  --cursor: #6e7b8b;
  --select: orange;
  --panel-bg: #ffffff;
  --border-color: #cccccc;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background: #e0e0e0;
  display: flex;
  flex-direction: row;
  height: 100vh;
}

.tool-group {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}
.tool-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

label {
  font-size: 14px;
  color: #333;
  font-weight: 500;
}

select, button {
  font-family: inherit;
  font-size: 14px;
  padding: 6px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

button:hover, select:hover {
  background: #f5f5f5;
  border-color: #aaa;
}

button:active {
  background: #eaeaea;
}

.colorBtn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  padding: 0;
  margin: 0 2px;
  border: 2px solid transparent;
  box-shadow: 0 0 0 1px #888;
}
.colorBtn.active-color {
  border: 2px solid #4a90e2;
  box-shadow: 0 0 0 2px #000;
}

.toolBtn.active {
  background: #ff9800 !important;
  color: black !important;
  border-color: #e68a00 !important;
  font-weight: bold;
}
.toolBtn.active:hover {
  background: #e68a00 !important;
}

/* Custom styles for snapping button to match active tool buttons */
#toggleSnap.active {
  background: #4a90e2;
  color: white;
  border-color: #357abd;
}
#toggleSnap.active:hover {
  background: #357abd;
}

.canvas-container {
  flex: 1;
  overflow: hidden;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #e0e0e0;
}

#svgCanvas {
  touch-action: none;
  width: 100%;
  height: 100%;
  background: transparent;
}

.toolBtn svg {
  width: 14px !important;
  height: 14px !important;
  max-width: 14px !important;
  max-height: 14px !important;
  display: inline-block !important;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Selection styles */
path.selected {
  stroke: var(--select) !important;
  filter: drop-shadow(0 0 1px rgba(255, 165, 0, 0.7));
}
text.selected {
  fill: var(--select) !important;
}

/* Custom Dropdown for Font Sizes */
.custom-dropdown-list {
  display: none;
  position: absolute;
  background: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 5000;
  max-height: 250px;
  overflow-y: auto;
  min-width: 100px;
}

.custom-dropdown-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 13px;
  color: #333;
  transition: background 0.1s;
}

.custom-dropdown-item:hover {
  background: #f0f7ff;
}

.custom-dropdown-val {
  flex: 1;
  padding-right: 10px;
}

.custom-dropdown-delete {
  color: #999;
  font-size: 16px;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 3px;
  transition: all 0.2s;
}

.custom-dropdown-delete:hover {
  color: #d00;
  background: #fee;
}

/* Ellipsen-Mittelpunkt-Kreuz & Stutzen-Punkt-Markierung: nur am Bildschirm sichtbar */
.ellipse-center-mark {
  stroke: orange;
  stroke-width: 0.3;
}

.stutzen-point-mark {
  stroke: orange;
  stroke-width: 0.4;
  fill: orange;
  fill-opacity: 0.3;
}

@media print {
  .ellipse-center-mark,
  .stutzen-point-mark {
    display: none !important;
  }
}

/* Gruppen-Hover-Hervorhebung: grüne Linienfarbe */
.group-highlight:not(text) {
  stroke: #22c55e !important;
  transition: stroke 0.15s ease;
}
/* Text-Hover-Hervorhebung: grüne Textfarbe (fill) */
text.group-highlight, .group-highlight text {
  fill: #22c55e !important;
  transition: fill 0.15s ease;
}

/* --- PWA Fenster & Popout Modal Styles --- */
.modal-header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 4px;
  border-radius: 4px;
  user-select: none;
  transition: background 0.15s ease, transform 0.1s ease;
}
.modal-header-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  transform: scale(1.1);
}
.modal-header-btn:active {
  transform: scale(0.95);
}

#modalPopoutIndicator {
  display: none;
  position: fixed;
  z-index: 99999;
  padding: 10px 16px;
  background: linear-gradient(135deg, #1a73e8, #0d47a1);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  border-radius: 24px;
  box-shadow: 0 6px 20px rgba(13, 71, 161, 0.45);
  pointer-events: none;
  align-items: center;
  gap: 8px;
  animation: pulsePopoutIndicator 1.4s ease-in-out infinite;
  border: 1.5px solid rgba(255, 255, 255, 0.6);
  white-space: nowrap;
}

@keyframes pulsePopoutIndicator {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 6px 20px rgba(13, 71, 161, 0.45);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 8px 26px rgba(26, 115, 232, 0.7);
  }
}

.modal-content.undocking-preview {
  opacity: 0.75 !important;
  outline: 2.5px dashed #1a73e8 !important;
  outline-offset: 4px !important;
  transform: scale(0.97) !important;
  transition: outline 0.15s ease, opacity 0.15s ease, transform 0.15s ease !important;
  box-shadow: 0 0 25px rgba(26, 115, 232, 0.5) !important;
}

.modal-empty-state {
  text-align: center;
  color: #666;
  padding: 30px 12px;
  font-size: 13px;
  user-select: none;
}
.modal-empty-state-icon {
  font-size: 32px;
  margin-bottom: 10px;
}
.modal-empty-state-title {
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}
.modal-empty-state-desc {
  font-size: 11px;
  color: #888;
  line-height: 1.4;
}