/* ═══════════════════════════════════════════════════════
   VDE-Messen — Module-specific Styles
   Accent: Cyan #06b6d4 (matching module icon color)
   ═══════════════════════════════════════════════════════ */

:root {
  --vde-accent: #06b6d4;
  --vde-accent-glow: rgba(6, 182, 212, 0.15);
  --vde-accent-dim: rgba(6, 182, 212, 0.6);
}

/* ── Menu Info Block ── */
.vde-menu-info {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1rem 1.25rem;
  color: var(--sub);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

/* ── Menu Buttons ── */
.vde-menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.vde-menu-buttons .btn {
  width: 100%;
  padding: 0.9rem 1rem;
  font-size: 0.95rem;
  border-radius: var(--r);
  text-align: center;
}

.vde-menu-buttons .btn-vde-primary {
  background: var(--vde-accent);
  color: #0a0a0f;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
}
.vde-menu-buttons .btn-vde-primary:hover {
  opacity: 0.85;
}

/* ── Disabled Button ── */
.btn-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  position: relative;
}
.btn-disabled-hint {
  display: block;
  font-size: 0.72rem;
  color: var(--sub);
  margin-top: 0.3rem;
  font-weight: 400;
}

/* ── Tab Navigation ── */
.vde-tabs {
  display: flex;
  overflow-x: auto;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.vde-tabs::-webkit-scrollbar { display: none; }

.vde-tab {
  flex: 0 0 auto;
  padding: 0.6rem 0.9rem;
  font-size: 0.78rem;
  color: var(--sub);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--sans);
  transition: color 0.15s, border-color 0.15s;
}
.vde-tab:hover {
  color: var(--text);
}
.vde-tab.active {
  color: var(--vde-accent);
  border-bottom-color: var(--vde-accent);
}

.vde-tab-content {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Placeholder ── */
.vde-placeholder {
  text-align: center;
  color: var(--sub);
  font-size: 0.88rem;
  padding: 2rem 1rem;
}
.vde-placeholder-icon {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

/* ── Session Cards ── */
.vde-session-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: border-color 0.15s;
}
.vde-session-card:hover {
  border-color: var(--vde-accent-dim);
}
.vde-session-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}
.vde-session-card-date {
  font-size: 0.82rem;
  color: var(--sub);
}
.vde-session-card-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.vde-session-card-badge.learn {
  background: var(--vde-accent-glow);
  color: var(--vde-accent);
}
.vde-session-card-badge.exam {
  background: rgba(247, 131, 106, 0.15);
  color: var(--accent2);
}
.vde-session-card-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--sub);
  margin-top: 0.3rem;
}
.vde-session-card-meta .score {
  color: var(--green);
  font-weight: 600;
}

/* ── Session Status Colors ── */
.session-status {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}
.status-completed {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}
.status-aborted {
  background: rgba(234, 179, 8, 0.2);
  color: #eab308;
}
.status-active {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

/* ── Session Abort-Step Info (Bug 10) ── */
.session-abort-step {
  font-size: 0.75rem;
  color: #eab308;
  background: rgba(234,179,8,0.1);
  padding: 2px 8px;
  border-radius: 4px;
}

/* ── Session Action Buttons ── */
.session-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.session-pdf-btn,
.session-resume-btn {
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.session-pdf-btn:hover,
.session-resume-btn:hover {
  border-color: var(--vde-accent-dim);
  background: var(--vde-accent-glow);
}
.session-resume-btn {
  border-color: var(--vde-accent-dim);
  color: var(--vde-accent);
}

/* ── Detail Section ── */
.vde-detail-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1rem 1.25rem;
}
.vde-detail-section h3 {
  font-size: 0.85rem;
  color: var(--sub);
  margin-bottom: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.vde-detail-section pre {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ════════════════════════════════════════════════════════
   Quiz Engine Styles
   ════════════════════════════════════════════════════════ */

/* ── Stepper ── */
.vde-stepper {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.75rem 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin-bottom: 0.3rem;
}
.vde-stepper::-webkit-scrollbar { display: none; }

.vde-step-dot {
  flex: 0 0 auto;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--sub);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
}
.vde-step-dot:hover {
  border-color: var(--vde-accent-dim);
  color: var(--text);
}
.vde-step-dot.current {
  border-color: var(--vde-accent);
  color: var(--vde-accent);
  box-shadow: 0 0 8px var(--vde-accent-glow);
  background: rgba(6, 182, 212, 0.08);
}
.vde-step-dot.done {
  border-color: var(--green);
  background: var(--green);
  color: #0a0a0f;
}
.vde-step-separator {
  width: 2px;
  height: 1.5rem;
  background: var(--border);
  flex: 0 0 auto;
  margin: 0 0.25rem;
}

/* ── Quiz Container ── */
.vde-quiz-container {
  min-height: 200px;
}
.vde-quiz-nav {
  display: flex;
  justify-content: center;
  padding: 1rem 0;
}

/* ── Step Header ── */
.vde-step-header {
  margin-bottom: 1rem;
}
.vde-phase-label {
  display: inline-block;
  font-size: 0.68rem;
  padding: 0.15rem 0.6rem;
  border-radius: 99px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
}
.vde-phase-label.vorbereitung {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}
.vde-phase-label.messung {
  background: var(--vde-accent-glow);
  color: var(--vde-accent);
}
.vde-step-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

/* ── Messstelle Context ── */
.vde-messstelle-ctx {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--vde-accent);
  border-radius: var(--r);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.vde-messstelle-label {
  font-weight: 600;
  color: var(--vde-accent);
  font-size: 0.9rem;
}
.vde-messwert-display {
  margin-top: 0.4rem;
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  background: rgba(6, 182, 212, 0.06);
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  display: inline-block;
}
.vde-messstelle-progress {
  margin-top: 0.3rem;
  font-size: 0.75rem;
  color: var(--sub);
}

/* ── Foto ── */
.vde-foto-wrap {
  margin-bottom: 1rem;
}
.vde-foto-toggle {
  background: none;
  border: 1px dashed var(--border);
  color: var(--sub);
  padding: 0.4rem 0.8rem;
  border-radius: var(--r);
  cursor: pointer;
  font-size: 0.8rem;
  font-family: var(--sans);
  transition: color 0.15s, border-color 0.15s;
}
.vde-foto-toggle:hover {
  color: var(--vde-accent);
  border-color: var(--vde-accent-dim);
}
.vde-foto-container {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  margin-top: 0.5rem;
}
.vde-foto-container.open {
  max-height: none;
}
.vde-foto-img {
  max-width: 100%;
  border-radius: var(--r);
  border: 1px solid var(--border);
}

/* ── Question ── */
.vde-question {
  margin-bottom: 1rem;
}
.vde-question-text {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

/* ── Options (Single Choice) ── */
.vde-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.vde-option-btn {
  width: 100%;
  padding: 0.7rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-size: 0.88rem;
  font-family: var(--sans);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.vde-option-btn:hover:not(:disabled) {
  border-color: var(--vde-accent-dim);
}
.vde-option-btn:disabled {
  cursor: default;
  opacity: 0.7;
}
.vde-option-btn.correct {
  border-color: var(--green);
  background: rgba(74, 222, 128, 0.1);
  color: var(--green);
  opacity: 1;
}
.vde-option-btn.wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  opacity: 1;
}

/* ── Unit Group ── */
.vde-unit-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.vde-unit-btn {
  padding: 0.6rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-size: 0.88rem;
  font-family: var(--sans);
  cursor: pointer;
  transition: border-color 0.15s;
}
.vde-unit-btn:hover:not(:disabled) {
  border-color: var(--vde-accent-dim);
}
.vde-unit-btn:disabled { cursor: default; opacity: 0.7; }
.vde-unit-btn.correct {
  border-color: var(--green);
  background: rgba(74, 222, 128, 0.1);
  color: var(--green);
  opacity: 1;
}
.vde-unit-btn.wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  opacity: 1;
}

/* ── Yes/No ── */
.vde-yesno-group {
  display: flex;
  gap: 0.75rem;
}
.vde-yesno-btn {
  flex: 1;
  text-align: center;
}

/* ── Protocol Entry ── */
.vde-protocol-wrap {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.vde-protocol-input {
  flex: 1;
  padding: 0.6rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--mono);
}
.vde-protocol-input:focus {
  outline: none;
  border-color: var(--vde-accent);
}
.vde-protocol-input.error {
  border-color: #ef4444;
}
.vde-protocol-input.correct {
  border-color: var(--green);
  background: rgba(74, 222, 128, 0.06);
}
.vde-protocol-input.wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.06);
}

/* ── Feedback ── */
.vde-feedback {
  margin-top: 0.75rem;
  padding: 0.8rem 1rem;
  border-radius: var(--r);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.3s;
}
.vde-feedback.visible {
  opacity: 1;
  transform: translateY(0);
}
.vde-feedback.correct {
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.3);
}
.vde-feedback.wrong {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.vde-feedback strong {
  display: block;
  margin-bottom: 0.3rem;
}
.vde-feedback.correct strong { color: var(--green); }
.vde-feedback.wrong strong { color: #ef4444; }
.vde-feedback p {
  font-size: 0.85rem;
  color: var(--text);
  margin: 0 0 0.3rem;
  line-height: 1.4;
}
.vde-feedback-grenzwert {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--vde-accent);
  margin-top: 0.3rem;
}
.vde-feedback-norm {
  font-size: 0.75rem;
  color: var(--sub);
  font-style: italic;
  margin-top: 0.2rem;
}

/* ── Next Button ── */
.vde-next-btn {
  display: block;
  margin: 1rem auto 0;
  padding: 0.6rem 2rem;
  background: var(--vde-accent);
  color: #0a0a0f;
  border: none;
  border-radius: var(--r);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  font-family: var(--sans);
  transition: opacity 0.15s;
  pointer-events: auto;
}
.vde-next-btn:hover { opacity: 0.85; }

/* ── Summary Card ── */
.vde-summary-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1rem 1.25rem;
  margin-top: 1rem;
}
.vde-summary-icon {
  font-size: 1.5rem;
  color: var(--green);
  font-weight: 700;
}

/* ── Finish Screen ── */
.vde-finish {
  text-align: center;
  padding: 1.5rem 0;
}
.vde-finish h2 {
  font-size: 1.3rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.vde-finish-score {
  font-size: 3rem;
  font-weight: 800;
  color: var(--vde-accent);
  margin: 0.5rem 0;
}
.vde-finish-detail {
  font-size: 0.9rem;
  color: var(--sub);
}
.vde-finish-time {
  font-size: 0.85rem;
  color: var(--sub);
  margin: 0.3rem 0 1.5rem;
}
.vde-finish-steps {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.75rem 1rem;
}
.vde-finish-step-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0;
  font-size: 0.82rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.vde-finish-step-row:last-child { border-bottom: none; }
.vde-finish-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 99px;
}
.vde-finish-badge.perfect {
  background: rgba(74, 222, 128, 0.15);
  color: var(--green);
}
.vde-finish-badge.partial {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}
.vde-finish-badge.skipped {
  background: var(--surface);
  color: var(--sub);
}

/* ── Small Button ── */
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
}

/* ── Report Modal ── */
#vde-report-modal .modal {
  max-width: 400px;
}

/* ════════════════════════════════════════════════════════
   Simulator Styles — SVG Schaltschrank
   ════════════════════════════════════════════════════════ */

/* ── Leiter-Farben (VDE-Norm) ── */
:root {
  --leiter-l1: #A0522D;
  --leiter-l2: #777;
  --leiter-l3: #999;
  --leiter-n:  #4488CC;
  --leiter-pe: #77AA33;
  --leiter-pe-alt: #CCCC00;
}

/* ── Fullscreen Simulator — Canvas Layout ── */
.sim-fullscreen {
  position: relative;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── SVG Panel — Full-screen canvas behind everything ── */
.sim-svg-panel {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background: var(--bg);
  touch-action: none;
}

/* ── Overlay Bar — Stepper + Step Info INSIDE svg-panel ── */
.sim-overlay-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  background: rgba(10, 10, 15, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  pointer-events: auto;
  transition: max-height 0.25s ease;
  overflow: hidden;
}
/* Collapsed: only summary visible */
.sim-overlay-bar.sim-overlay-collapsed .sim-overlay-expanded {
  display: none;
}
.sim-overlay-summary {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--vde-accent, #06b6d4);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.sim-overlay-summary::before {
  content: '\25B6';
  font-size: 0.6rem;
  transition: transform 0.2s;
}
.sim-overlay-bar:not(.sim-overlay-collapsed) .sim-overlay-summary::before {
  transform: rotate(90deg);
}
.sim-overlay-bar:not(.sim-overlay-collapsed) .sim-overlay-summary {
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.2rem;
}
.sim-overlay-expanded {
  padding: 0.25rem 0.5rem 0.4rem;
}

/* ── Protocol Panel — Push Layout (Flex Split) ── */
.sim-proto-panel {
  display: none;
  overflow-y: auto;
  padding: 1rem;
  padding-top: 3.5rem;
  background: rgba(18, 18, 30, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 1px solid var(--border);
  z-index: 20;
  position: relative;
  flex: 0 0 40%;
  min-width: 25%;
  max-width: 70%;
  transition: flex-basis 0.3s ease;
}
.sim-proto-panel.open {
  display: block;
}

/* ── Split Mode — Flex container for SVG + Divider + Panel ── */
.sim-split-mode {
  display: flex !important;
  flex-direction: row !important;
  width: 100%;
  height: 100%;
}
.sim-split-mode .sim-svg-panel {
  position: relative;
  flex: 1;
  min-width: 30%;
}
.sim-split-mode .sim-proto-panel {
  position: relative;
  transform: none;
}

/* ── Divider — draggable separator ── */
.sim-divider {
  width: 6px;
  cursor: col-resize;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.15s;
  z-index: 25;
  touch-action: none;
}
.sim-divider:hover, .sim-divider.dragging {
  background: var(--vde-accent);
}

/* ── Download Button in Proto Header ── */
.sim-proto-download {
  position: absolute;
  top: 0.5rem;
  right: 5rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  color: var(--sub);
  cursor: pointer;
  z-index: 5;
  transition: color 0.15s, border-color 0.15s;
}
.sim-proto-download:hover {
  color: var(--vde-accent);
  border-color: var(--vde-accent);
}

/* Close button inside proto panel */
.sim-proto-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  color: var(--sub);
  cursor: pointer;
  z-index: 5;
  transition: color 0.15s, border-color 0.15s;
}
.sim-proto-close:hover {
  color: var(--vde-accent);
  border-color: var(--vde-accent);
}

/* ── Floating Toolbar — bottom right ── */
.sim-toolbar {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  z-index: 15;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.sim-toolbar-btn {
  padding: 0.5rem 0.9rem;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: var(--sans);
  background: rgba(18, 18, 30, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  color: var(--sub);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
}
.sim-toolbar-btn:hover {
  color: var(--vde-accent);
  border-color: var(--vde-accent-dim);
}
.sim-toolbar-btn.active {
  color: var(--vde-accent);
  border-color: var(--vde-accent);
  background: rgba(6, 182, 212, 0.1);
}
.sim-toolbar-btn.btn-abort {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}
.sim-toolbar-btn.btn-abort:hover {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* ── Landscape Hint Overlay (Portrait Mobile) ── */
.sim-landscape-hint {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 50;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
  text-align: center;
  color: var(--sub);
  font-size: 1rem;
  padding: 2rem;
  background: var(--bg);
}
.sim-landscape-hint .rotate-icon {
  font-size: 2.5rem;
  opacity: 0.5;
}
.sim-landscape-hint p {
  max-width: 280px;
  line-height: 1.5;
}

@media (max-width: 767px) and (orientation: portrait) {
  .sim-landscape-hint { display: flex; }
}

/* ── Proto panel responsive ── */
@media (max-width: 767px) {
  .sim-proto-panel {
    flex: 0 0 100% !important;
    max-width: 100vw;
    min-width: 100%;
  }
  .sim-divider {
    display: none;
  }
  .sim-split-mode .sim-svg-panel {
    display: none;
  }
}

/* ── SVG Base Styles ── */
.sim-schaltschrank {
  width: 100%;
  height: 100%;
  min-height: 500px;
  background: var(--bg-card, var(--surface));
  border-radius: var(--r);
}

/* ── Clickable SVG Elements ── */
.svg-clickable {
  cursor: pointer;
  transition: opacity 0.2s, filter 0.2s;
}
.svg-clickable:hover {
  opacity: 0.8;
  filter: brightness(1.2);
}

/* ── Verbraucher Symbols ── */
.svg-verbraucher-icon {
  fill: #e8e8f0;
  text-anchor: middle;
  dominant-baseline: central;
  font-weight: 600;
}

/* ── Reserve Circuits (F11-F13) ── */
.svg-reserve {
  opacity: 0.4;
  pointer-events: none;
}

/* ── Zoom Reset Button (now in toolbar) ── */
.sim-zoom-reset {
  display: none; /* replaced by toolbar */
}

/* ── SVG Schutzgeraet Symbols ── */
.svg-schutzgeraet-rect {
  fill: #1a1a2e;
  stroke: var(--border);
  stroke-width: 1.5;
}
.svg-schutzgeraet-label {
  fill: var(--text);
  font-size: 10px;
  font-family: var(--mono);
  text-anchor: middle;
  dominant-baseline: central;
}
.svg-schutzgeraet-typ {
  fill: var(--sub);
  font-size: 8px;
  font-family: var(--sans);
  text-anchor: middle;
  dominant-baseline: central;
}
.svg-zaehler-stand {
  fill: #0f0;
  font-size: 12px;
  font-family: var(--mono);
  text-anchor: middle;
  dominant-baseline: central;
}
.svg-zaehler-nummer {
  fill: #FFB020;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--mono);
  text-anchor: middle;
  dominant-baseline: central;
}

/* ── SVG Klemme Styles ── */
.svg-klemme-circle {
  fill: var(--surface);
  stroke: var(--border);
  stroke-width: 1.5;
}
.svg-klemme-label {
  fill: var(--sub);
  font-size: 7px;
  font-family: var(--mono);
  text-anchor: middle;
  dominant-baseline: central;
}

/* ── SVG Klemmleiste Header ── */
.svg-klemmleiste-label {
  fill: var(--vde-accent);
  font-size: 11px;
  font-weight: 600;
  font-family: var(--sans);
  text-anchor: middle;
  dominant-baseline: central;
}

/* ── SVG Section Labels ── */
.svg-section-label {
  fill: var(--sub);
  font-size: 9px;
  font-family: var(--sans);
  text-anchor: middle;
  dominant-baseline: central;
}

/* ── SVG Sammelschiene Labels ── */
.svg-sammelschiene-label {
  fill: var(--text);
  font-size: 10px;
  font-weight: 700;
  font-family: var(--mono);
  text-anchor: end;
  dominant-baseline: central;
}

/* ── Pruefspitze Indicator ── */
.svg-pruefspitze-1 {
  filter: drop-shadow(0 0 6px #4488ff);
  stroke: #4488ff !important;
  stroke-width: 3 !important;
  fill: #4488ff !important;
  fill-opacity: 0.4 !important;
}
.svg-pruefspitze-2 {
  filter: drop-shadow(0 0 6px #ff6644);
  stroke: #ff6644 !important;
  stroke-width: 3 !important;
  fill: #ff6644 !important;
  fill-opacity: 0.4 !important;
}

/* ── Locked Leiter (N/PE lock for 3-phase) ── */
.svg-leiter-locked {
  filter: drop-shadow(0 0 4px #aaaaff);
  stroke: #aaaaff !important;
  stroke-width: 3 !important;
  opacity: 0.9;
}

/* ── Simulator Nav (replaced by toolbar) ── */
.sim-nav {
  display: none;
}

/* ── Simulator Placeholder ── */
.sim-proto-placeholder {
  text-align: center;
  color: var(--sub);
  font-size: 0.85rem;
  padding: 2rem 1rem;
}
.sim-proto-placeholder-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

/* ════════════════════════════════════════════════════════
   Simulator Interaction Styles — Click Feedback & State
   ════════════════════════════════════════════════════════ */

/* ── Flash Animations ── */
@keyframes flash-error {
  0% { stroke: #ff4444; stroke-width: 8; filter: drop-shadow(0 0 8px #ff4444); }
  100% { stroke: inherit; stroke-width: inherit; filter: none; }
}
.svg-flash-error { animation: flash-error 0.6s ease-out; }

/* ── RCD Trip Animation (lightning bolt) ── */
@keyframes rcd-trip-flash {
  0%   { filter: drop-shadow(0 0 0px #ffcc00); opacity: 1; }
  15%  { filter: drop-shadow(0 0 20px #ffee44); opacity: 1; }
  30%  { filter: drop-shadow(0 0 4px #ffcc00); opacity: 0.6; }
  50%  { filter: drop-shadow(0 0 25px #ffee44); opacity: 1; }
  70%  { filter: drop-shadow(0 0 8px #ff8800); opacity: 0.8; }
  100% { filter: none; opacity: 1; }
}
.svg-rcd-tripping {
  animation: rcd-trip-flash 0.6s ease-out;
}
.svg-rcd-trip-bolt {
  fill: #ffcc00;
  filter: drop-shadow(0 0 6px #ffee44);
  pointer-events: none;
}
/* Tripped device: pulsing red border to signal "click to reset" */
@keyframes rcd-tripped-pulse {
  0%, 100% { stroke: #ef4444; filter: drop-shadow(0 0 3px #ef4444); }
  50% { stroke: #ff6666; filter: drop-shadow(0 0 8px #ff6666); }
}
.svg-rcd-tripped .svg-schutzgeraet-rect {
  animation: rcd-tripped-pulse 1.5s infinite;
  cursor: pointer;
}

@keyframes flash-success {
  0% { stroke: #44ff44; stroke-width: 8; filter: drop-shadow(0 0 8px #44ff44); }
  100% { stroke: inherit; stroke-width: inherit; filter: none; }
}
.svg-flash-success { animation: flash-success 0.4s ease-out; }

/* ── Measuring Glow (yellow 2s after successful measurement) ── */
@keyframes measuring-glow {
  0% { stroke-opacity: 1; }
  70% { stroke-opacity: 1; }
  100% { stroke-opacity: 0.4; }
}
.svg-measuring-glow {
  animation: measuring-glow 2s ease-out forwards;
  stroke: #ffcc00 !important;
  stroke-width: 4 !important;
}

/* ── Correct Target Highlight (after 3 failures) ── */
@keyframes pulse-correct {
  0%, 100% { filter: drop-shadow(0 0 4px #44ff44); }
  50% { filter: drop-shadow(0 0 12px #44ff44); }
}
.svg-highlight-correct { animation: pulse-correct 1.5s infinite; }

/* ── Switched Off State (Schutzgeräte, NTK) ── */
.svg-switched-off .svg-schutzgeraet-rect {
  fill: #331111;
  stroke: #ef4444;
  stroke-width: 2;
}
.svg-switched-off .svg-schutzgeraet-label {
  fill: #ef4444;
}
.svg-switched-off { opacity: 0.7; }
.svg-switched-on { opacity: 1; stroke-dasharray: none; }

/* ── NTK Open State ── */
.svg-ntk-open rect { stroke: #ef4444 !important; stroke-dasharray: 4 2; }

/* ── NTK Label ── */
.svg-ntk-label {
  fill: var(--sub);
  font-size: 8px;
  font-family: var(--mono);
  text-anchor: middle;
  dominant-baseline: central;
}

/* ── Step Instruction Bar ── */
.sim-step-instruction {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid var(--vde-accent-dim);
  border-radius: var(--r);
  padding: 0.3rem 0.6rem;
  margin-bottom: 0.2rem;
  font-size: 0.85rem;
  color: var(--vde-accent);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sim-step-instruction-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ── Auto-fill Protocol Button ── */
.sim-autofill-btn {
  display: block;
  margin: 0.5rem auto 0;
  padding: 0.5rem 1.2rem;
  background: var(--vde-accent);
  color: #0a0a0f;
  border: none;
  border-radius: var(--r);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  font-family: var(--sans);
  transition: opacity 0.15s;
}
.sim-autofill-btn:hover { opacity: 0.85; }

/* ── Completed Target ── */
.svg-target-done { opacity: 0.5; }

/* ── Feedback Panel ── */
.sim-feedback-panel {
  position: relative;
  z-index: 10;
  pointer-events: auto;
  margin: 0.25rem 0;
}
.sim-feedback-msg {
  padding: 0.6rem 1rem;
  border-radius: var(--r);
  font-size: 0.82rem;
  font-family: var(--sans);
  margin-top: 0.3rem;
  pointer-events: auto;
  transition: opacity 0.3s;
}
.sim-feedback-success {
  background: rgba(74, 222, 128, 0.15);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: var(--green);
}
.sim-feedback-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #ef4444;
}
.sim-feedback-fade {
  opacity: 0;
}
.sim-feedback-ok {
  margin-left: 1rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: var(--r);
  color: inherit;
  cursor: pointer;
  opacity: 0.8;
}
.sim-feedback-ok:hover { opacity: 1; }

/* ── Step Info Panel ── */
.sim-step-info {
  padding: 0.25rem 0.5rem;
  margin-bottom: 0.2rem;
}
.sim-step-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin: 0.1rem 0 0;
}
.sim-step-desc {
  font-size: 0.72rem;
  color: var(--sub);
  margin-top: 0.1rem;
}

/* ── Progress Display ── */
.sim-progress {
  font-size: 0.78rem;
  color: var(--vde-accent);
  padding: 0.3rem 0.5rem;
  background: rgba(6, 182, 212, 0.08);
  border-radius: var(--r);
  margin-bottom: 0.3rem;
  pointer-events: auto;
}

/* ════════════════════════════════════════════════════════
   Protokoll-Panel Styles
   ════════════════════════════════════════════════════════ */

/* ── Proto Tabs ── */
.sim-proto-tabs {
  display: flex;
  overflow-x: auto;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.sim-proto-tabs::-webkit-scrollbar { display: none; }

.sim-proto-tab {
  flex: 0 0 auto;
  padding: 0.5rem 0.7rem;
  font-size: 0.72rem;
  color: var(--sub);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--sans);
  transition: color 0.15s, border-color 0.15s;
}
.sim-proto-tab:hover { color: var(--text); }
.sim-proto-tab.active {
  color: var(--vde-accent);
  border-bottom-color: var(--vde-accent);
}

.sim-proto-tab-content {
  min-height: 100px;
}

/* ── Proto Progress ── */
.sim-proto-progress {
  font-size: 0.78rem;
  color: var(--vde-accent);
  padding: 0.4rem 0.6rem;
  background: rgba(6, 182, 212, 0.06);
  border-radius: var(--r);
  margin-bottom: 0.5rem;
  text-align: center;
  font-weight: 600;
}

/* ── Proto Gruppe ── */
.sim-proto-gruppe {
  margin-bottom: 1rem;
}
.sim-proto-gruppe-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--sub);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.4rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border);
}

/* ── Proto Feld ── */
.sim-proto-feld {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.4rem 0.5rem;
  border-radius: var(--r);
  transition: background 0.2s;
  margin-bottom: 0.15rem;
}
.sim-proto-feld.filled {
  background: rgba(6, 182, 212, 0.05);
}
.sim-proto-feld.highlight {
  background: rgba(6, 182, 212, 0.15);
  outline: 1px solid var(--vde-accent);
}

.sim-proto-label {
  font-size: 0.78rem;
  color: var(--text);
  font-weight: 500;
}
.sim-proto-required {
  color: #ef4444;
}

.sim-proto-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.sim-proto-input {
  flex: 1;
  padding: 0.35rem 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.82rem;
  font-family: var(--mono);
  min-width: 0;
}
.sim-proto-input:focus {
  outline: none;
  border-color: var(--vde-accent);
}
.sim-proto-input.error {
  border-color: #ef4444;
}

.sim-proto-select {
  flex: 1;
  padding: 0.35rem 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.82rem;
  font-family: var(--sans);
  min-width: 0;
}
.sim-proto-select:focus {
  outline: none;
  border-color: var(--vde-accent);
}

.sim-proto-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--vde-accent);
}

.sim-proto-unit {
  font-size: 0.72rem;
  color: var(--sub);
  font-weight: 600;
  white-space: nowrap;
  padding: 0.2rem 0.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.sim-proto-grenzwert {
  font-size: 0.68rem;
  color: var(--vde-accent);
  white-space: nowrap;
  font-family: var(--mono);
}

/* ── Bewertung Badge ── */
.sim-proto-bewertung-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 99px;
  white-space: nowrap;
}
.sim-proto-bewertung-badge.io {
  background: rgba(74, 222, 128, 0.15);
  color: var(--green);
}
.sim-proto-bewertung-badge.nio {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* ── Messwert Prompt Overlay ── */
.sim-messwert-prompt {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 15, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 1rem;
}

.sim-messwert-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.25rem;
  max-width: 340px;
  width: 100%;
}

.sim-messwert-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.sim-messwert-hint {
  font-size: 0.82rem;
  color: var(--vde-accent);
  font-family: var(--mono);
  background: rgba(6, 182, 212, 0.08);
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.sim-messwert-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.sim-messwert-btns {
  display: flex;
  gap: 0.5rem;
}
.sim-messwert-btns .btn {
  flex: 1;
  text-align: center;
}

/* ════════════════════════════════════════════════════════
   Grenzwert-Check / Bewertung Buttons
   ════════════════════════════════════════════════════════ */

.sim-bewertung-btns {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.sim-bewertung-io {
  flex: 1;
  padding: 0.7rem 1rem;
  background: rgba(74, 222, 128, 0.12);
  border: 2px solid rgba(74, 222, 128, 0.4);
  border-radius: var(--r);
  color: var(--green);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--sans);
  transition: background 0.15s, border-color 0.15s;
}
.sim-bewertung-io:hover {
  background: rgba(74, 222, 128, 0.2);
  border-color: var(--green);
}

.sim-bewertung-nio {
  flex: 1;
  padding: 0.7rem 1rem;
  background: rgba(239, 68, 68, 0.12);
  border: 2px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--r);
  color: #ef4444;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--sans);
  transition: background 0.15s, border-color 0.15s;
}
.sim-bewertung-nio:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
}

/* ════════════════════════════════════════════════════════
   Maengelliste Styles
   ════════════════════════════════════════════════════════ */

.sim-mangel-form {
  background: var(--bg);
  border: 1px solid var(--vde-accent-dim);
  border-radius: var(--r);
  padding: 1rem;
  margin-top: 0.75rem;
}

.sim-mangel-textarea {
  width: 100%;
  padding: 0.4rem 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-size: 0.82rem;
  font-family: var(--sans);
  resize: vertical;
  min-height: 2.5rem;
}
.sim-mangel-textarea:focus {
  outline: none;
  border-color: var(--vde-accent);
}

.sim-mangel-entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid #ef4444;
  border-radius: var(--r);
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.5rem;
}

.sim-mangel-header {
  font-size: 0.82rem;
  font-weight: 600;
  color: #ef4444;
  margin-bottom: 0.2rem;
}

.sim-mangel-desc {
  font-size: 0.82rem;
  color: var(--text);
  margin-bottom: 0.2rem;
}

.sim-mangel-meta {
  font-size: 0.72rem;
  color: var(--sub);
}

/* ════════════════════════════════════════════════════════
   Simulator Finish Screen
   ════════════════════════════════════════════════════════ */

.sim-finish {
  text-align: center;
  padding: 1.5rem 0;
}
.sim-finish h2 {
  font-size: 1.3rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.sim-finish-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1rem 0;
}

.sim-finish-stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.75rem;
  text-align: center;
}

.sim-finish-stat-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--vde-accent);
  font-family: var(--mono);
}

.sim-finish-stat-label {
  font-size: 0.72rem;
  color: var(--sub);
  margin-top: 0.15rem;
}

/* ════════════════════════════════════════════════════════
   PDF Protokoll — Tab Bar, Canvas, Overlays
   ════════════════════════════════════════════════════════ */

/* ── Tab Bar ── */
.proto-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 0 0 0.5rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}
.proto-tab {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.35rem 0.3rem;
  font-size: 0.65rem;
  font-weight: 600;
  font-family: var(--sans);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r2) var(--r2) 0 0;
  color: var(--sub);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.proto-tab:hover {
  color: var(--text);
  border-color: var(--vde-accent-dim, rgba(6, 182, 212, 0.4));
}
.proto-tab.active {
  color: var(--vde-accent, #06b6d4);
  border-color: var(--vde-accent, #06b6d4);
  background: rgba(6, 182, 212, 0.08);
  border-bottom-color: transparent;
}

/* ── Progress Dot ── */
.progress-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: transparent;
  flex-shrink: 0;
}
.progress-dot.dot-green {
  background: #22c55e;
}
.progress-dot.dot-yellow {
  background: #eab308;
}

/* ── Fullscreen Button ── */
.proto-fullscreen-btn {
  position: absolute;
  top: 0.5rem;
  right: 2.5rem;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  color: var(--sub);
  cursor: pointer;
  z-index: 5;
  transition: color 0.15s, border-color 0.15s;
}
.proto-fullscreen-btn:hover {
  color: var(--vde-accent);
  border-color: var(--vde-accent);
}

/* ── Page Container (holds canvas + overlay) ── */
.proto-page-container {
  position: relative;
  width: 100%;
  min-height: 200px;
}

/* ── Canvas ── */
.proto-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r2);
}

/* ── Overlay Container ── */
.proto-overlay-container {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

/* ── Overlay Inputs ── */
.proto-overlay-input {
  position: absolute;
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(100, 100, 120, 0.35);
  border-radius: 1px;
  outline: none;
  color: #1a1a2e;
  font-family: var(--mono, monospace);
  padding: 0 2px;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.proto-overlay-input:focus {
  border: 1px solid rgba(6, 182, 212, 0.7);
  box-shadow: 0 0 4px rgba(6, 182, 212, 0.4);
  background: rgba(255, 255, 255, 0.85);
  border-radius: 2px;
  z-index: 2;
}
.proto-overlay-input:hover:not(:focus) {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(100, 100, 120, 0.5);
}
.proto-overlay-input.auto-filled {
  color: #0097a7;
  background: rgba(0, 188, 212, 0.08);
}

/* ── Auto-Fill Highlight Animation ── */
.proto-field-highlight {
  animation: proto-blink 0.5s ease 2;
}
@keyframes proto-blink {
  50% { background: rgba(0, 188, 212, 0.3); }
}

/* ── Overlay Input Feedback (Lernmodus) ── */
.proto-overlay-input.valid {
  border-color: #4caf50;
  box-shadow: 0 0 0 1.5px #4caf50, 0 0 4px rgba(76, 175, 80, 0.3);
  background: rgba(76, 175, 80, 0.1);
}
.proto-overlay-input.invalid {
  border-color: #f44336;
  box-shadow: 0 0 0 1.5px #f44336, 0 0 4px rgba(244, 67, 54, 0.3);
  background: rgba(244, 67, 54, 0.1);
}
.proto-feedback-icon {
  position: absolute;
  pointer-events: none;
  font-size: 12px;
  line-height: 1;
  z-index: 3;
}
.proto-feedback-icon.icon-ok { color: #4caf50; }
.proto-feedback-icon.icon-err { color: #f44336; }

/* ── Overlay Checkboxes ── */
.proto-overlay-checkbox {
  appearance: auto;
  cursor: pointer;
  accent-color: var(--vde-accent, #06b6d4);
  width: auto !important;
  height: auto !important;
  max-width: 14px;
  max-height: 14px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
}

/* ── Fullscreen Mode ── */
.sim-proto-panel.proto-fullscreen {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transform: translateX(0);
  padding: 1rem;
  overflow-y: auto;
}

/* ── Toast ── */
.sim-toast {
  position: fixed;
  bottom: 4rem;
  right: 1.5rem;
  z-index: 200;
  padding: 0.6rem 1.2rem;
  font-size: 0.8rem;
  font-family: var(--sans);
  font-weight: 600;
  color: var(--text);
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: var(--r2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.sim-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ── Measurement Tooltip ── */
/* Bug 6 fix: larger font, stronger background, visible border, near clicked element */
.sim-measurement-tooltip {
  position: absolute;
  background: rgba(15, 23, 42, 0.97);
  color: #f0fdf4;
  border: 2px solid #22c55e;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--sans);
  pointer-events: none;
  z-index: 200;
  box-shadow: 0 6px 20px rgba(0,0,0,0.6), 0 0 0 1px rgba(34,197,94,0.3);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(0);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.sim-measurement-tooltip.show {
  opacity: 1;
  transform: translateY(-4px);
}

/* ── SVG Checkmark ── */
.svg-checkmark {
  fill: #22c55e;
  font-weight: bold;
  pointer-events: none;
}

/* ── Target Checklist ── */
.sim-target-checklist {
  font-size: 0.72rem;
  color: var(--sub);
  padding: 4px 8px;
  background: rgba(6, 182, 212, 0.08);
  border-radius: 4px;
  margin-top: 4px;
  line-height: 1.4;
}

/* ── SVG Grenzwert Flash (green/red) — filter-overlay, Adern bleiben sichtbar ── */
.svg-flash-green {
  animation: svgFlashGreen 2s ease;
}
@keyframes svgFlashGreen {
  0%   { filter: drop-shadow(0 0 6px #22c55e) drop-shadow(0 0 12px #22c55e); stroke-width: 5; }
  40%  { filter: drop-shadow(0 0 4px #22c55e) drop-shadow(0 0 8px #22c55e); }
  100% { filter: none; }
}
.svg-flash-red {
  animation: svgFlashRed 2s ease;
}
@keyframes svgFlashRed {
  0%   { filter: drop-shadow(0 0 6px #ef4444) drop-shadow(0 0 12px #ef4444); stroke-width: 5; }
  40%  { filter: drop-shadow(0 0 4px #ef4444) drop-shadow(0 0 8px #ef4444); }
  100% { filter: none; }
}

/* ── Proto Field Grenzwert Feedback ── */
.proto-field-ok {
  border: 2px solid #22c55e !important;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.3);
}
.proto-field-fail {
  border: 2px solid #ef4444 !important;
  background: rgba(239, 68, 68, 0.1) !important;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.3);
}
.proto-field-tooltip {
  position: absolute;
  font-size: 0.65rem;
  color: #e2e8f0;
  background: #1e293b;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 110;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ── Weiter-Button (Lernmodus) — floating, always visible ── */
.sim-next-btn {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 32px;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
  z-index: 200;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
  animation: simNextBtnPulse 2s ease-in-out infinite;
}
.sim-next-btn:hover {
  filter: brightness(1.15);
  transform: translateX(-50%) scale(1.05);
}
@keyframes simNextBtnPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4); }
  50% { box-shadow: 0 4px 24px rgba(59, 130, 246, 0.7); }
}

/* ── Stepper: locked dots ── */
.vde-step-dot.locked {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
  background: #333 !important;
  color: #666 !important;
}

/* ── Modus-Auswahl (Bug 8) ── */
.vde-modus-auswahl {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 1rem;
}
.vde-modus-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--fg, #f1f5f9);
  margin: 0;
}
.vde-modus-cards {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  justify-content: center;
}
.vde-modus-card {
  background: var(--card, #0f172a);
  border: 2px solid rgba(99,102,241,0.3);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  width: 220px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  text-align: center;
}
.vde-modus-card:hover {
  border-color: #6366f1;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(99,102,241,0.25);
}
.vde-modus-card-exam {
  border-color: rgba(234,179,8,0.3);
}
.vde-modus-card-exam:hover {
  border-color: #eab308;
  box-shadow: 0 8px 24px rgba(234,179,8,0.2);
}
.vde-modus-card-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.vde-modus-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg, #f1f5f9);
  margin-bottom: 0.5rem;
}
.vde-modus-card-desc {
  font-size: 0.78rem;
  color: var(--sub, #94a3b8);
  line-height: 1.4;
}
.vde-modus-back {
  margin-top: 0.5rem;
}

/* ── Kopfdaten Dialog ── */
.sim-kopfdaten-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sim-kopfdaten-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 24px;
  max-width: 400px;
  width: 90%;
}
.sim-kopfdaten-dialog h3 {
  margin: 0 0 16px;
  font-size: 1.1rem;
}
.sim-kopfdaten-field {
  margin-bottom: 16px;
}
.sim-kopfdaten-field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--sub);
  margin-bottom: 4px;
}
.sim-kopfdaten-field input,
.sim-kopfdaten-field select {
  width: 100%;
  padding: 8px 12px;
  font-size: 0.88rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  color: var(--text);
  font-family: inherit;
  box-sizing: border-box;
}
.sim-kopfdaten-ok {
  width: 100%;
  padding: 10px;
  margin-top: 8px;
  background: var(--vde-accent);
  color: #0a0a0f;
  border: none;
  border-radius: var(--r2);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
}
.sim-kopfdaten-ok:hover {
  filter: brightness(1.1);
}

/* ── Tooltip Engine (Lernmodus contextual help) ── */
.proto-tooltip {
  position: absolute; width: 260px; max-height: 280px; overflow-y: auto;
  background: var(--surface2); border: 1px solid var(--border);
  border-left: 3px solid var(--vde-accent); border-radius: var(--r2);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4); z-index: 100;
  padding: 8px 8px 8px 12px; opacity: 0; transition: opacity 150ms ease-out;
}
.tt-desc { color: var(--text); font-size: 0.75rem; line-height: 1.3; margin-bottom: 4px; }
.tt-grenzwert { color: var(--vde-accent); font-size: 0.75rem; line-height: 1.3; margin-bottom: 4px; }
.tt-divider { border-top: 1px solid var(--border); margin: 4px 0; }
.tt-antwort { color: var(--green); font-size: 0.75rem; line-height: 1.3; margin-bottom: 4px; }
.tt-praxis { color: var(--sub); font-size: 0.75rem; font-style: italic; line-height: 1.3; }

/* ── Radio i.O./n.i.O. Fields ── */
.proto-radio-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 1px 3px;
  font-size: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(100, 100, 120, 0.35);
  border-radius: 2px;
  box-sizing: border-box;
  pointer-events: auto;
}
.proto-radio-row.besichtigung-highlight {
  outline: 2px solid var(--vde-accent) !important;
  outline-offset: 1px;
}
.proto-radio-row.auto-filled {
  background: rgba(0, 188, 212, 0.08);
}
.proto-radio-group {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.proto-radio-option {
  display: flex;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  font-size: 9px;
  color: #1a1a2e;
  white-space: nowrap;
}
.proto-radio-option input[type="radio"] {
  width: 10px;
  height: 10px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--vde-accent, #06b6d4);
}

/* ── Besichtigungs-Schritt (Step 5) ── */
.besichtigung-highlight {
  outline: 2px solid var(--vde-accent) !important;
  outline-offset: 2px;
}
.proto-overlay input[type="checkbox"].besichtigung-highlight {
  min-width: 18px; min-height: 18px; padding: 13px; /* 44px Touch-Target */
}
.besichtigung-feedback-icon {
  display: inline-block; margin-left: 4px; font-size: 0.75rem; font-weight: 600;
  position: absolute;
}
.besichtigung-feedback-icon.ok { color: var(--green); }
.besichtigung-feedback-icon.fail { color: var(--red); }
#sim-besichtigung-hint {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-size: 0.88rem; color: var(--sub); opacity: 0.7; pointer-events: none;
  text-align: center; z-index: 5;
}

/* ── Feld-Validierung (Pflichtfeld + Plausibilitaet) ── */
.proto-field-empty {
  border: 2px solid var(--yellow) !important;
  background: rgba(247, 195, 106, 0.05) !important;
}
.proto-field-implausible {
  border: 2px solid var(--accent2) !important;
  background: rgba(247, 131, 106, 0.05) !important;
}
.proto-plausibility-warning {
  font-size: 0.75rem;
  color: var(--accent2);
  margin-top: 2px;
  position: absolute;
  white-space: nowrap;
  pointer-events: none;
  z-index: 50;
}

/* ── Fortschrittsbalken (Protokoll-Vollstaendigkeit) ── */
.sim-proto-progress-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
}
.sim-proto-progress-bar .progress-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--vde-accent);
  white-space: nowrap;
}
.sim-proto-progress-bar .progress-track {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.sim-proto-progress-bar .progress-fill {
  height: 100%;
  background: var(--vde-accent);
  border-radius: 2px;
  transition: width 300ms ease;
  width: 0%;
}

/* ── Protokoll-Abschluss-Button ── */
.sim-proto-finish-btn {
  margin: 12px;
  width: calc(100% - 24px);
  padding: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  border-radius: var(--r2);
  cursor: pointer;
  background: var(--vde-accent);
  color: #0a0a0f;
}
.sim-proto-finish-btn:hover { opacity: 0.85; }

/* ── Protokoll-Zusammenfassung Dialog ── */
.sim-summary-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.7);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sim-summary-dialog {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 24px;
  max-width: 480px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}
.sim-summary-dialog h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
}
.sim-summary-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 0.88rem;
}
.sim-summary-row.complete { color: var(--green); }
.sim-summary-row.empty { color: var(--yellow); }
.sim-summary-row.wrong { color: var(--red); }
.sim-summary-details {
  margin-top: 12px;
}
.sim-summary-details summary {
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--sub);
}
.sim-summary-details ul {
  font-size: 0.75rem;
  color: var(--text);
  padding-left: 16px;
  margin: 4px 0;
}
.sim-summary-close {
  width: 100%;
  margin-top: 16px;
  padding: 10px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--r2);
  font-size: 0.88rem;
  cursor: pointer;
  font-family: var(--sans);
}
.sim-summary-close:hover {
  border-color: var(--sub);
}

/* ═══════════════════════════════════════════════════════
   Admin Protokoll-Editor
   ═══════════════════════════════════════════════════════ */
.proto-editor-layout { display: flex; gap: 16px; height: 70vh; }
.proto-editor-canvas-wrap { flex: 7; display: flex; flex-direction: column; overflow: hidden; }
.proto-editor-canvas { flex: 1; position: relative; overflow: auto; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r2); }
.proto-editor-pdf-canvas { display: block; }
.proto-editor-overlay { position: absolute; top: 0; left: 0; pointer-events: auto; }
.proto-editor-props { flex: 3; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r2); padding: 16px; }
.proto-editor-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); }
.proto-editor-tab { padding: 6px 12px; font-size: 0.75rem; background: none; border: none; border-bottom: 2px solid transparent; color: var(--sub); cursor: pointer; font-family: var(--sans); }
.proto-editor-tab.active { color: var(--vde-accent); border-bottom-color: var(--vde-accent); }
.proto-editor-field {
  position: absolute; border: 2px dashed var(--vde-accent);
  background: rgba(6, 182, 212, 0.1); cursor: move; z-index: 10;
  box-sizing: border-box;
}
.proto-editor-field.selected {
  border-style: solid; background: rgba(6, 182, 212, 0.2);
}
.proto-editor-field.dragging { opacity: 0.7; }
.proto-editor-field-label { font-size: 9px; color: var(--vde-accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 1px 2px; pointer-events: none; }
.proto-editor-handle {
  position: absolute; width: 6px; height: 6px; background: var(--vde-accent); z-index: 11;
}
.proto-editor-handle.top-left { top: -3px; left: -3px; cursor: nwse-resize; }
.proto-editor-handle.top-right { top: -3px; right: -3px; cursor: nesw-resize; }
.proto-editor-handle.bottom-left { bottom: -3px; left: -3px; cursor: nesw-resize; }
.proto-editor-handle.bottom-right { bottom: -3px; right: -3px; cursor: nwse-resize; }
.proto-editor-field-preview {
  position: absolute; border: 2px dashed var(--vde-accent);
  background: rgba(6, 182, 212, 0.15); pointer-events: none; z-index: 12;
}
.proto-editor-actions { display: flex; gap: 8px; margin-top: 12px; justify-content: flex-end; }
.proto-editor-empty-hint { font-size: 0.75rem; color: var(--sub); }
.proto-editor-props h4 { margin: 0 0 12px; font-size: 0.88rem; color: var(--text); }
.proto-editor-props label { display: block; font-size: 0.75rem; font-weight: 600; color: var(--sub); margin: 8px 0 4px; }
.proto-editor-props input, .proto-editor-props select, .proto-editor-props textarea {
  width: 100%; padding: 6px 8px; font-size: 0.75rem;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r2); color: var(--text); font-family: inherit;
  box-sizing: border-box;
}
.proto-editor-props textarea { min-height: 60px; resize: vertical; }
.btn-vde-secondary {
  padding: 8px 16px; background: none; border: 1px solid var(--border);
  color: var(--text); border-radius: var(--r2); font-size: 0.75rem; cursor: pointer;
  font-family: var(--sans);
}
.btn-vde-secondary:hover { border-color: var(--sub); }
.btn-vde-primary {
  padding: 8px 16px; background: var(--vde-accent); border: none;
  color: #0a0a0f; border-radius: var(--r2); font-size: 0.75rem; cursor: pointer;
  font-weight: 600; font-family: var(--sans);
}
.btn-vde-primary:hover { opacity: 0.85; }

/* ════════════════════════════════════════════════════════
   Evaluation Screen Styles (Phase 4)
   ════════════════════════════════════════════════════════ */

/* ── Score Section ── */
.sim-eval-score { text-align: center; padding: 24px 16px; }
.sim-eval-score-number { font-size: 3rem; font-weight: 600; color: var(--vde-accent); font-family: var(--mono); line-height: 1.0; }
.sim-eval-score-label { font-size: 0.875rem; color: var(--sub); margin-top: 4px; }
.sim-eval-score-meta { font-size: 0.75rem; color: var(--sub); margin-top: 8px; }

/* ── Evaluation Stats Grid ── */
.sim-eval-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 16px 0; }
.sim-eval-stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 12px; text-align: center; }
.sim-eval-stat-value { font-size: 1.3rem; font-weight: 600; color: var(--vde-accent); font-family: var(--mono); line-height: 1.0; }
.sim-eval-stat-label { font-size: 0.75rem; color: var(--sub); margin-top: 4px; }

/* ── Collapsible Sections ── */
.sim-eval-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); margin-bottom: 12px; }
.sim-eval-section-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; cursor: pointer; }
.sim-eval-section-title { font-size: 0.875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--sub); }
.sim-eval-section-badge { font-size: 0.75rem; font-weight: 600; padding: 4px 8px; border-radius: 4px; }
.sim-eval-section-chevron { font-size: 0.75rem; color: var(--muted); transition: transform 0.15s; margin-left: 4px; }
.sim-eval-section.open .sim-eval-section-chevron { transform: rotate(90deg); }
.sim-eval-section-body { padding: 0 16px 12px; display: none; }
.sim-eval-section.open .sim-eval-section-body { display: block; }

/* ── Evaluation Field Table ── */
.sim-eval-field-row { font-size: 0.875rem; padding: 8px 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 50% 10% 20% 20%; align-items: center; }
.sim-eval-field-header { font-size: 0.75rem; font-weight: 600; color: var(--sub); padding: 8px 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 50% 10% 20% 20%; }
.sim-eval-field-wrong { background: rgba(255, 92, 106, 0.05); }

/* ── Maengel Analysis ── */
.sim-eval-mangel-group-title { font-size: 0.75rem; color: var(--muted); margin: 12px 0 4px; }
.sim-eval-mangel-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: 8px 12px; margin-bottom: 8px; }
.sim-eval-mangel-matched { border-left: 3px solid var(--green); }
.sim-eval-mangel-missed { border-left: 3px solid var(--red); }
.sim-eval-mangel-false { border-left: 3px solid var(--yellow); }
.sim-eval-mangel-icon { margin-right: 8px; }
.sim-eval-mangel-label { font-size: 0.875rem; }
.sim-eval-mangel-detail { font-size: 0.75rem; color: var(--sub); margin-top: 2px; }

/* ── Musterloesung Side-by-Side ── */
.sim-eval-solution { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.sim-eval-solution-header { font-size: 0.75rem; font-weight: 600; color: var(--sub); padding: 8px 12px; background: var(--bg); border-bottom: 1px solid var(--border); }
.sim-eval-solution-cell { font-size: 0.875rem; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.sim-eval-solution-group { font-size: 0.75rem; color: var(--muted); padding: 4px 12px; grid-column: 1 / -1; }
.sim-eval-solution-wrong-user { background: rgba(255, 92, 106, 0.08); }
.sim-eval-solution-wrong-correct { background: rgba(61, 220, 151, 0.08); }
.sim-eval-solution-empty { background: rgba(247, 195, 106, 0.08); }

/* ── Suspicious Value Indicator (Lernmodus) ── */
.sim-suspicious-value { border-color: var(--yellow) !important; }
.sim-suspicious-icon { color: var(--yellow); font-size: 0.75rem; margin-left: 4px; }

/* ── Session Card Score Badge ── */
.session-score-badge { font-size: 0.75rem; padding: 4px 8px; border-radius: 4px; font-weight: 600; }
.session-score-green { background: rgba(61, 220, 151, 0.15); color: var(--green); }
.session-score-yellow { background: rgba(247, 195, 106, 0.15); color: var(--yellow); }
.session-score-red { background: rgba(255, 92, 106, 0.15); color: var(--red); }
.session-maengel-bilanz { font-size: 0.75rem; }

/* ── Evaluation CTA Buttons ── */
.sim-eval-actions { display: flex; gap: 12px; margin-top: 24px; justify-content: center; }
