/* Eigenständige Maßskizze. Alle Regeln bleiben innerhalb des Loch-Editors. */
.hde-editor {
  --hde-text: #e9edf1;
  --hde-muted: #b2bdc8;
  --hde-line: #39414c;
  --hde-accent: #c7a0ee;
  --hde-horizontal: #caa9ef;
  --hde-vertical: #88d9dc;
  display: grid;
  gap: 12px;
  min-width: 0;
  width: 100%;
  color: var(--hde-text);
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
}
.hde-editor *, .hde-editor *::before, .hde-editor *::after { box-sizing: border-box; }
.hde-editor button, .hde-editor input, .hde-editor select { font: inherit; }
.hde-editor button { -webkit-tap-highlight-color: transparent; }
.hde-editor :focus-visible { outline: 3px solid #c7a0ee; outline-offset: 3px; }
.hde-editor p { margin: 0; }
.hde-plane-label { display: grid; gap: 6px; color: var(--hde-muted); font-size: 13px; }
.hde-plane-select {
  width: 100%; min-height: 44px; padding: 9px 12px;
  border: 1px solid var(--hde-line); border-radius: 10px;
  background: #20262e; color: var(--hde-text);
}
.hde-canvas {
  min-width: 0; overflow: hidden; border: 1px solid #cad2da;
  border-radius: 13px; background: #f8fafc;
  box-shadow: inset 0 1px 0 #fff;
}
.hde-canvas-caption {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 12px 0; color: #586778; font-size: 11px; font-weight: 600;
}
.hde-canvas-caption > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hde-canvas-caption > span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.hde-svg { display: block; width: 100%; height: 230px; overflow: hidden; touch-action: pinch-zoom; }
.hde-canvas-placing { border-color: #9d65d6; box-shadow: 0 0 0 2px #9d65d62b; }
.hde-canvas-placing .hde-svg { cursor: crosshair; }
.hde-part { fill: #e6ebf0; stroke: #7c8b9c; stroke-width: 1.4; }
.hde-cutout { fill: #f8fafc; stroke: #7c8b9c; stroke-width: 1.2; }
.hde-bend-edge { stroke: #637692; stroke-width: 2; stroke-dasharray: 6 4; pointer-events: none; }
.hde-hole { cursor: grab; }
.hde-hole:active { cursor: grabbing; }
.hde-hole-target { fill: transparent; stroke: none; pointer-events: all; }
.hde-hole-edge { fill: #f8fafc; stroke: #55677c; stroke-width: 1.4; pointer-events: none; }
.hde-hole-selected .hde-hole-edge { stroke: #7950ad; stroke-width: 2.5; fill: #fff; }
.hde-hole-number { fill: #41556b; font-size: 12px; font-weight: 700; paint-order: stroke; stroke: #f8fafc; stroke-width: 3px; pointer-events: none; }
.hde-hole-selected .hde-hole-number { fill: #6e3da4; }
.hde-hole-error .hde-hole-edge { stroke: #b33b42; stroke-width: 2.5; }
.hde-hole-error .hde-hole-number { fill: #ac343b; }
.hde-hole-pending { fill: none; stroke: #6e3da4; stroke-width: 2; pointer-events: none; }
.hde-hole:focus-visible { outline: none; }
.hde-hole:focus-visible .hde-hole-target { stroke: #7950ad; stroke-width: 2; stroke-dasharray: 3 3; }
.hde-proposed-hole { fill: #9c71c524; stroke: #8956bd; stroke-width: 1.6; stroke-dasharray: 4 3; pointer-events: none; }
.hde-dimension { pointer-events: none; }
.hde-dimension line, .hde-dimension path { fill: none; stroke: currentColor; stroke-width: 1.2; }
.hde-dimension text { fill: currentColor; font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; }
.hde-dimension-horizontal { color: #7040a5; }
.hde-dimension-vertical { color: #08747e; }
.hde-guides { fill: none; stroke: #91a2b6; stroke-width: .8; stroke-dasharray: 3 3; pointer-events: none; }
.hde-empty-drawing { fill: #647487; font-size: 12px; }
.hde-help { color: var(--hde-muted); font-size: 12px; line-height: 1.5; }
.hde-notice { color: #f0cc8e; font-size: 12px; line-height: 1.45; }
.hde-notice:empty { display: none; }
.hde-detail-error { color: #f0c491; font-size: 12px; line-height: 1.45; }
.hde-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; max-width: 100%; padding: 9px 13px;
  border: 1px solid var(--hde-line); border-radius: 10px;
  background: #20262e; color: var(--hde-text);
  font-weight: 600; line-height: 1.3; text-align: center; cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease;
}
.hde-button:hover:not(:disabled) { border-color: #9a81b6; background: #2b2b38; }
.hde-button:disabled { opacity: .46; cursor: default; }
.hde-button-primary { background: #9b4cda; border-color: #a965df; color: #fff; }
.hde-button-primary:hover:not(:disabled) { background: #a95ce6; border-color: #c897f0; }
.hde-button-quiet { background: transparent; border-color: transparent; color: var(--hde-muted); font-weight: 500; }
.hde-plus { font-size: 20px; line-height: 1; font-weight: 400; }
.hde-chips { display: flex; flex-wrap: wrap; gap: 7px; min-width: 0; }
.hde-chip { width: 44px; flex: 0 0 44px; padding: 7px; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hde-chip[aria-pressed="true"] { border-color: #c29ce7; background: #3a2850; color: #ecd9fc; }
.hde-chip-unplaced { border-style: dashed; }
.hde-chip-error { border-color: #e79693; color: #f4c4c1; }
.hde-detail { display: grid; gap: 10px; min-width: 0; }
.hde-detail-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-width: 0; }
.hde-detail-heading strong { font-size: 13px; }
.hde-remove { font-size: 11px; padding-inline: 8px; }
.hde-detail-actions, .hde-add-actions { display: flex; align-items: center; gap: 4px; min-width: 0; }
.hde-undo { font-size: 11px; padding-inline: 8px; }
.hde-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; min-width: 0; }
.hde-field { display: grid; gap: 6px; min-width: 0; align-content: end; }
.hde-field-label { color: var(--hde-muted); font-size: 12px; line-height: 1.35; min-width: 0; overflow-wrap: anywhere; }
.hde-field-horizontal .hde-field-label { color: var(--hde-horizontal); }
.hde-field-vertical .hde-field-label { color: var(--hde-vertical); }
.hde-input-line {
  display: flex; align-items: center; min-height: 44px; min-width: 0;
  border: 1px solid #475161; border-radius: 9px; background: #1b222a;
}
.hde-field-horizontal .hde-input-line { border-bottom: 2px solid #b98cdf; }
.hde-field-vertical .hde-input-line { border-bottom: 2px solid #70bfc5; }
.hde-input {
  width: 100%; min-width: 0; min-height: 42px; padding: 9px 8px;
  border: 0; border-radius: 8px; background: transparent; color: #f1f4f7;
  font-size: 16px !important; font-variant-numeric: tabular-nums; line-height: 1.25;
}
.hde-input::placeholder { color: #8190a0; font-size: 11px; }
.hde-unit { padding-right: 8px; color: #9eacbb; font-size: 12px; }
.hde-tools { display: grid; grid-template-columns: minmax(0, 1fr); gap: 9px; padding-top: 3px; }
.hde-add { justify-self: start; }
.hde-tools-compact { grid-template-columns: max-content minmax(0, 1fr); align-items: start; gap: 8px; }
.hde-tools-compact .hde-add { padding-inline: 10px; font-size: 12px; }
.hde-more-patterns { min-width: 0; }
.hde-more-patterns summary { display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 7px 5px; color: var(--hde-muted); font-size: 12px; cursor: pointer; list-style: none; }
.hde-more-patterns summary::-webkit-details-marker { display: none; }
.hde-more-patterns summary::before { content: '+'; font-size: 16px; }
.hde-more-patterns[open] { grid-column: 1 / -1; }
.hde-more-patterns[open] summary::before { content: '−'; }
.hde-more-patterns .hde-patterns { padding-top: 4px; }
.hde-patterns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.hde-pattern { justify-content: flex-start; text-align: left; padding: 9px; min-width: 0; gap: 8px; }
.hde-pattern[aria-pressed="true"] { background: #30233e; border-color: #b08bd3; }
.hde-pattern-icon { width: 50px; height: 35px; flex: 0 0 50px; }
.hde-pattern-part { fill: #364251; stroke: #8a99a9; stroke-width: 1.2; }
.hde-pattern-hole { fill: #17202a; stroke: #d4bee8; stroke-width: 1.2; }
.hde-pattern-words { display: grid; gap: 2px; min-width: 0; }
.hde-pattern-words strong { font-size: 12px; font-weight: 600; }
.hde-pattern-words small { color: var(--hde-muted); font-size: 11px; line-height: 1.3; }
.hde-proposal { display: grid; gap: 12px; padding: 13px; min-width: 0; background: #282030; border: 1px solid #73518f; border-radius: 12px; }
.hde-proposal-heading { font-size: 12px; color: #e0c4f3; }
.hde-proposal-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.hde-proposal-actions, .hde-placement-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
@media (max-width: 420px) {
  .hde-editor { gap: 10px; }
  .hde-svg { height: 200px; }
  .hde-fields { gap: 6px; }
  .hde-input { padding-inline: 6px; }
  .hde-unit { padding-right: 6px; }
  .hde-pattern { gap: 5px; padding: 8px 6px; }
  .hde-pattern-icon { width: 40px; flex-basis: 40px; }
  .hde-pattern-words small { font-size: 11px; }
  .hde-placement-actions .hde-button-primary, .hde-proposal-actions .hde-button-primary { flex: 1 1 180px; }
}
@media (prefers-reduced-motion: reduce) {
  .hde-button { transition: none; }
}

/* Paket G (13.09.2026): Ein Loch, das eine Prüfmeldung nennt, bekommt einen
   roten Ring - zusätzlich zur normalen Kante, damit Auswahl und Fehlerfarbe
   unverändert bleiben. */
.hde-hole-mark { fill: none; stroke: #d0322f; stroke-width: 3; pointer-events: none; }
.hde-hole-marked .hde-hole-number { fill: #b02a27; }
