.overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(6,13,22,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  padding: var(--overlay-pad);
  padding-left: max(var(--overlay-pad), var(--safe-left));
  padding-right: max(var(--overlay-pad), var(--safe-right));
  padding-top: max(var(--overlay-pad), var(--safe-top));
  overflow: auto;
  overscroll-behavior: contain;
  contain: strict;
  transition: opacity .25s ease, backdrop-filter .25s ease;
}

.modal {
  /* .98 (was .92): keeps the frosted feel while lifting muted sublabel text
     (gray-500) clear of WCAG AA on the modal surface in the dark theme. */
  background: rgba(255,255,255,.98);
  backdrop-filter: blur(var(--glass-blur-lg));
  -webkit-backdrop-filter: blur(var(--glass-blur-lg));
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl), 0 0 0 1px rgba(var(--ink-rgb),.15), 0 0 80px rgba(14,165,233,.04);
  overflow: hidden;
  width: min(100%, var(--modal-max-width, 100%));
  max-height: min(var(--modal-max-height, calc(100dvh - (2 * var(--overlay-pad)))), calc(100dvh - (2 * var(--overlay-pad))));
  display: flex;
  flex-direction: column;
  animation: modalIn .25s cubic-bezier(.34,1.3,.64,1);
  will-change: transform, opacity;
  contain: layout style paint;
  min-width: 0;
}

.modal, .modal > * {
  min-width: 0;
}

/* Premium glass sheen — a soft diagonal highlight across the top of the
   modal, like light catching a glass pane. Sits at z-index 0 behind the
   header/body (which get their own stacking context below) so it can
   never wash out actual content; pointer-events: none either way. */
.modal {
  position: relative;
}

.modal::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,.10) 0%, rgba(255,255,255,.03) 22%, transparent 45%);
  pointer-events: none;
  z-index: 0;
}

.modal-hd, .modal-bd {
  position: relative;
  z-index: 1;
}

.modal-profile { --modal-max-width: 760px; }
.modal-editor { --modal-max-width: 560px; }
.modal-import { --modal-max-width: 560px; }
.modal-dept { --modal-max-width: min(1120px, 96vw); }
.modal-autoplan { --modal-max-width: 1220px; }
.modal-report { --modal-max-width: min(1040px, 96vw); }
.modal-emps { --modal-max-width: min(1320px, 98vw); }
.modal-score { --modal-max-width: 720px; }
.modal-yearplan { --modal-max-width: min(1440px, 98vw); }

.modal-fit-content { height: auto !important; }
.modal-fit-viewport { height: min(var(--modal-max-height, calc(100dvh - (2 * var(--overlay-pad)))), calc(100dvh - (2 * var(--overlay-pad)))) !important; }

.modal.modal-closing {
  animation: modalOut .2s ease forwards;
}

.overlay#modal-autoplan .modal {
  width: 1220px;
  height: 920px;
  max-width: 96vw;
  max-height: 96vh;
  display: flex;
  flex-direction: column;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(15px); }
  to { opacity: 1; transform: none; }
}

@keyframes modalOut {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: scale(.97) translateY(10px); }
}

.modal-hd {
  background: rgba(var(--navy-800-rgb),.85);
  backdrop-filter: blur(var(--glass-blur));
  color: var(--ink-strong);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(var(--ink-rgb),.05);
}

.modal-hd-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.modal-hd-sub {
  font-size: 11px;
  color: rgba(var(--ink-rgb),.35);
  margin-top: 2px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.modal-x {
  background: none;
  border: none;
  color: rgba(var(--ink-rgb),.35);
  font-size: 16px;
  padding: 8px;
  border-radius: var(--radius-xs);
  line-height: 1;
  transition: all .2s cubic-bezier(.34,1.2,.64,1);
  flex-shrink: 0;
  margin-top: -2px;
  margin-right: -4px;
}

.modal-x:hover {
  color: var(--ink-strong);
  background: rgba(var(--ink-rgb),.08);
  transform: scale(1.1);
}

.modal-x:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.modal-x:active {
  transform: scale(0.9);
}

.modal-bd {
  padding: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.modal-bd.ap-progress-bd {
  overflow: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.modal-bd > * {
  max-width: 100%;
}

.modal-bd :where(img, svg, canvas, iframe, table, pre, textarea, input, select) {
  max-width: 100%;
}

.modal-ft {
  padding: 12px 20px;
  border-top: 1px solid rgba(226,232,240,.4);
  background: rgba(248,250,252,.6);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

.preview-box {
  background: rgba(var(--navy-800-rgb),.75);
  backdrop-filter: blur(var(--glass-blur));
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border: 1px solid rgba(var(--ink-rgb),.06);
  box-shadow: 0 2px 12px rgba(0,0,0,.1);
  flex-shrink: 0;
  transition: transform 0.2s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.preview-box:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}

.preview-box-lbl {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(var(--ink-rgb),.35);
  margin-bottom: 4px;
}

.preview-box-val {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink-strong);
  min-width: 48px;
  line-height: 1;
}

.preview-box-duties {
  display: flex;
  gap: 5px;
}

.preview-duty-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  line-height: 1.4;
}

.sect-hd {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin: 18px 0 9px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.sect-hd:first-of-type {
  margin-top: 0;
}

.sect-hd::before {
  content: '';
  flex: none;
  width: 3px;
  height: 12px;
  background: var(--accent);
  border-radius: 2px;
}

.sect-hint {
  font-size: 8.5px;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--gray-500);
}

.ed-step {
  background: rgba(var(--navy-800-rgb),.4);
  border: 1px solid rgba(var(--ink-rgb),.06);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
  margin-bottom: 12px;
  flex-shrink: 0;
}

.ed-step:last-child {
  margin-bottom: 0;
}

.ed-step .sect-hd:first-of-type {
  margin-top: 0;
}

.ed-step-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.ed-step-num {
  flex: none;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent);
  color: #042231;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.ed-step-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ink-strong);
}

.ed-step-hd .sect-hint {
  margin-left: 2px;
}

.day-type-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
  line-height: 1.4;
  flex-shrink: 0;
}

.dtl-we {
  background: var(--gray-100);
  color: var(--gray-500);
  border: 1px solid var(--gray-200);
}

.dtl-hol {
  background: #FEF3C7;
  color: #78350F;
  border: 1px solid #FDE68A;
}

.duty-warn {
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--red-lt);
  color: #DC2626;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  line-height: 1.5;
  border: 1px solid #FCA5A5;
  flex-shrink: 0;
}

#modal-editor.plan-mode-editor .modal-hd,
#ed-modal-hd.plan-mode-hd {
  background: linear-gradient(180deg, #3B1000 0%, #78350F 100%);
  border-bottom-color: rgba(251,191,36,.15);
}

.ed-plan-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(251,191,36,.18);
  border: 1px solid rgba(251,191,36,.35);
  color: #FCD34D;
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
  vertical-align: middle;
}

#modal-editor.plan-mode-editor .preview-box {
  background: linear-gradient(135deg, #3B1000 0%, #6B2100 100%);
  border-color: rgba(251,191,36,.12);
}

/* --- AUTO-PLAN CONFIGURATION REFINEMENT --- */

.ap-config-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  gap: 0;
}

.ap-config-header {
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}

.ap-config-summary {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ap-summary-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.ap-summary-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-500);
}

.ap-summary-value {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 800;
  color: var(--accent-lt);
  line-height: 1;
}

.ap-weight-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
  background: rgba(255, 255, 255, 0.4);
}

.ap-weight-row-lbl {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gray-500);
  flex-shrink: 0;
}

.ap-weight-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ap-weight-chip {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.7);
  color: var(--gray-600);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.ap-weight-chip:hover {
  border-color: var(--accent-lt);
  color: var(--gray-800);
}

.ap-weight-chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #042231;
}

.ap-config-list {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  background: radial-gradient(circle at top left, rgba(14, 165, 233, 0.03), transparent 40%);
}

.ap-emp-card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  position: relative;
}

.ap-emp-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-lt);
  background: rgba(255, 255, 255, 0.9);
}

.ap-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ap-card-name-group {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ap-card-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ap-card-pos {
  font-size: 9px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
}

.ap-card-stats {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.ap-card-stat {
  display: flex;
  align-items: baseline;
  gap: 3px;
  font-size: 11px;
  color: var(--gray-500);
}

.ap-stat-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--gray-700);
}

.ap-stat-label {
  font-size: 8px;
  text-transform: uppercase;
  opacity: 0.7;
}

.ap-card-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ap-card-input-lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--gray-600);
}

.ap-input-stepper {
  display: flex;
  align-items: center;
  background: var(--gray-100);
  border-radius: var(--radius-xs);
  padding: 2px;
  border: 1px solid var(--gray-200);
}

.ap-step-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  color: var(--gray-600);
  font-size: 14px;
  font-weight: 700;
}

.ap-step-btn:hover {
  background: rgba(0,0,0,0.05);
  color: var(--accent);
}

.ap-card-input {
  width: 32px;
  background: transparent;
  border: none;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  color: var(--navy-900);
  outline: none;
  appearance: textfield;
  -moz-appearance: textfield;
  -webkit-appearance: none;
}

.ap-card-input::-webkit-inner-spin-button,
.ap-card-input::-webkit-outer-spin-button {
  appearance: none;
  -webkit-appearance: none;
  margin: 0;
}

.ap-config-footer {
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-shrink: 0;
}

.ap-compute-btn {
  background: linear-gradient(135deg, #F59E0B, #D97706);
  color: #451a03;
  font-weight: 800;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  border: none;
  box-shadow: 0 4px 12px rgba(217, 119, 6, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  transition: all 0.2s cubic-bezier(0.34, 1.25, 0.64, 1);
}

.ap-compute-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 20px rgba(217, 119, 6, 0.4);
}

.ap-compute-btn:active {
  transform: translateY(0) scale(0.98);
}

.ap-compute-icon {
  animation: apIconPulse 2s infinite ease-in-out;
}

@keyframes apIconPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.8; }
}

/* --- REDUNDANT CLASSES REMOVED --- */

.ap-sect-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-xs);
  line-height: 1.4;
  letter-spacing: .02em;
}

.ap-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-200);
  flex-shrink: 0;
}

.ap-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 440px;
}

.ap-table thead tr {
  background: var(--gray-100);
}

.ap-th, .ap-th-name, .ap-th-days {
  padding: 6px 10px;
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-500);
  text-align: center;
  white-space: nowrap;
  border-bottom: 2px solid var(--gray-200);
}

.ap-th-name {
  text-align: left;
  padding-left: 12px;
  min-width: 140px;
}

.ap-th-days {
  text-align: left;
  min-width: 180px;
}

.ap-table tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: background .15s;
}

.ap-table tbody tr:hover {
  background: var(--gray-50);
}

.ap-td-name {
  padding: 7px 10px 7px 12px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-800);
}

.ap-pos {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  letter-spacing: .02em;
  line-height: 1.5;
}

.ap-td {
  padding: 7px 10px;
  text-align: center;
  vertical-align: middle;
}

.ap-td-num {
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.ap-td-days {
  padding: 7px 10px;
  vertical-align: middle;
}

.ap-day-tag {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 10px;
  background: var(--gray-100);
  color: var(--gray-600);
  border: 1px solid var(--gray-200);
  margin: 1px 2px;
  white-space: nowrap;
}

.ap-day-tag.ap-day-we {
  background: #FEF3C7;
  color: #78350F;
  border-color: #FDE68A;
}

.ap-day-tag.ap-day-hol {
  background: #FDE68A;
  color: #451A03;
  border-color: #F59E0B;
  font-weight: 700;
}

.ap-warnings {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.ap-warn-item {
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  background: #FEF3C7;
  color: #92400E;
  font-size: 11px;
  line-height: 1.45;
  border-left: 3px solid #F59E0B;
}

.ap-warn-item-critical {
  background: linear-gradient(135deg, #7C2D12, #991B1B);
  color: #FFF7ED;
  border-left-color: #FB923C;
  box-shadow: 0 0 0 1px rgba(251,146,60,.22), 0 12px 26px rgba(124,45,18,.2);
  font-weight: 700;
}

.ap-infos {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  flex-shrink: 0;
}

.ap-info-item {
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  background: #E0F2FE;
  color: #075985;
  font-size: 11px;
  line-height: 1.4;
  border-left: 3px solid #0EA5E9;
}

.ap-config-intro {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: #92400E;
  line-height: 1.5;
  flex-shrink: 0;
}

.ap-exempt-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.4;
  flex-shrink: 0;
}

.ap-exempt-note strong {
  color: var(--gray-700);
}

.ap-target-input {
  width: 60px;
  padding: 6px 8px;
  text-align: center;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--gray-800);
  background: var(--white);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.ap-target-input:focus {
  border-color: #F59E0B;
  box-shadow: 0 0 0 3px rgba(245,158,11,.15);
}

.ap-target-input::-webkit-inner-spin-button {
  opacity: 1;
}

.ap-total-row {
  background: var(--gray-100);
  border-top: 2px solid var(--gray-300);
}

.ap-info-row td {
  border-top: 1px solid var(--gray-150);
}

.ap-config-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
  flex-shrink: 0;
}

.ap-engine {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-height: 0;
  height: 100%;
}

.ap-engine-immersive {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 2px;
  contain: layout paint style;
}

.ap-engine-compact {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  min-height: 0;
}

.ap-engine-main {
  display: flex;
  flex-direction: row;
  gap: 12px;
  min-height: 0;
  flex: 1;
}

.ap-neural-view {
  flex: 1;
  aspect-ratio: 5 / 4;
  min-width: 0;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  background: radial-gradient(circle at center, #0B192C 0%, #040A15 100%);
  border: 1px solid rgba(14,165,233,.15);
  box-shadow: inset 0 0 50px rgba(0,0,0,0.8), 0 10px 30px rgba(0,0,0,0.3);
}

.ap-terminal-deep {
  flex: 0 0 350px !important;
}

.ap-hero-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border-radius: calc(var(--radius) + 4px);
  background:
    radial-gradient(circle at top right, rgba(56,189,248,.18), transparent 35%),
    radial-gradient(circle at left center, rgba(251,191,36,.14), transparent 30%),
    linear-gradient(160deg, rgba(4,10,24,.96) 0%, rgba(10,21,37,.92) 45%, rgba(9,18,34,.96) 100%);
  border: 1px solid rgba(56,189,248,.14);
  box-shadow: inset 0 1px 0 rgba(var(--ink-rgb),.05), 0 20px 44px rgba(2,8,23,.42);
  transform: translateZ(0);
  backface-visibility: hidden;
  will-change: transform, opacity;
  flex-shrink: 0;
  height: auto;
}

.ap-hero-shell-compact {
  gap: 12px;
  padding: 14px;
  min-height: 0;
}

.ap-hero-shell::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 20%, rgba(var(--ink-rgb),.05) 35%, transparent 50%);
  background-size: 200% 100%;
  animation: apShellSweep 5s linear infinite;
  pointer-events: none;
  mix-blend-mode: screen;
}

@keyframes apShellSweep {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.ap-hud-spectacle {
  position: relative;
  width: 180px; 
  height: 85px; 
  flex-shrink: 0; 
  border-radius: 12px;
  overflow: hidden;
  background: #040A15;
  border: 1px solid rgba(56,189,248,.2);
  box-shadow: inset 0 0 20px rgba(14,165,233,.1), 0 0 30px rgba(14,165,233,.1);
}

.ap-hud-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.ap-hero-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ap-hud-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ap-hud-kicker {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(125,211,252,.72);
}

.ap-hud-title {
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: -.03em;
  color: #F8FAFC;
}

.ap-live-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: linear-gradient(180deg, rgba(7,14,27,.92), rgba(5,10,22,.86));
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-radius: var(--radius);
  padding: 8px 14px;
  border: 1px solid rgba(56,189,248,.12);
  box-shadow: 0 12px 30px rgba(2,8,23,.24), inset 0 1px 0 rgba(var(--ink-rgb),.03);
  transform: translateZ(0);
}

.ap-ls-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex: 1;
  padding: 0 12px;
  text-shadow: 0 0 15px rgba(0,0,0,0.5);
}

.ap-ls-val {
  font-family: var(--font-mono);
  font-size: clamp(17px, 2.1vw, 22px);
  font-weight: 800;
  line-height: 1;
  transition: all .3s;
  text-shadow: 0 0 18px currentColor;
}

.ap-ls-lbl {
  font-size: 7px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(226,232,240,.5);
}

.ap-ls-sep {
  width: 1px;
  height: 28px;
  background: rgba(var(--ink-rgb),.08);
  flex-shrink: 0;
}

.ap-bar-wrap {
  position: relative;
}

.ap-bar-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(var(--gray-900-rgb),.82);
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(56,189,248,.1);
}

.ap-bar-fill {
  height: 100%;
  border-radius: 3px;
  width: 0%;
  background: linear-gradient(90deg, #F59E0B 0%, #FBBF24 50%, #F59E0B 100%);
  background-size: 200% 100%;
  animation: apBarShimmer 2s linear infinite;
  transition: width .35s cubic-bezier(.34,1.2,.64,1);
  transform: translateZ(0);
  will-change: width, transform;
}

.ap-bar-glow {
  position: absolute;
  top: -3px;
  left: 0;
  height: 14px;
  width: 0%;
  background: linear-gradient(90deg, transparent 70%, rgba(245,158,11,.52));
  filter: blur(5px);
  border-radius: 999px;
  pointer-events: none;
  transition: width .35s cubic-bezier(.34,1.2,.64,1);
  transform: translateZ(0);
  will-change: width, opacity;
}

.ap-bar-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.ap-bar-phase {
  font-size: 10px;
  font-weight: 600;
  color: var(--gray-500);
  transition: color .2s;
}

.ap-bar-pct {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  color: #D97706;
}

.ap-terminal {
  position: relative;
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  border: 1px solid rgba(56,189,248,.12);
  box-shadow: 0 10px 30px rgba(0,0,0,.2), inset 0 1px 0 rgba(var(--ink-rgb),.03);
  transform: translateZ(0);
  contain: layout paint;
  will-change: transform;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.ap-terminal-deep::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(56,189,248,.03), transparent 20%, transparent 80%, rgba(14,165,233,.04));
  pointer-events: none;
}

.ap-term-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: rgba(26,26,46,.7);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(var(--ink-rgb),.04);
  flex-shrink: 0;
}

.ap-term-title {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 500;
  color: rgba(var(--ink-rgb),.25);
  letter-spacing: .03em;
}

.ap-term-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-anchor: none;
  background: rgba(10,10,20,.8);
  backdrop-filter: blur(8px);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.6;
  color: #67E8F9;
}

.ap-term-body::-webkit-scrollbar {
  width: 4px;
  background: transparent;
}

.ap-term-body::-webkit-scrollbar-thumb {
  background: rgba(103,232,249,.15);
  border-radius: 10px;
}

.ap-log-entry {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 2px 0;
  animation: apLogIn .25s cubic-bezier(.34,1.2,.64,1);
  border-bottom: 1px solid rgba(103,232,249,.04);
  will-change: auto;
}

@keyframes apLogIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: none; }
}

.ap-log-entry.ap-log-warn { color: #FCD34D; }
.ap-log-entry.ap-log-critical {
  color: #FDBA74;
  text-shadow: 0 0 16px rgba(251,146,60,.22);
}
.ap-log-entry.ap-log-assign { color: rgba(103,232,249,.6); }

.ap-log-icon {
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

.ap-log-msg {
  flex: 1;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ap-result-hero {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 14px;
  margin-bottom: 18px;
  flex-shrink: 0;
}

.ap-result-score {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px;
  border-radius: 16px;
  background: linear-gradient(160deg, #082032 0%, #0F3A57 52%, #0A1423 100%);
  color: #F8FAFC;
  box-shadow: 0 18px 34px rgba(2,8,23,.2);
}

.ap-result-score.is-clickable {
  cursor: pointer;
  transition: transform .2s cubic-bezier(.34,1.2,.64,1), box-shadow .2s;
  position: relative;
}

.ap-result-score.is-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 48px rgba(2,8,23,.4);
}

.ap-result-score.is-clickable:active {
  transform: scale(0.98);
}

.ap-result-score.is-clickable::after {
  content: 'Details ansehen \2192';
  position: absolute;
  bottom: 18px;
  right: 18px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(251,191,36,.8);
  opacity: 0;
  transition: opacity .2s, transform .2s;
  transform: translateX(-5px);
}

.ap-result-score.is-clickable:hover::after {
  opacity: 1;
  transform: none;
}

.ap-result-score-kicker, .ap-result-score-sub {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: rgba(186,230,253,.76);
}

.ap-result-score strong {
  font-family: var(--font-mono);
  font-size: 44px;
  line-height: 1;
  color: #FBBF24;
  text-shadow: 0 0 18px rgba(251,191,36,.24);
}

.ap-result-metrics {
  display: grid;
  grid-template-columns: repeat(6, 1fr) !important;
  gap: 6px;
}

.ap-result-metric {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 14px;
  background: #F8FAFC;
  border: 1px solid rgba(226,232,240,.9);
  text-align: center;
  min-width: 0;
}

.ap-result-metric span {
  font-size: clamp(7px, 1.8vw, 10px);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--gray-500);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ap-result-metric strong {
  font-family: var(--font-mono);
  font-size: clamp(14px, 3.5vw, 20px);
  color: var(--gray-800);
}

.ap-alt-compare {
  margin-bottom: 18px;
}

.ap-alt-compare-hd {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--gray-500);
  margin-bottom: 8px;
}

.ap-alt-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.ap-alt-card {
  background: #F8FAFC;
  border: 1px solid rgba(226,232,240,.9);
  border-radius: var(--radius);
  padding: 12px;
}

.ap-alt-card.is-active {
  border-color: var(--accent);
  background: rgba(14,165,233,.06);
}

.ap-alt-card.is-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--gray-500);
  font-size: 11px;
  min-height: 80px;
}

.ap-alt-card-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-800);
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 3px;
}

.ap-alt-card-tag {
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--accent);
  color: #042231;
  border-radius: 999px;
  padding: 1px 7px;
}

.ap-alt-card-hint {
  font-size: 10px;
  color: var(--gray-500);
  line-height: 1.4;
  margin-bottom: 8px;
}

.ap-alt-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 10px;
  color: var(--gray-600);
}

.ap-alt-card-stats strong {
  font-family: var(--font-mono);
  color: var(--gray-800);
}

.ap-collapse-wrap {
  margin-bottom: 16px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
}

.ap-collapse-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  background: var(--gray-50);
  user-select: none;
  transition: background .15s;
}

.ap-collapse-head:hover {
  background: var(--gray-100);
}

.ap-collapse-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-800);
}

.ap-collapse-icon {
  transition: transform .3s cubic-bezier(.34,1.2,.64,1);
}

.ap-collapse-wrap.is-collapsed .ap-collapse-icon {
  transform: rotate(-90deg);
}

.ap-collapse-content {
  display: grid;
  grid-template-rows: 1fr;
  transition: grid-template-rows .3s cubic-bezier(.34,1.2,.64,1);
}

.ap-collapse-content-inner {
  overflow: hidden;
}

.ap-collapse-wrap.is-collapsed .ap-collapse-content {
  grid-template-rows: 0fr;
}

.ap-collapse-content-pad {
  padding: 16px;
}

.ap-report-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
}

.ap-report-item {
  background: rgba(var(--gray-900-rgb),0.6);
  border: 1px solid rgba(var(--ink-rgb),0.08);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: modalIn 0.3s ease-out backwards;
}

.ap-report-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ap-report-date {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #94A3B8;
  background: rgba(var(--ink-rgb),0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

.ap-report-emp {
  font-size: 12px;
  font-weight: 600;
  color: #E2E8F0;
}

.ap-report-duty {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
}

.ap-report-duty.D {
  background: var(--red);
  color: #fff;
}

.ap-report-duty.HG {
  background: var(--blue-d);
  color: #fff;
}

.ap-report-body {
  font-size: 11.5px;
  color: #94A3B8;
  line-height: 1.5;
  padding-left: 8px;
  border-left: 2px solid rgba(var(--ink-rgb),0.1);
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.ap-report-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.ap-report-tag {
  font-size: 9px;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 10px;
  background: rgba(14,165,233,0.15);
  color: #7DD3FC;
  border: 1px solid rgba(14,165,233,0.3);
}

.ap-report-why-btn {
  margin-left: auto;
  font-size: 9.5px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #7DD3FC;
  background: rgba(14,165,233,0.1);
  border: 1px solid rgba(14,165,233,0.25);
  border-radius: 10px;
  padding: 2px 8px;
  cursor: pointer;
  flex-shrink: 0;
}

.ap-report-why-btn:hover {
  background: rgba(14,165,233,0.2);
}

.ap-report-alts {
  margin-top: 6px;
  padding: 8px 10px;
  background: rgba(var(--gray-900-rgb),0.4);
  border: 1px solid rgba(var(--ink-rgb),0.07);
  border-radius: var(--radius-xs);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.ap-report-alts-lbl {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #64748B;
  margin-bottom: 2px;
}

.ap-report-alt-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
}

.ap-report-alt-emp {
  font-weight: 600;
  color: #CBD5E1;
  min-width: 110px;
}

.ap-report-alt-score {
  font-family: var(--font-mono);
  color: #94A3B8;
  flex-shrink: 0;
}

.ap-report-alt-tags {
  color: #64748B;
  font-size: 9.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-dashboard {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.score-dash-head {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(var(--ink-rgb),0.1);
}

.score-main-circle {
  position: relative;
  width: 110px;
  height: 110px;
  flex-shrink: 0;
}

.score-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-ring-bg {
  fill: none;
  stroke: rgba(var(--ink-rgb),0.05);
  stroke-width: 3;
}

.score-ring-fill {
  fill: none;
  stroke: var(--score-color);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dasharray 1s ease-out;
}

.score-val-box {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: row;
  gap: 1px;
}

.score-num {
  font-size: 32px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fff;
  text-shadow: 0 0 15px var(--score-color);
}

.score-pct-sign {
  font-size: 14px;
  font-weight: 600;
  color: rgba(var(--ink-rgb),0.5);
  margin-bottom: -10px;
}

.score-dash-info {
  flex: 1;
}

.score-dash-rating {
  font-size: 20px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: 6px;
}

.score-dash-desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--gray-500);
}

.score-dash-desc strong {
  color: #fff;
  font-family: var(--font-mono);
}

.score-grid-enhanced {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.score-card-enhanced {
  background: rgba(var(--ink-rgb),0.03);
  border: 1px solid rgba(var(--ink-rgb),0.08);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.2s, background 0.2s;
  position: relative;
}

.score-card-enhanced:hover {
  transform: translateY(-2px);
  background: rgba(var(--ink-rgb),0.05);
}

.score-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.score-card-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: .05em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.score-card-weight {
  font-size: 10px;
  font-family: var(--font-mono);
  color: rgba(var(--ink-rgb),0.3);
  background: rgba(var(--ink-rgb),0.05);
  padding: 2px 6px;
  border-radius: 4px;
}

.score-card-mid {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.score-card-val {
  font-size: 22px;
  font-weight: 800;
  font-family: var(--font-mono);
}

.score-card-bar {
  flex: 1;
  height: 4px;
  background: rgba(var(--ink-rgb),0.06);
  border-radius: 2px;
  overflow: hidden;
  margin-top: -2px;
}

.score-card-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 1s ease-out;
}

.score-card-hint {
  font-size: 11px;
  line-height: 1.45;
  color: var(--gray-500);
}

.score-reasoning-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.score-reasoning-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--gray-300);
  background: rgba(var(--ink-rgb),0.03);
  padding: 10px 12px;
  border-radius: 8px;
  border-left: 3px solid transparent;
}

.score-reasoning-item.pos { border-left-color: #22C55E; }
.score-reasoning-item.neg { border-left-color: #EF4444; }
.score-reasoning-item.neu { border-left-color: #38BDF8; }

.score-r-icon { flex-shrink: 0; margin-top: 2px; }
.score-r-text { flex: 1; }

.score-r-pts {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0,0,0,0.3);
  white-space: nowrap;
}

.score-r-pts.pos { color: #4ADE80; }
.score-r-pts.neg { color: #F87171; }

.score-math-box-enhanced {
  background: rgba(14,165,233,0.05);
  border: 1px dashed rgba(14,165,233,0.25);
  border-radius: 12px;
  padding: 16px;
  margin-top: 8px;
}

.score-math-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-lt);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.score-math-text {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--gray-300);
}

.score-formula-display {
  background: rgba(0,0,0,0.3);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.formula-lbl {
  font-size: 10px;
  font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase;
}

.score-formula-display code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #FCD34D;
  word-break: break-all;
}

.ap-neural-vignette {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 60px rgba(0,0,0,0.9);
  pointer-events: none;
}

.ap-neural-hud-layer {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ap-neural-hud-item {
  display: flex;
  flex-direction: column;
}

.ap-nhi-lbl {
  font-size: 8px;
  font-weight: 700;
  color: rgba(var(--ink-rgb),0.4);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.ap-nhi-val {
  font-family: var(--font-mono);
  font-size: 10px;
  color: #38BDF8;
  font-weight: 600;
}

.ap-neural-stats {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
}

.ap-neural-stat-pill {
  background: rgba(0,0,0,0.6);
  border: 1px solid rgba(var(--ink-rgb),0.1);
  padding: 3px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  color: rgba(var(--ink-rgb),0.6);
}

[data-tooltip] {
  position: relative;
  cursor: help;
}

[data-tooltip]::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  border: 6px solid transparent;
  border-top-color: rgba(15, 23, 42, 0.95);
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.34, 1.2, 0.64, 1);
  z-index: 1001;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #F8FAFC;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  white-space: normal;
  width: max-content;
  max-width: 260px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.34, 1.2, 0.64, 1);
  z-index: 1000;
  box-shadow: 0 10px 25px rgba(0,0,0,0.3);
  border: 1px solid rgba(var(--ink-rgb),0.1);
}

[data-tooltip]:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-6px);
}

[data-tooltip-pos="bottom"]::before {
  bottom: auto;
  top: 100%;
  border-top-color: transparent;
  border-bottom-color: rgba(15, 23, 42, 0.95);
  transform: translateX(-50%) translateY(-8px);
}

[data-tooltip-pos="bottom"]::after {
  bottom: auto;
  top: 100%;
  transform: translateX(-50%) translateY(-4px);
}

[data-tooltip-pos="bottom"]:hover::before {
  transform: translateX(-50%) translateY(0);
}

[data-tooltip-pos="bottom"]:hover::after {
  transform: translateX(-50%) translateY(6px);
}

@media (max-width: 1200px) {
  .ap-result-hero { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .ap-engine-main { flex-direction: column; }
  .ap-neural-view { min-height: 200px; }
}

@media (max-width: 768px) {
  .modal {
    border-radius: var(--radius);
    max-height: min(var(--modal-max-height, calc(100dvh - (2 * var(--overlay-pad)))), calc(100dvh - (2 * var(--overlay-pad))));
  }
  .modal-hd { padding: 12px 14px; }
  .modal-bd { padding: 14px; }
  .modal-bd.ap-progress-bd { padding: 10px; }
  .modal-ft { padding: 10px 14px; }
  .modal-ft .mbtn { flex: 1 1 160px; justify-content: center; }
  .ap-hero-hud { flex-direction: column; align-items: stretch; }
  .ap-hud-spectacle { width: 100%; height: 60px; }
  .score-grid-enhanced { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .modal-hd, .modal-bd, .modal-ft { padding-left: 12px; padding-right: 12px; }
  .modal-ft .mbtn { flex-basis: 100%; }
  .ap-table { min-width: 100%; }
  .score-dash-head { flex-direction: column; text-align: center; gap: 16px; }
  .score-math-text { font-size: 11.5px; }
}

body.is-mobile .overlay#modal-editor,
body.is-mobile .overlay#modal-autoplan,
body.is-mobile .overlay#modal-dept,
body.is-mobile .overlay#modal-profile,
body.is-mobile .overlay#modal-emps,
body.is-mobile .overlay#modal-import,
body.is-mobile .overlay#modal-ap-report,
body.is-mobile .overlay#modal-score-info {
  align-items: flex-end !important;
  padding: 0 !important;
}

body.is-mobile .overlay#modal-editor .modal,
body.is-mobile .overlay#modal-autoplan .modal,
body.is-mobile .overlay#modal-dept .modal,
body.is-mobile .overlay#modal-profile .modal,
body.is-mobile .overlay#modal-emps .modal,
body.is-mobile .overlay#modal-import .modal,
body.is-mobile .overlay#modal-ap-report .modal,
body.is-mobile .overlay#modal-score-info .modal {
  border-radius: 20px 20px 0 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  max-height: min(var(--modal-max-height, calc(var(--app-vh) - var(--safe-top))), calc(var(--app-vh) - var(--safe-top))) !important;
  margin: 0 !important;
  animation: slideUp .28s cubic-bezier(.34,1.2,.64,1) forwards !important;
}

body.is-mobile .overlay .modal.modal-closing {
  animation: slideDown .2s ease forwards !important;
}

body.is-mobile #modal-editor .modal-bd,
body.is-mobile #modal-dept .dept-body,
body.is-mobile #modal-profile .pm-body,
body.is-mobile #modal-ap-report #ap-report-body,
body.is-mobile #modal-score-info #score-info-body {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  flex: 1 !important;
  min-height: 0 !important;
}

body.is-mobile #modal-autoplan .modal-bd {
  padding: 18px !important;
}

body.is-mobile #modal-autoplan .modal-bd.ap-progress-bd {
  padding: 10px !important;
  overflow: hidden !important;
}

body.is-mobile #modal-autoplan .ap-neural-view {
  min-height: clamp(190px, 34vh, 320px);
}

body.is-mobile #modal-autoplan .ap-terminal {
  min-height: clamp(160px, 28vh, 280px);
}

body.is-mobile .modal-x {
  padding: 10px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

body.is-mobile #ap-compute {
  min-height: 52px !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  touch-action: manipulation !important;
  cursor: pointer !important;
  padding: 14px 24px !important;
  position: relative !important;
  z-index: 1 !important;
}

body.is-mobile .ap-target-input {
  font-size: 16px !important;
  min-height: 44px !important;
  width: 64px !important;
  text-align: center !important;
}

body.is-mobile .ap-table-wrap {
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

body.is-mobile .ap-table {
  min-width: 320px !important;
}

body.is-mobile .preview-box-val {
  font-size: 18px !important;
}

body.is-mobile .ap-term-body {
  max-height: 200px !important;
  -webkit-overflow-scrolling: touch !important;
}

body.is-mobile #modal-editor .modal-ft,
body.is-mobile #modal-autoplan .modal-ft,
body.is-mobile #modal-emps .modal-ft,
body.is-mobile #modal-import .modal-ft,
body.is-mobile #modal-dept .modal-ft,
body.is-mobile #modal-profile .modal-ft,
body.is-mobile #modal-ap-report .modal-ft,
body.is-mobile #modal-score-info .modal-ft,
body.is-mobile .mday-footer {
  padding-bottom: max(16px, env(safe-area-inset-bottom, 16px)) !important;
}

body.is-mobile #modal-mobile-menu .modal-bd {
  padding-bottom: max(24px, calc(var(--safe-bottom) + 20px)) !important;
  overflow-y: auto;
}

@keyframes slideDown { 
  from { transform: translateY(0); } 
  to { transform: translateY(105%); } 
}

@keyframes slideUp { 
  from { transform: translateY(100%); } 
  to { transform: translateY(0); } 
}


/* ═══════════════════════════════════════════════════════════════════════════
   JAHRESPLANER MODAL
   ═══════════════════════════════════════════════════════════════════════════ */

#modal-yearplan .modal {
  width: min(1440px, 98vw);
  height: min(92vh, 900px);
  max-height: min(var(--modal-max-height), 900px);
  display: flex;
  flex-direction: column;
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.yp-modal-hd {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px 14px;
  flex-shrink: 0;
}

.yp-hd-left {
  flex: 1;
  min-width: 0;
}

.yp-year-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(var(--ink-rgb),0.06);
  border: 1px solid rgba(var(--ink-rgb),0.1);
  border-radius: 8px;
  padding: 3px;
  flex-shrink: 0;
}

.yp-year-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: rgba(var(--ink-rgb),0.7);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.yp-year-btn:hover {
  background: rgba(var(--ink-rgb),0.12);
  color: #fff;
}

.yp-year-label {
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  min-width: 44px;
  text-align: center;
  letter-spacing: 0.04em;
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */

.yp-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 20px;
  background: rgba(var(--navy-800-rgb),0.6);
  border-bottom: 1px solid rgba(var(--ink-rgb),0.07);
  flex-shrink: 0;
}

.yp-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-sans);
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(var(--ink-rgb),0.45);
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s;
  white-space: nowrap;
  letter-spacing: 0.02em;
  margin-bottom: -1px;
}
.yp-tab:hover {
  color: rgba(var(--ink-rgb),0.75);
}
.yp-tab.active {
  color: var(--accent-lt);
  border-bottom-color: var(--accent);
}
.yp-tab svg {
  opacity: 0.7;
}
.yp-tab.active svg {
  opacity: 1;
}

/* ── Body ────────────────────────────────────────────────────────────────── */

.yp-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 24px 24px;
  background: var(--gray-50);
  scroll-behavior: smooth;
}

.yp-body::-webkit-scrollbar { width: 6px; }
.yp-body::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }

.yp-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  font-size: 13px;
  color: var(--gray-500);
  font-style: italic;
}

/* ══ GRID-TAB ═══════════════════════════════════════════════════════════════ */

/* ── Legende ─────────────────────────────────────────────────────────────── */

.yp-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 16px;
  font-size: 11px;
  color: var(--gray-500);
}

.yp-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.yp-leg-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.08);
  flex-shrink: 0;
}

.yp-leg-sep {
  color: var(--gray-300);
}

.yp-legend-hint {
  font-size: 10.5px;
  color: var(--gray-500);
  font-style: italic;
}

/* ── Grid-Tabelle ────────────────────────────────────────────────────────── */

.yp-grid-scroll {
  overflow-x: auto;
  overflow-y: visible;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
  background: #fff;
}

.yp-grid-scroll::-webkit-scrollbar { height: 6px; }
.yp-grid-scroll::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }

.yp-grid-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.yp-grid-table th,
.yp-grid-table td {
  border: 1px solid var(--gray-150);
  padding: 0;
}

/* Sticky Name-Spalte */
.yp-th-name,
.yp-td-name {
  position: sticky;
  left: 0;
  z-index: 2;
  min-width: 165px;
  max-width: 165px;
  background: #fff;
}

.yp-th-name {
  background: var(--gray-800);
  color: var(--gray-300);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 10px 12px;
}

.yp-td-name {
  padding: 8px 10px 8px 12px;
  background: #fff;
  box-shadow: 2px 0 6px rgba(0,0,0,0.05);
}

/* Name-Zelle Inhalt */
.yp-emp-name {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-800);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yp-emp-pos {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.03em;
  margin-top: 2px;
}

/* Monats-Header */
.yp-th-month {
  width: 76px;
  min-width: 76px;
  background: var(--gray-800);
  color: var(--gray-300);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  padding: 10px 4px;
  cursor: pointer;
  transition: background 0.15s;
}
.yp-th-month:hover { background: var(--gray-700); color: #fff; }
.yp-th-month.yp-th-now {
  background: rgba(14,165,233,0.2);
  color: var(--accent-lt);
  position: relative;
}
.yp-th-month.yp-th-now::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0; right: 0;
  height: 2px;
  background: var(--accent);
}
.yp-th-month.yp-th-future { opacity: 0.5; }

/* Total-Spalte */
.yp-th-total {
  min-width: 72px;
  width: 72px;
  background: var(--gray-800);
  color: var(--gray-300);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  padding: 10px 4px;
}

/* Ø-Zeile */
.yp-mean-hdr td {
  background: var(--gray-800) !important;
  border-color: rgba(var(--ink-rgb),0.06);
}

.yp-mean-name {
  padding: 6px 10px 6px 12px;
}

.yp-mean-icon {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--gray-500);
  letter-spacing: 0.05em;
}

.yp-td-mean {
  text-align: center;
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--gray-500);
  padding: 6px 4px;
}

/* Gruppen-Trennzeile */
.yp-group-row td {
  background: var(--gray-100);
  border-top: 2px solid var(--gray-200);
}

.yp-group-label {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gray-500);
  padding: 5px 12px;
}

/* MA-Zeile */
.yp-emp-row:hover .yp-td-name { background: var(--gray-50); }
.yp-emp-row:hover .yp-td-cell { filter: brightness(0.96); }

/* Daten-Zellen */
.yp-td-cell {
  width: 76px;
  min-width: 76px;
  text-align: center;
  padding: 6px 4px;
  cursor: pointer;
  transition: filter 0.1s, box-shadow 0.1s;
  position: relative;
}
.yp-td-cell:hover {
  box-shadow: inset 0 0 0 2px var(--accent);
  z-index: 1;
}

.yp-td-cell.yp-td-now {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.yp-td-nodata {
  background: var(--gray-50);
  cursor: default;
}
.yp-td-nodata:hover { box-shadow: none; }

.yp-cell-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 32px;
  justify-content: center;
}

.yp-cell-bd {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-mono);
  display: flex;
  align-items: baseline;
  gap: 1px;
}

.yp-cell-bd-lbl {
  font-size: 8px;
  font-weight: 600;
  opacity: 0.65;
}

.yp-cell-hg {
  font-size: 10px;
  font-weight: 600;
  color: var(--accent);
  font-family: var(--font-mono);
  display: flex;
  align-items: baseline;
  gap: 1px;
}

.yp-cell-hg-lbl {
  font-size: 7px;
  opacity: 0.7;
}

/* Total-Zelle */
.yp-td-total {
  text-align: center;
  padding: 8px 6px;
  background: var(--gray-50);
}

.yp-total-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.yp-total-bd {
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--gray-700);
  display: flex;
  align-items: baseline;
  gap: 1px;
}

.yp-total-hg {
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--accent);
  display: flex;
  align-items: baseline;
  gap: 1px;
}

.yp-total-lbl {
  font-size: 7.5px;
  opacity: 0.6;
}

/* Hilfselemente */
.yp-dash { color: var(--gray-300); font-size: 11px; }

.yp-future-marker {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gray-200);
}

/* ══ FAIRNESS-TAB ════════════════════════════════════════════════════════════ */

.yp-fair-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px 20px;
  margin-bottom: 18px;
}

.yp-mode-toggle {
  display: flex;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}

.yp-mode-btn {
  padding: 7px 16px;
  font-size: 11.5px;
  font-weight: 600;
  background: #fff;
  border: none;
  color: var(--gray-500);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.yp-mode-btn + .yp-mode-btn {
  border-left: 1px solid var(--gray-200);
}
.yp-mode-btn:hover { background: var(--gray-100); color: var(--gray-700); }
.yp-mode-btn.active {
  background: var(--gray-800);
  color: #fff;
}

.yp-fair-hint {
  flex: 1;
  min-width: 200px;
  font-size: 11.5px;
  color: var(--gray-500);
  line-height: 1.5;
}

/* Chart-Karte */
.yp-chart-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 18px 20px 16px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}

.yp-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 14px;
}

.yp-legitem {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--gray-600);
}

.yp-legline {
  width: 18px;
  height: 3px;
  border-radius: 2px;
  flex-shrink: 0;
}

.yp-leglabel {
  white-space: nowrap;
}

.yp-chart-canvas-wrap {
  position: relative;
  height: 280px;
}

.yp-chart-canvas-hbar {
  /* height set dynamically */
}

/* Fairness-Tabelle */
.yp-fair-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.yp-fair-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.yp-fair-table th {
  background: var(--gray-800);
  color: var(--gray-300);
  font-weight: 700;
  font-size: 9.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 8px 10px;
  text-align: center;
  white-space: nowrap;
}

.yp-fth-name {
  text-align: left !important;
  min-width: 150px;
}

.yp-fair-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--gray-100);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
}

.yp-fair-table tr:last-child td { border-bottom: none; }
.yp-fair-table tr:hover td { background-color: var(--gray-50) !important; }

.yp-ftd-name {
  text-align: left !important;
  font-family: var(--font-sans) !important;
  font-size: 12px !important;
  font-weight: 600;
  color: var(--gray-800);
  padding-left: 12px !important;
  white-space: nowrap;
}

.yp-ftd-nd { color: var(--gray-300); }
.yp-ftd-sum { font-weight: 700; color: var(--gray-700); }
.yp-ftd-dev { font-weight: 700; min-width: 44px; }

/* ══ AUSWERTUNGS-TABS (Soll/Ist · Abwesenheiten) ══════════════════════════════
   Toolbar im Stil des Mitarbeitenden-Modals: Rollenfilter · Sortierung · CSV. */
.yp-eval-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.yp-eval-pills { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.yp-eval-pill {
  border: 1px solid var(--gray-200);
  background: #fff;
  color: var(--gray-600);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
}
.yp-eval-pill:hover { background: var(--gray-50); color: var(--gray-800); }
.yp-eval-pill.active { background: var(--gray-800); color: #fff; border-color: var(--gray-800); }
.yp-eval-toolbar-right { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.yp-eval-sort-wrap { display: inline-flex; align-items: center; gap: 6px; }
.yp-eval-sort-lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--gray-500); }
.yp-eval-sort {
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-800);
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 7px 10px;
  cursor: pointer;
}
.yp-eval-sort:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14,165,233,.15); }
.yp-eval-export {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  /* Deeper blue for AA-compliant white text (see empdash-export-btn). */
  background: #0369A1;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  cursor: pointer;
  transition: background .2s, transform .15s;
}
.yp-eval-export:hover { background: #075985; }
.yp-eval-export:active { transform: scale(.96); }

.yp-eval-hint {
  font-size: 12px;
  color: var(--gray-500);
  line-height: 1.5;
  margin-bottom: 14px;
}

.yp-eval-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.yp-eval-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.yp-eval-table th {
  background: var(--gray-800);
  color: var(--gray-300);
  font-weight: 700;
  font-size: 9.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 9px 10px;
  text-align: center;
  white-space: nowrap;
}
.yp-ev-th-name { text-align: left !important; min-width: 170px; padding-left: 12px !important; }
.yp-eval-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--gray-100);
  text-align: center;
  font-family: var(--font-mono);
}
.yp-eval-table tr:last-child td { border-bottom: none; }
.yp-eval-table tbody tr:hover td { background-color: var(--gray-50); }
.yp-ev-name {
  text-align: left !important;
  font-family: var(--font-sans) !important;
  padding-left: 12px !important;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}
.yp-ev-empname { font-weight: 600; color: var(--gray-800); }
.yp-ev-pos {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: var(--radius-xs);
  letter-spacing: .03em;
}
.yp-ev-num { color: var(--gray-700); }
.yp-ev-strong { font-weight: 800; color: var(--gray-900); }
.yp-eval-empty { padding: 28px !important; color: var(--gray-500) !important; font-family: var(--font-sans) !important; }

/* ══ PROJEKTION-TAB ══════════════════════════════════════════════════════════ */

.yp-proj-intro {
  margin-bottom: 18px;
}

.yp-proj-hint {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: var(--gray-500);
  background: var(--accent-dim);
  border: 1px solid rgba(14,165,233,0.15);
  border-radius: var(--radius);
  padding: 10px 14px;
  line-height: 1.5;
}

.yp-proj-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  background: #fff;
  box-shadow: var(--shadow-sm);
  margin-top: 18px;
}

.yp-proj-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.yp-proj-table th {
  background: var(--gray-800);
  color: var(--gray-300);
  font-weight: 700;
  font-size: 9.5px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 8px 10px;
  text-align: center;
  white-space: nowrap;
}

.yp-pth-name { text-align: left !important; min-width: 150px; }
.yp-pth-prog { min-width: 120px; }

.yp-proj-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--gray-100);
  text-align: center;
  font-family: var(--font-mono);
  font-size: 11px;
}

.yp-proj-table tr:last-child td { border-bottom: none; }
.yp-proj-table tr:hover td { background-color: var(--gray-50) !important; }

.yp-ptd-name {
  text-align: left !important;
  font-family: var(--font-sans) !important;
  font-size: 12px !important;
  font-weight: 600;
  color: var(--gray-800);
  padding-left: 12px !important;
  white-space: nowrap;
}

.yp-ptd-proj { font-weight: 700; font-size: 13px; }
.yp-ptd-dev  { font-weight: 700; }
.yp-ptd-sub  { color: var(--gray-500); font-size: 10px; }

.yp-ptd-prog {
  min-width: 120px;
}

.yp-prog-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.yp-prog-track {
  flex: 1;
  height: 6px;
  background: var(--gray-150);
  border-radius: 3px;
  overflow: hidden;
}

.yp-prog-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.yp-prog-pct {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  min-width: 32px;
  text-align: right;
}

/* ══ EDITOR KOMMENTAR-BEREICH ═════════════════════════════════════════════════ */

#ed-comment-section {
  margin-top: 4px;
  border-top: 1px solid var(--gray-150);
  padding-top: 14px;
}

.ed-comment-ta {
  width: 100%;
  min-height: 60px;
  max-height: 120px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 9px 12px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  color: var(--gray-800);
  background: var(--gray-50);
  resize: vertical;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
  line-height: 1.5;
  display: block;
}

.ed-comment-ta:focus {
  outline: none;
  border-color: var(--accent);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(14,165,233,0.12);
}

.ed-comment-ta::placeholder {
  color: var(--gray-500);
  font-style: italic;
}

.ed-comment-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 5px;
  gap: 8px;
}

.ed-comment-hint {
  font-size: 10px;
  color: var(--gray-500);
  font-style: italic;
}

.ed-comment-count {
  font-size: 10px;
  font-family: var(--font-mono);
  color: var(--gray-500);
  white-space: nowrap;
}

/* ══ JAHRESPLAN MOBILE ANPASSUNGEN ═══════════════════════════════════════════ */

@media (max-width: 700px) {
  #modal-yearplan .modal {
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .yp-modal-hd {
    padding: 12px 16px;
  }

  .yp-tabs {
    padding: 0 12px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .yp-tabs::-webkit-scrollbar { display: none; }

  .yp-body {
    padding: 14px 12px;
  }

  .yp-fair-controls {
    flex-direction: column;
  }

  .yp-chart-canvas-wrap {
    height: 220px;
  }
}
