/* ══════════════════════════════════════════════════════
   Kalkulation Module — Styles
   Accent: #22c55e (Green)
   ══════════════════════════════════════════════════════ */

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

.kalk-tabs::-webkit-scrollbar {
  display: none;
}

.kalk-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.75rem 0.5rem;
  font-size: 0.85rem;
  font-family: var(--sans);
  color: var(--sub);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.kalk-tab.active {
  color: #22c55e;
  border-bottom-color: #22c55e;
  font-weight: 600;
}

.kalk-tab.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.kalk-tab:not(.disabled):hover {
  color: #22c55e;
}

/* ── Coming Soon Badge ──────────────────────────────── */
.kalk-badge-soon {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--sub);
  background: var(--surface2);
  padding: 0.1rem 0.4rem;
  border-radius: 99px;
  letter-spacing: 0.02em;
}

/* ── Block Colors (left border accent) ──────────────── */
.kalk-block-lohn {
  border-left: 3px solid #3b82f6;
  padding-left: 0.75rem;
}

.kalk-block-material {
  border-left: 3px solid #f97316;
  padding-left: 0.75rem;
}

.kalk-block-fahrt {
  border-left: 3px solid #6b7280;
  padding-left: 0.75rem;
}

.kalk-block-sonder {
  border-left: 3px solid #8b5cf6;
  padding-left: 0.75rem;
}

.kalk-block-zusammen {
  border-left: 3px solid #22c55e;
  padding-left: 0.75rem;
}

/* ── Progress Bar ───────────────────────────────────── */
.kalk-progress {
  width: 100%;
  height: 3px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
}

.kalk-progress-bar {
  height: 100%;
  background: #22c55e;
  border-radius: 99px;
  transition: width 0.3s ease;
}

/* ── Step Card ──────────────────────────────────────── */
.kalk-step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.kalk-step-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

/* ── Summary Row ────────────────────────────────────── */
.kalk-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.kalk-summary-row:last-child {
  border-bottom: none;
}

/* ── Result Colors ──────────────────────────────────── */
.kalk-correct {
  color: #22c55e;
}

.kalk-wrong {
  color: #ef4444;
}

.kalk-helped {
  color: #f59e0b;
}

/* ── Task Display ──────────────────────────────────── */
.kalk-task-display {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--sub);
}

/* ── Previous Results Card (like LB lb-prev) ────────── */
.kalk-prev {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 0.6rem 1rem;
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 0.75rem;
}

.kalk-prev-key {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--sub);
  display: block;
}

.kalk-prev-val {
  font-family: var(--mono);
  font-weight: 700;
  color: #22c55e;
}

/* ── Input Area ─────────────────────────────────────── */
.kalk-input-area {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.kalk-input-area input {
  flex: 1;
  font-family: var(--mono);
  font-size: 1.1rem;
  padding: 0.75rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  outline: none;
  transition: border-color 0.2s;
}

.kalk-input-area input:focus {
  border-color: #22c55e;
}

.kalk-input-area button {
  padding: 0.75rem 1.25rem;
  background: #22c55e;
  color: #000;
  font-weight: 600;
  border: none;
  border-radius: var(--r2);
  cursor: pointer;
  font-size: 0.95rem;
  transition: opacity 0.2s;
}

.kalk-input-area button:hover {
  opacity: 0.85;
}

/* ── Formula Display ────────────────────────────────── */
.kalk-formula {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  border-radius: var(--r2);
  padding: 0.75rem 1rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--text);
  text-align: center;
}

/* ── Feedback ──────────────────────────────────────── */
.kalk-feedback {
  border-radius: var(--r2);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
}

.kalk-feedback-wrong {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--text);
}

.kalk-feedback-correct {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

/* ── Correct flash animation ──────────────────────── */
.kalk-flash-correct {
  animation: kalk-flash-green 0.4s ease;
}

@keyframes kalk-flash-green {
  0% { border-color: var(--border); }
  30% { border-color: #22c55e; box-shadow: 0 0 8px rgba(34, 197, 94, 0.3); }
  100% { border-color: var(--border); box-shadow: none; }
}

/* ── Wrong input styling ──────────────────────────── */
.kalk-input-wrong {
  border-color: #ef4444 !important;
  color: #ef4444;
}

/* ── Skip Notice ──────────────────────────────────── */
.kalk-skip-notice {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 0.75rem 1rem;
  font-size: 0.82rem;
  color: var(--sub);
}

/* ── Block Header ──────────────────────────────────── */
.kalk-block-header {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sub);
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
}

/* ── Completed Step Summary ────────────────────────── */
.kalk-completed-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.5rem;
  font-size: 0.78rem;
  border-radius: var(--r2);
  background: var(--surface);
}

.kalk-completed-step.correct {
  border-left: 3px solid #22c55e;
}

.kalk-completed-step.wrong {
  border-left: 3px solid #ef4444;
}

.kalk-completed-step.helped {
  border-left: 3px solid #f59e0b;
}

.kalk-completed-label {
  flex: 1;
  color: var(--sub);
}

.kalk-completed-value {
  font-family: var(--mono);
  color: var(--text);
  font-size: 0.78rem;
}

.kalk-completed-icon {
  font-weight: 700;
  font-size: 0.85rem;
  width: 1.2rem;
  text-align: center;
}

/* ── Finish Summary ────────────────────────────────── */
.kalk-finish-header {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #22c55e;
  padding: 0.5rem 0;
}

.kalk-finish-summary {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kalk-score-big {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  padding: 0.25rem 0;
}

/* ── Help Button ───────────────────────────────────── */
.kalk-help-btn {
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  padding: 0;
  background: transparent;
  color: var(--sub);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.kalk-help-btn:hover:not(:disabled) {
  color: #f59e0b;
  border-color: #f59e0b;
}

.kalk-help-btn:disabled,
.kalk-help-used {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Error Mini Button ─────────────────────────────── */
.kalk-error-mini-btn {
  background: none;
  border: none;
  color: var(--sub);
  font-size: 0.7rem;
  cursor: pointer;
  padding: 0.25rem 0;
  opacity: 0.6;
  transition: opacity 0.2s, color 0.2s;
}

.kalk-error-mini-btn:hover {
  opacity: 1;
  color: #ef4444;
}

/* ── History Card ───────────────────────────────────── */
.kalk-history-card {
  padding: 1rem;
  transition: border-color 0.2s;
}

.kalk-history-card:hover {
  border-color: #22c55e;
}

/* ── Detail Step (in finish summary and detail view) ─ */
.kalk-detail-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 0.75rem;
}

.kalk-detail-step.correct {
  border-left: 3px solid #22c55e;
}

.kalk-detail-step.wrong {
  border-left: 3px solid #ef4444;
}

.kalk-detail-step.helped {
  border-left: 3px solid #f59e0b;
}

/* ── Empty State ───────────────────────────────────── */
.kalk-empty-state {
  text-align: center;
  color: var(--sub);
  padding: 2rem;
  font-size: 0.9rem;
}

/* ── Mode Badge ────────────────────────────────────── */
.kalk-mode-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
}

/* ── Date & Duration Display ───────────────────────── */
.kalk-date {
  font-size: 0.85rem;
  color: var(--sub);
}

.kalk-duration {
  font-size: 0.82rem;
  font-family: var(--mono);
  color: var(--sub);
}

/* ── Detail Header ─────────────────────────────────── */
.kalk-detail-header {
  text-align: center;
  padding: 0.5rem 0;
}

/* ── Detail Task Display ───────────────────────────── */
.kalk-detail-task {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 0.75rem;
  font-size: 0.82rem;
  color: var(--sub);
}

/* ── Disabled button states ────────────────────────── */
.kalk-input-area button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ══════════════════════════════════════════════════════
   Rechnungs-Tab — Styles
   Accent: #3b82f6 (Blue)
   ══════════════════════════════════════════════════════ */

/* ── Rechnungs-Tab Accent ─────────────────────────── */
.kalk-tab.active[data-tab="rechnung"] {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

/* ── Split-View ───────────────────────────────────── */
.rech-split {
  display: flex;
  flex-direction: row;
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.rech-steuerung {
  position: relative;
  flex: 1;
  min-width: 30%;
  overflow-y: auto;
  padding: 24px;
}

.rech-divider {
  width: 6px;
  cursor: col-resize;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.15s;
  z-index: 25;
  touch-action: none;
}

.rech-divider:hover,
.rech-divider.dragging {
  background: #3b82f6;
}

.rech-pdf-panel {
  position: relative;
  flex: 1;
  min-width: 30%;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  background: var(--surface);
}

/* ── Mobile: fullscreen toggle ────────────────────── */
@media (max-width: 767px) {
  .rech-split {
    flex-direction: column;
  }

  .rech-divider {
    display: none;
  }

  .rech-steuerung {
    min-width: 100%;
  }

  .rech-pdf-panel {
    min-width: 100%;
    display: none;
  }

  .rech-pdf-panel.rech-panel-active {
    display: flex;
  }

  .rech-steuerung.rech-panel-hidden {
    display: none;
  }
}

.rech-mobile-toggle {
  display: none;
  padding: 8px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
}

@media (max-width: 767px) {
  .rech-mobile-toggle {
    display: inline-flex;
  }
}

/* ── Task Display ─────────────────────────────────── */
.rech-task {
  background: var(--surface2);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 16px;
  border-left: 3px solid #3b82f6;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--sub);
}

/* ── Step Card ────────────────────────────────────── */
.rech-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 8px;
}

/* ── MC Options ───────────────────────────────────── */
.rech-mc-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  margin-bottom: 8px;
  min-height: 44px;
  transition: border-color 0.15s;
  font-size: 0.85rem;
  color: var(--text);
}

.rech-mc-option:hover {
  border-color: #3b82f6;
}

.rech-mc-option.selected {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.08);
}

.rech-mc-option.correct {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
}

.rech-mc-option.wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.rech-mc-option.disabled {
  pointer-events: none;
  opacity: 0.7;
}

/* ── YesNo Buttons ────────────────────────────────── */
.rech-yesno-group {
  display: flex;
  gap: 12px;
}

.rech-yesno-btn {
  flex: 1;
  padding: 12px;
  min-height: 44px;
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--sans);
  cursor: pointer;
  transition: border-color 0.15s;
}

.rech-yesno-btn:hover {
  border-color: #3b82f6;
}

.rech-yesno-btn.selected {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.12);
}

.rech-yesno-btn.correct {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
}

.rech-yesno-btn.wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.rech-yesno-btn.disabled {
  pointer-events: none;
  opacity: 0.7;
}

/* ── Feedback ─────────────────────────────────────── */
.rech-feedback {
  padding: 12px 16px;
  border-radius: var(--r);
  margin-top: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.rech-feedback.correct {
  border-left: 3px solid #22c55e;
  background: rgba(34, 197, 94, 0.06);
}

.rech-feedback.wrong {
  border-left: 3px solid #ef4444;
  background: rgba(239, 68, 68, 0.06);
}

.rech-feedback.helped {
  border-left: 3px solid #f59e0b;
  background: rgba(245, 158, 11, 0.06);
}

.rech-feedback .ustg-ref {
  color: var(--sub);
  font-size: 0.78rem;
  margin-top: 6px;
}

/* ── DnD ──────────────────────────────────────────── */
.rech-dnd-zone {
  min-height: 44px;
  border: 2px dashed var(--border);
  border-radius: var(--r);
  padding: 8px;
  margin-bottom: 8px;
  transition: border-color 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rech-dnd-zone.over {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.06);
}

.rech-dnd-zone.filled {
  border-style: solid;
  border-color: var(--border);
}

.rech-dnd-item {
  display: inline-flex;
  padding: 8px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  cursor: grab;
  touch-action: none;
  user-select: none;
  font-size: 0.85rem;
  margin: 4px;
  color: var(--text);
}

.rech-dnd-item:active {
  cursor: grabbing;
}

.rech-dnd-dragging {
  opacity: 0.6;
}

/* ── Progress (blue accent for rechnung) ──────────── */
.rech-progress-bar {
  background: #3b82f6;
}

.rech-progress-label {
  font-size: 0.78rem;
  color: var(--sub);
  text-align: right;
  margin-bottom: 4px;
}

/* ── Completed Steps (compact rows) ───────────────── */
.rech-completed-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 0.78rem;
  color: var(--sub);
  border-left: 2px solid var(--border);
  margin-bottom: 4px;
}

.rech-completed-step.correct {
  border-left-color: #22c55e;
}

.rech-completed-step.wrong {
  border-left-color: #ef4444;
}

.rech-completed-step.helped {
  border-left-color: #f59e0b;
}

.rech-completed-icon {
  font-weight: 700;
  font-size: 0.85rem;
  width: 1.2rem;
  text-align: center;
}

.rech-completed-label {
  flex: 1;
  color: var(--sub);
}

.rech-completed-value {
  font-family: var(--mono);
  color: var(--text);
  font-size: 0.78rem;
}

/* ── PDF Highlight Overlay ────────────────────────── */
.rech-pdf-highlight {
  position: absolute;
  background: rgba(59, 130, 246, 0.15);
  transition: background 1.5s ease-out;
  pointer-events: none;
  border-radius: 2px;
}

.rech-pdf-highlight.fade {
  background: transparent;
}

/* ── Page Navigation ──────────────────────────────── */
.rech-page-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  font-size: 0.85rem;
  color: var(--sub);
}

.rech-page-nav button {
  padding: 4px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  cursor: pointer;
  min-height: 32px;
  font-family: var(--sans);
}

.rech-page-nav button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Summary ──────────────────────────────────────── */
.rech-summary {
  padding: 24px;
}

.rech-summary-score {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.rech-summary-categories {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  font-size: 0.85rem;
}

.rech-summary-cat {
  padding: 8px 16px;
  background: var(--surface2);
  border-radius: var(--r);
}

.rech-summary-step {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border-left: 2px solid var(--border);
  margin-bottom: 4px;
  font-size: 0.85rem;
}

.rech-summary-step.correct {
  border-left-color: #22c55e;
}

.rech-summary-step.wrong {
  border-left-color: #ef4444;
}

.rech-summary-step.helped {
  border-left-color: #f59e0b;
}

/* ── Numeric Input (reuse kalk pattern with blue accent) */
.rech-input-area {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.rech-input-area input {
  flex: 1;
  font-family: var(--mono);
  font-size: 1.1rem;
  padding: 0.75rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  outline: none;
  transition: border-color 0.2s;
}

.rech-input-area input:focus {
  border-color: #3b82f6;
}

.rech-input-area button {
  padding: 0.75rem 1.25rem;
  background: #3b82f6;
  color: #fff;
  font-weight: 600;
  border: none;
  border-radius: var(--r2);
  cursor: pointer;
  font-size: 0.95rem;
  font-family: var(--sans);
  transition: opacity 0.2s;
}

.rech-input-area button:hover {
  opacity: 0.85;
}

.rech-input-area button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Help Button (blue accent) ────────────────────── */
.rech-help-btn {
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  padding: 0;
  background: transparent;
  color: var(--sub);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.rech-help-btn:hover:not(:disabled) {
  color: #f59e0b;
  border-color: #f59e0b;
}

.rech-help-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Correct flash (blue variant) ─────────────────── */
.rech-flash-correct {
  animation: rech-flash-blue 0.4s ease;
}

@keyframes rech-flash-blue {
  0% { border-color: var(--border); }
  30% { border-color: #3b82f6; box-shadow: 0 0 8px rgba(59, 130, 246, 0.3); }
  100% { border-color: var(--border); box-shadow: none; }
}

/* ── Wrong input styling ──────────────────────────── */
.rech-input-wrong {
  border-color: #ef4444 !important;
  color: #ef4444;
}

/* ── Step Question ────────────────────────────────── */
.rech-step-question {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 12px;
}

.rech-step-nr {
  font-size: 0.72rem;
  font-family: var(--mono);
  color: #3b82f6;
  margin-bottom: 4px;
}

/* ── Select fallback for DnD ──────────────────────── */
.rech-dnd-select {
  width: 100%;
  padding: 0.65rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  font-family: var(--sans);
  font-size: 0.85rem;
  outline: none;
}

.rech-dnd-select:focus {
  border-color: #3b82f6;
}

/* ── PDF Download Button ──────────────────────────── */
.rech-download-btn {
  padding: 0.5rem 1rem;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: var(--r2);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
  transition: opacity 0.2s;
}

.rech-download-btn:hover {
  opacity: 0.85;
}

/* ══════════════════════════════════════════════════════
   Angebots-Tab — Styles
   Accent: #f59e0b (Orange)
   ══════════════════════════════════════════════════════ */

/* ── Angebots-Tab Accent ─────────────────────────── */
.kalk-tab.active[data-tab="angebot"] {
  color: #f59e0b;
  border-bottom-color: #f59e0b;
}

/* ── Split-View ───────────────────────────────────── */
.ang-split {
  display: flex;
  flex-direction: row;
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.ang-steuerung {
  position: relative;
  flex: 1;
  min-width: 30%;
  overflow-y: auto;
  padding: 24px;
}

.ang-divider {
  width: 4px;
  cursor: col-resize;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.15s;
  z-index: 25;
  touch-action: none;
}

.ang-divider:hover,
.ang-divider.dragging {
  background: #f59e0b;
}

.ang-pdf-panel {
  position: relative;
  flex: 1;
  min-width: 30%;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  background: var(--surface);
}

/* ── Mobile: fullscreen toggle ────────────────────── */
@media (max-width: 767px) {
  .ang-split {
    flex-direction: column;
  }

  .ang-divider {
    display: none;
  }

  .ang-steuerung {
    min-width: 100%;
  }

  .ang-pdf-panel {
    min-width: 100%;
    display: none;
  }

  .ang-pdf-panel.ang-panel-active {
    display: flex;
  }

  .ang-steuerung.ang-panel-hidden {
    display: none;
  }
}

.ang-mobile-toggle {
  display: none;
  padding: 8px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
}

@media (max-width: 767px) {
  .ang-mobile-toggle {
    display: inline-flex;
  }
}

/* ── Task Display ─────────────────────────────────── */
.ang-task {
  background: var(--surface2);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 16px;
  border-left: 3px solid #f59e0b;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--sub);
}

/* ── Step Card ────────────────────────────────────── */
.ang-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 8px;
}

.ang-step-nr {
  font-size: 0.72rem;
  font-family: var(--mono);
  color: #f59e0b;
  margin-bottom: 4px;
}

.ang-step-question {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 12px;
}

/* ── MC Options ───────────────────────────────────── */
.ang-mc-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  margin-bottom: 8px;
  min-height: 44px;
  transition: border-color 0.15s;
  font-size: 0.85rem;
  color: var(--text);
}

.ang-mc-option:hover {
  border-color: #f59e0b;
}

.ang-mc-option.selected {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.08);
}

.ang-mc-option.correct {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
}

.ang-mc-option.wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.ang-mc-option.disabled {
  pointer-events: none;
  opacity: 0.7;
}

/* ── YesNo Buttons ────────────────────────────────── */
.ang-yesno-group {
  display: flex;
  gap: 12px;
}

.ang-yesno-btn {
  flex: 1;
  padding: 12px;
  min-height: 44px;
  background: var(--surface2);
  border: 2px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--sans);
  cursor: pointer;
  transition: border-color 0.15s;
}

.ang-yesno-btn:hover {
  border-color: #f59e0b;
}

.ang-yesno-btn.selected {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.12);
}

.ang-yesno-btn.correct {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
}

.ang-yesno-btn.wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.ang-yesno-btn.disabled {
  pointer-events: none;
  opacity: 0.7;
}

/* ── Feedback ─────────────────────────────────────── */
.ang-feedback {
  padding: 12px 16px;
  border-radius: var(--r);
  margin-top: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.ang-feedback.correct {
  border-left: 3px solid #22c55e;
  background: rgba(34, 197, 94, 0.06);
}

.ang-feedback.wrong {
  border-left: 3px solid #ef4444;
  background: rgba(239, 68, 68, 0.06);
}

.ang-feedback.helped {
  border-left: 3px solid #f59e0b;
  background: rgba(245, 158, 11, 0.06);
}

.ang-feedback .bgb-ref {
  color: var(--sub);
  font-size: 0.78rem;
  margin-top: 6px;
}

/* ── Progress (orange accent for angebot) ─────────── */
.ang-progress-bar {
  background: #f59e0b;
}

.ang-progress-label {
  font-size: 0.78rem;
  color: var(--sub);
  text-align: right;
  margin-bottom: 4px;
}

/* ── Completed Steps (compact rows) ───────────────── */
.ang-completed-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 0.78rem;
  color: var(--sub);
  border-left: 2px solid var(--border);
  margin-bottom: 4px;
}

.ang-completed-step.correct {
  border-left-color: #22c55e;
}

.ang-completed-step.wrong {
  border-left-color: #ef4444;
}

.ang-completed-step.helped {
  border-left-color: #f59e0b;
}

.ang-completed-icon {
  font-weight: 700;
  font-size: 0.85rem;
  width: 1.2rem;
  text-align: center;
}

.ang-completed-label {
  flex: 1;
  color: var(--sub);
}

.ang-completed-value {
  font-family: var(--mono);
  color: var(--text);
  font-size: 0.78rem;
}

/* ── Page Navigation ──────────────────────────────── */
.ang-page-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  font-size: 0.85rem;
  color: var(--sub);
}

.ang-page-nav button {
  padding: 4px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  cursor: pointer;
  min-height: 32px;
  font-family: var(--sans);
}

.ang-page-nav button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Summary ──────────────────────────────────────── */
.ang-summary {
  padding: 24px;
}

.ang-summary-score {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.ang-summary-categories {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  font-size: 0.85rem;
}

.ang-summary-cat {
  padding: 8px 16px;
  background: var(--surface2);
  border-radius: var(--r);
}

.ang-summary-step {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border-left: 2px solid var(--border);
  margin-bottom: 4px;
  font-size: 0.85rem;
}

.ang-summary-step.correct {
  border-left-color: #22c55e;
}

.ang-summary-step.wrong {
  border-left-color: #ef4444;
}

.ang-summary-step.helped {
  border-left-color: #f59e0b;
}

/* ── Download Button ──────────────────────────────── */
.ang-download-btn {
  padding: 0.5rem 1rem;
  background: #f59e0b;
  color: #000;
  border: none;
  border-radius: var(--r2);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
  transition: opacity 0.2s;
}

.ang-download-btn:hover {
  opacity: 0.85;
}

/* ── Help Button (orange accent) ──────────────────── */
.ang-help-btn {
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  padding: 0;
  background: transparent;
  color: var(--sub);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.ang-help-btn:hover:not(:disabled) {
  color: #f59e0b;
  border-color: #f59e0b;
}

.ang-help-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Correct flash (orange variant) ───────────────── */
.ang-flash-correct {
  animation: ang-flash-orange 0.4s ease;
}

@keyframes ang-flash-orange {
  0% { background: rgba(245, 158, 11, 0.15); }
  100% { background: transparent; }
}

/* ── DnD Styles ───────────────────────────────────── */
.ang-dnd-zones {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.ang-dnd-zone {
  flex: 1;
  min-width: 120px;
  min-height: 80px;
  border: 2px dashed var(--border);
  border-radius: var(--r);
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.ang-dnd-zone-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--sub);
  margin-bottom: 4px;
}

.ang-dnd-zone.over {
  border-color: #f59e0b;
  background: rgba(245, 158, 11, 0.06);
}

.ang-dnd-zone.correct {
  border-color: #22c55e;
  border-style: solid;
}

.ang-dnd-zone.wrong {
  border-color: #ef4444;
  border-style: solid;
}

.ang-dnd-item {
  display: inline-block;
  padding: 8px 12px;
  margin: 4px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  cursor: grab;
  touch-action: none;
  user-select: none;
  font-size: 0.85rem;
  color: var(--text);
}

.ang-dnd-item:hover {
  border-color: #f59e0b;
}

.ang-dnd-ghost {
  position: fixed;
  pointer-events: none;
  opacity: 0.85;
  z-index: 1000;
  padding: 8px 12px;
  background: var(--surface2);
  border: 1px solid #f59e0b;
  border-radius: var(--r2);
  font-size: 0.85rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  color: var(--text);
}

.ang-dnd-items {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.ang-dnd-check-btn {
  margin-top: 16px;
  padding: 10px 24px;
  background: #f59e0b;
  color: #000;
  border: none;
  border-radius: var(--r);
  cursor: pointer;
  font-weight: 600;
  font-family: var(--sans);
}

.ang-dnd-check-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── VOB/B Badge ──────────────────────────────────── */
.ang-vob-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  font-family: var(--sans);
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.15);
  border-radius: var(--r2);
  margin-left: 8px;
  white-space: nowrap;
}

/* ── PDF Highlight Overlay ────────────────────────── */
.ang-pdf-highlight {
  position: absolute;
  background: rgba(245, 158, 11, 0.15);
  transition: background 1.5s ease-out;
  pointer-events: none;
  border-radius: 2px;
}

.ang-pdf-highlight.fade {
  background: transparent;
}

/* ── Mobile DnD ───────────────────────────────────── */
@media (max-width: 767px) {
  .ang-dnd-zones {
    flex-direction: column;
  }
}

/* ── Input Area (orange accent) ───────────────────── */
.ang-input-area {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.ang-input-area input {
  flex: 1;
  font-family: var(--mono);
  font-size: 1.1rem;
  padding: 0.75rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  outline: none;
  transition: border-color 0.2s;
}

.ang-input-area input:focus {
  border-color: #f59e0b;
}

.ang-input-area button {
  padding: 0.75rem 1.25rem;
  background: #f59e0b;
  color: #000;
  font-weight: 600;
  border: none;
  border-radius: var(--r2);
  cursor: pointer;
  font-size: 0.95rem;
  font-family: var(--sans);
  transition: opacity 0.2s;
}

.ang-input-area button:hover {
  opacity: 0.85;
}

.ang-input-area button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ==============================================================================
   LV-TAB -- Leistungsverzeichnis (Purple Accent #a855f7)
   Phase 09
   ============================================================================== */

/* ── Tab Accent ──────────────────────────────────── */
.kalk-tab.active[data-tab="lv"] {
  border-bottom-color: #a855f7;
  color: #a855f7;
}

/* ── Split-View ──────────────────────────────────── */
.lv-split {
  display: flex;
  flex-direction: row;
  width: 100%;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.lv-steuerung {
  position: relative;
  flex: 1;
  min-width: 30%;
  overflow-y: auto;
  padding: 24px;
}

.lv-divider {
  width: 4px;
  cursor: col-resize;
  background: var(--border);
  flex-shrink: 0;
  transition: background 0.15s;
  z-index: 25;
  touch-action: none;
}

.lv-divider:hover,
.lv-divider.dragging {
  background: #a855f7;
}

.lv-pdf-panel {
  position: relative;
  flex: 1;
  min-width: 30%;
  overflow: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  background: var(--surface);
}

/* ── Mobile: fullscreen toggle ───────────────────── */
@media (max-width: 767px) {
  .lv-split {
    flex-direction: column;
  }

  .lv-divider {
    display: none;
  }

  .lv-steuerung {
    min-width: 100%;
  }

  .lv-pdf-panel {
    min-width: 100%;
    display: none;
  }

  .lv-pdf-panel.lv-panel-active {
    display: flex;
  }

  .lv-steuerung.lv-panel-hidden {
    display: none;
  }
}

.lv-mobile-toggle {
  display: none;
  padding: 8px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
}

@media (max-width: 767px) {
  .lv-mobile-toggle {
    display: inline-flex;
  }
}

/* ── Task Display ────────────────────────────────── */
.lv-task {
  background: var(--surface2);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 16px;
  border-left: 3px solid #a855f7;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--sub);
}

/* ── Step Card ───────────────────────────────────── */
.lv-step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  margin-bottom: 8px;
}

.lv-step-nr {
  font-size: 0.72rem;
  font-family: var(--mono);
  color: #a855f7;
  margin-bottom: 4px;
}

.lv-step-question {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 12px;
}

/* ── MC Options ──────────────────────────────────── */
.lv-mc-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  margin-bottom: 8px;
  min-height: 44px;
  transition: border-color 0.15s;
  font-size: 0.85rem;
  color: var(--text);
}

.lv-mc-option:hover {
  border-color: #a855f7;
}

.lv-mc-option.selected {
  border-color: #a855f7;
  background: rgba(168, 85, 247, 0.08);
}

.lv-mc-option.correct {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.08);
}

.lv-mc-option.wrong {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.lv-mc-option.disabled {
  pointer-events: none;
  opacity: 0.7;
}

/* ── Feedback ────────────────────────────────────── */
.lv-feedback {
  padding: 12px 16px;
  border-radius: var(--r);
  margin-top: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.lv-feedback.correct {
  border-left: 3px solid #22c55e;
  background: rgba(34, 197, 94, 0.06);
}

.lv-feedback.wrong {
  border-left: 3px solid #ef4444;
  background: rgba(239, 68, 68, 0.06);
}

.lv-feedback.helped {
  border-left: 3px solid #f59e0b;
  background: rgba(245, 158, 11, 0.06);
}

.lv-feedback .bgb-ref {
  color: var(--sub);
  font-size: 0.78rem;
  margin-top: 6px;
}

/* ── Progress (purple accent for LV) ─────────────── */
.lv-progress-bar {
  background: #a855f7;
}

.lv-progress-label {
  font-size: 0.78rem;
  color: var(--sub);
  text-align: right;
  margin-bottom: 4px;
}

/* ── Completed Steps (compact rows) ──────────────── */
.lv-completed-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 0.78rem;
  color: var(--sub);
  border-left: 2px solid var(--border);
  margin-bottom: 4px;
}

.lv-completed-step.correct {
  border-left-color: #22c55e;
}

.lv-completed-step.wrong {
  border-left-color: #ef4444;
}

.lv-completed-step.helped {
  border-left-color: #f59e0b;
}

.lv-completed-icon {
  font-weight: 700;
  font-size: 0.85rem;
  width: 1.2rem;
  text-align: center;
}

.lv-completed-label {
  flex: 1;
  color: var(--sub);
}

.lv-completed-value {
  font-family: var(--mono);
  color: var(--text);
  font-size: 0.78rem;
}

/* ── Page Navigation ─────────────────────────────── */
.lv-page-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px;
  font-size: 0.85rem;
  color: var(--sub);
}

.lv-page-nav button {
  padding: 4px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  color: var(--text);
  cursor: pointer;
  min-height: 32px;
  font-family: var(--sans);
}

.lv-page-nav button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Summary ─────────────────────────────────────── */
.lv-summary {
  padding: 24px;
}

.lv-summary-score {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.lv-summary-categories {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  font-size: 0.85rem;
}

.lv-summary-cat {
  padding: 8px 16px;
  background: var(--surface2);
  border-radius: var(--r);
}

.lv-summary-step {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 12px;
  border-left: 2px solid var(--border);
  margin-bottom: 4px;
  font-size: 0.85rem;
}

.lv-summary-step.correct {
  border-left-color: #22c55e;
}

.lv-summary-step.wrong {
  border-left-color: #ef4444;
}

.lv-summary-step.helped {
  border-left-color: #f59e0b;
}

/* ── Download Button ─────────────────────────────── */
.lv-download-btn {
  padding: 0.5rem 1rem;
  background: #a855f7;
  color: #fff;
  border: none;
  border-radius: var(--r2);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--sans);
  cursor: pointer;
  transition: opacity 0.2s;
}

.lv-download-btn:hover {
  opacity: 0.85;
}

/* ── Help Button (purple accent) ─────────────────── */
.lv-help-btn {
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  padding: 0;
  background: transparent;
  color: var(--sub);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.lv-help-btn:hover:not(:disabled) {
  color: #a855f7;
  border-color: #a855f7;
}

.lv-help-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Correct flash (purple variant) ──────────────── */
.lv-flash-correct {
  animation: lv-flash-purple 0.4s ease;
}

@keyframes lv-flash-purple {
  0% { background: rgba(168, 85, 247, 0.15); }
  100% { background: transparent; }
}

/* ── Input Area (purple accent) ──────────────────── */
.lv-input-area {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.lv-input-area input {
  flex: 1;
  font-family: var(--mono);
  font-size: 1.1rem;
  padding: 0.75rem;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  outline: none;
  transition: border-color 0.2s;
}

.lv-input-area input:focus {
  border-color: #a855f7;
}

.lv-input-area button {
  padding: 0.75rem 1.25rem;
  background: #a855f7;
  color: #fff;
  font-weight: 600;
  border: none;
  border-radius: var(--r2);
  cursor: pointer;
  font-size: 0.95rem;
  font-family: var(--sans);
  transition: opacity 0.2s;
}

.lv-input-area button:hover {
  opacity: 0.85;
}

.lv-input-area button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── DnD (for Deckblatt) ─────────────────────────── */
.lv-dnd-item {
  display: inline-flex;
  padding: 8px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  cursor: grab;
  touch-action: none;
  user-select: none;
  font-size: 0.85rem;
  margin: 4px;
  color: var(--text);
}

.lv-dnd-item:active {
  cursor: grabbing;
}

/* ── PDF Highlight Overlay ───────────────────────── */
.lv-pdf-highlight {
  position: absolute;
  background: rgba(168, 85, 247, 0.15);
  transition: background 1.5s ease-out;
  pointer-events: none;
  border-radius: 2px;
}

.lv-pdf-highlight.fade {
  background: transparent;
}

/* ── Kalkulationsdaten Bar (sticky reference data) ── */
.lv-kalkdaten {
  position: sticky;
  top: 0;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
  padding: 8px 12px;
  font-size: 0.78rem;
  font-family: var(--mono);
  font-weight: 700;
  color: var(--sub);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  z-index: 10;
  margin-bottom: 12px;
}
