:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e5e7eb;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  --text: #111827;
  --muted: #6b7280;
  --primary: #111827;
  --primary-hover: #0b1220;
  --accent: #2563eb;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --container-max: 1380px;
  --app-scale: 0.9;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { scrollbar-gutter: stable both-edges; }
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.app-root { transform: scale(var(--app-scale)); transform-origin: top center; }

/* Caret-Management: global ausblenden, nur in editierbaren Feldern zeigen */
html, body, * { caret-color: transparent; }
input:not([readonly]),
textarea:not([readonly]),
[contenteditable="true"] { caret-color: auto; }
input[readonly],
textarea[readonly],
[contenteditable="false"] { caret-color: transparent; }
.app-root { transform: scale(var(--app-scale)); transform-origin: top center; }


.container {
  max-width: 1380px;
  margin: 24px auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow);
}

h1 { margin: 0 0 8px 0; font-size: 22px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.section { margin: 16px 0; padding: 16px; background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.section-title { margin: 0 0 12px 0; font-size: 16px; font-weight: 600; }
/* Grössere Titel in der Ergebnis-Ansicht für Gruppen */
.review-group-title { font-size: 18px; font-weight: 700; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  border-bottom: 1px solid var(--border);
}
.app-header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 12px 24px 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
/* Logo auf gleiche Flucht wie Container-Inhalt */
.app-header-inner { padding-left: 24px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--text); margin-left: max(0px, calc((1 - var(--app-scale)) * min(var(--container-max), 100vw) / 2 - 24px)); }
.brand-logo { height: 40px; display:block; }
.brand-sub { color: var(--muted); font-weight: 500; font-size: 13px; }
.partner-logo { display: flex; align-items: center; margin-left: auto; margin-right: max(0px, calc((1 - var(--app-scale)) * min(var(--container-max), 100vw) / 2 - 24px)); }
.fhnw-logo { height: 40px; display: block; }

/* Stepper (entfernt) */

/* Grid layout */
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.grid-2.has-right { grid-template-columns: 1fr; }
.wide { grid-column: 1 / -1; }
.col-left { grid-column: 1; }
.col-right { grid-column: 1; }
.grid-2.has-right .col-right { grid-column: 2; }
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .col-left, .col-right, .wide { grid-column: 1; }
}

/* Forms */
.form-section { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; font-weight: 500; color: #374151; font-size: 14px; }
.form-input, .form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}
.form-input:focus, .form-textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.1); }
.form-textarea { resize: vertical; min-height: 80px; font-family: inherit; }

input[type="file"] { padding: 8px; }

/* Buttons */
button { background: var(--primary); color: #fff; border: none; padding: 10px 14px; border-radius: 8px; cursor: pointer; }
button:hover { background: var(--primary-hover); }
.button-secondary { background: #fe6027; color: #fff; border: none; padding: 10px 14px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; justify-content: center; }
.button-secondary:hover { background: #e2551f; }
.button-secondary:disabled { background: #ff9e7a; cursor: not-allowed; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }

/* Tabs */
.tabs { display:flex; gap:8px; }
.tab-button { background:#fff; color:#111827; border:1px solid var(--border); padding:8px 12px; border-radius:10px; cursor:pointer; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.tab-button.active { background:#fe6027; color:#fff; border-color:#fe6027; }
.tab-button:not(.active):hover { background:#fe6027; color:#fff; border-color:#fe6027; }
.tab-button.active:hover { background:#fe6027; color:#fff; border-color:#fe6027; }

/* Inaktive Plananalyse-Lasche mit etwas kleinerer Schrift */
.tab-button.plananalyse-link { font-size: 14px; }
@media (max-width: 900px) {
  .tab-button.plananalyse-link { font-size: 14px; }
}

/* Inline Spinner am Button */
.spinner-inline { display:inline-block; width:16px; height:16px; border:2px solid rgba(255,255,255,0.35); border-top-color:#fff; border-radius:50%; margin-left:4px; animation: spin 1s linear infinite; }

/* Messages */
.error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; padding: 12px; border-radius: 8px; }
.muted { color: var(--muted); }
.muted-note { color: var(--muted); font-size: 13px; margin-top: 6px; }
.footer { margin-top: 16px; font-size: 12px; color: var(--muted); }

/* Tables */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px; border-bottom: 1px solid var(--border); text-align: left; }
th { background: #f9fafb; }

/* Loading */
.loading { display: none; text-align: center; margin: 20px 0; }
.loading.show { display: block; }
.spinner { display: inline-block; width: 40px; height: 40px; border: 4px solid #f3f4f6; border-top: 4px solid var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 16px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.loading-text { color: var(--muted); font-size: 14px; margin-top: 8px; }
.loading.inline { margin: 12px 0; }

/* Spezielles Layout für Plananalyse-Loader */
#planLoadingSection {
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
}
#planLoadingSection .spinner {
  width: 20px;
  height: 20px;
  border-width: 3px;
  margin-bottom: 0;
}
#planLoadingSection .loading-text {
  margin-top: 0;
}

/* Requirements Results */
.requirements-section { margin: 12px 0; padding: 16px; background: #f9fafb; border: 1px solid var(--border); border-radius: 8px; }
.match-item { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 12px; }
.match-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.match-title { font-weight: 600; color: var(--text); margin: 0; }
.confidence-badge { background: var(--success); color: #fff; padding: 2px 8px; border-radius: 12px; font-size: 12px; }
.confidence-badge.medium { background: var(--warning); }
.confidence-badge.low { background: var(--danger); }
.match-reasoning { color: var(--muted); font-size: 14px; margin: 8px 0; }
.requirements-list { margin-top: 12px; }
.requirements-list h4 { margin: 0 0 8px 0; font-size: 14px; color: #374151; }
.requirements-list ul { margin: 0; padding-left: 20px; }
.requirements-list li { margin-bottom: 4px; color: #4b5563; font-size: 14px; }
.all-requirements { background: #eff6ff; border: 1px solid #bfdbfe; }
.all-requirements h4 { color: #1e40af; }

/* Compliance Results */
.compliance-section { margin: 12px 0; padding: 16px; background: #ecfeff; border: 1px solid #a5f3fc; border-radius: 8px; }
.pill { display: inline-block; padding: 4px 8px; border-radius: 9999px; font-size: 12px; margin-right: 6px; }
.pill.ok { background: #dcfce7; color: #065f46; border: 1px solid #bbf7d0; }
.pill.missing { background: #fee2e2; color: #7f1d1d; border: 1px solid #fecaca; }
.pill.extra { background: #fef9c3; color: #713f12; border: 1px solid #fde68a; }

/* Review UI */
.review-section { margin: 0; padding: 0; background: transparent; border: none; border-radius: 0; }
#tabReview { padding: 0; }
.review-section.wide { grid-column: 1 / -1; }
.review-toolbar { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.small { font-size: 12px; color: var(--muted); }
.review-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
/* Header orange-hell */
.review-table th { background: #FFAB5C; border-bottom: 1px solid #FFD199; }
.review-table th, .review-table td { padding: 12px 14px; border-bottom: 1px solid #E5E7EB; text-align: left; vertical-align: middle; }
.review-table tbody tr:not(:first-child) td { border-top: 1px solid var(--border); }
.review-table tbody tr:first-child td { border-top: none; }
.review-table th:nth-child(1), .review-table td:nth-child(1) { width: 32%; }
.review-table th:nth-child(2), .review-table td:nth-child(2) { width: 16%; }
.review-table th:nth-child(3), .review-table td:nth-child(3) { width: 14%; }
.review-table th:nth-child(4), .review-table td:nth-child(4) { width: 10%; }
.review-table th:nth-child(5), .review-table td:nth-child(5) { width: 20%; }
.review-table th:nth-child(6), .review-table td:nth-child(6) { width: 8%; }
.review-table td > .inline-input, .review-table td > input.inline-input, .review-table td > select.inline-input {
  margin-top: 0;
  margin-bottom: 0;
}
.review-table td:first-child { white-space: nowrap; }
.review-table td:nth-child(5) .inline-input { width: 100%; box-sizing: border-box; background:#f8fafc; border:1px solid #e5e7eb; border-radius:12px; height:40px; padding:10px 12px; }
.review-table td.cell-center, .review-table th.cell-center { text-align: center; }
.review-table td.cell-center .inline-checkbox { margin: 0; }
.review-table td.cell-center .icon-btn { display: inline-flex; align-items: center; justify-content: center; }
.icon-btn { background: transparent; color:#fe6027; border:none; width:36px; height:36px; padding:0; border-radius:6px; cursor:pointer; line-height:0; display:inline-flex; align-items:center; justify-content:center; box-sizing: border-box; vertical-align: middle; }
.icon-btn:hover { color:#E56D00; background: transparent; border:1px solid #fe6027; }
.icon-btn:focus { outline: none; }
.icon-btn.danger { color:inherit; }
.icon-btn svg { display:block; }
.icon-btn.chev { width:36px; height:36px; }

/* Präsenz Custom Dropdown */
.presence-select { position: relative; display: inline-flex; align-items: center; gap:8px; padding: 8px 12px; height: 40px; border:1px solid #d1d5db; border-radius: 12px; background:#fff; cursor:pointer; min-width: 160px; }
.presence-select:focus { outline: 2px solid #FDBA74; outline-offset: 2px; }
.presence-select .dot { width:10px; height:10px; border-radius:9999px; display:inline-block; }
.presence-select .dot.green { background:#10b981; }
.presence-select .dot.red { background:#ef4444; }
.presence-select .dot.yellow { background:#f59e0b; }
.presence-select .dot.gray { background:#9ca3af; }
.presence-select .label { font-size:14px; color:#111827; }
.presence-select .chev { margin-left:auto; width: 0; height: 0; border-left:6px solid transparent; border-right:6px solid transparent; border-top:6px solid #9ca3af; }
.presence-select.open .chev { border-top-color: transparent; border-bottom:6px solid #9ca3af; }
.presence-menu { position: absolute; top: 44px; left: 0; z-index: 1000; background:#fff; border:1px solid #e5e7eb; border-radius:12px; box-shadow: var(--shadow); padding:6px; width: 100%; display:none; }
.presence-select.open-up .presence-menu { top: auto; bottom: 44px; }
.presence-select.open .presence-menu { display:block; }
.presence-option { display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:10px; cursor:pointer; }
.presence-option:hover { background:#FFF8EF; color:#E56D00; }
.presence-option.selected { background:#FFE8D6; color:#fe6027; }
.presence-option .check { opacity:0; color:#fe6027; font-weight:600; width:14px; text-align:center; }
.presence-option.selected .check { opacity:1; }
.doc-title { font-weight: 600; cursor: text; display: block; padding: 0 0 2px 0; margin: 0; border-bottom: 2px solid transparent; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-title:hover { border-bottom-color: #e5e7eb; }
.doc-source { margin-top: 2px; color: var(--muted); line-height: 1.2; font-style: italic; }
.doc-sources { list-style:none; margin:2px 0 0 0; padding:0; color: var(--muted); }
.doc-sources li { overflow:hidden; text-overflow:ellipsis; white-space:normal; font-style: italic; word-break: break-word; }
.review-table td:first-child { word-break: break-word; }
.review-table tr.add-row td { background: #FFFFFF; transition: background .15s ease; }
.review-table tr.add-row:hover td { background: #FFF8EF; }
/* Freie Eingabezeile: Links bündig wie Text darüber */
.review-table tr.add-row td:first-child input.inline-input {
  padding-left: 0;
  margin-left: -1px; /* gleicht die 1px Border zum Tabellenrand aus */
}
.review-table th { background: #f1f5f9; }
.inline-input { width: 100%; box-sizing: border-box; padding: 6px 8px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px; }
.inline-input:focus { outline: 2px solid #FDBA74; outline-offset: 2px; border-color: #FDBA74; box-shadow: none; }
/* Textfelder (z. B. Hinweis/Grund) auf gleiche Höhe/Optik wie Selects */
input.inline-input {
  height: 40px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
}
/* Feinjustierung: Freies Dokument-Feld etwas weiter links einrücken */
#addDocNameInput { padding-left: 10px; }

/* Underline-Stil für Textfelder (ohne Selects) */
input.inline-input:not([type="checkbox"]):not([readonly]),
.form-input,
.form-textarea {
  border: none;
  border-bottom: 2px solid #d1d5db;
  border-radius: 0;
  background: transparent;
  padding-left: 0;
  padding-right: 2px;
}
input.inline-input:not([type="checkbox"]):not([readonly]):focus,
.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-bottom-color: var(--primary);
  box-shadow: none;
}
input.inline-input[readonly] { background: #f9fafb; }
.inline-checkbox { transform: translateY(2px); accent-color: #fe6027; }
.meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
@media (max-width: 700px) { .meta-grid { grid-template-columns: 1fr; } }
.preview-box { white-space: pre-wrap; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 12px; min-height: 480px; width: 100%; box-sizing: border-box; font-family: inherit; font-size: 14px; line-height: 1.5; resize: vertical; }
.preview-box:focus { outline: none; border-color: #fe6027; box-shadow: none; }
.review-table tbody tr:nth-child(even) { background: inherit; }
.review-table tbody tr:hover { background: #FFF8EF; }
.review-table tbody tr { background:#FFFFFF; transition: background .15s ease, border-left-color .15s ease; }
.review-table tbody tr.is-active { background: inherit; border-left: none; }

/* Consistent, schlichte Select-Dropdowns */
select.inline-input, select.form-input, .form-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%236b7280'%3E%3Cpath fill-rule='evenodd' d='M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.71a.75.75 0 111.06 1.06l-4.24 4.24a.75.75 0 01-1.06 0L5.21 8.29a.75.75 0 01.02-1.08z' clip-rule='evenodd'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px 16px;
  padding: 10px 36px 10px 12px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
select.inline-input:focus, select.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}
select.inline-input:hover, select.form-input:hover, .form-select:hover { border-color: #c5ccd3; }
select.inline-input:disabled, select.form-input:disabled, .form-select:disabled {
  background-color: #f3f4f6;
  color: var(--muted);
  cursor: not-allowed;
}

/* Chips/Badges */
.chip { display:inline-flex; align-items:center; gap:6px; padding:4px 8px; border-radius:9999px; border:1px solid var(--border); background:#fff; font-size:12px; color:#374151; }
.badge { display:inline-block; padding:2px 8px; border-radius:6px; font-size:12px; font-weight:600; }
.badge-info { background:#eff6ff; color:#1e40af; border:1px solid #bfdbfe; }
.badge-success { background:#ecfdf5; color:#065f46; border:1px solid #a7f3d0; }
.badge-warn { background:#fffbeb; color:#92400e; border:1px solid #fde68a; }

/* Callouts (entfernt) */

/* Uploads-Liste */
.uploads-list { display: flex; flex-direction: column; gap: 10px; }
.upload-item { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px; border:1px solid var(--border); border-radius:12px; background:rgba(250, 187, 143, 0.15); }
.upload-item .name { display:flex; align-items:center; gap:10px; color:#111827; }
.upload-item .remove { color:#111827; text-decoration: underline; cursor:pointer; }
.upload-item .icon { width:22px; height:22px; display:inline-flex; align-items:center; justify-content:center; }
.upload-item .icon img { width: 18px; height: 18px; display:block; }

/* Dropzone */
.dropzone {
  border: 2px dashed #FABB8F;
  border-radius: 12px;
  background: rgba(250, 187, 143, 0.15);
  padding: 36px 16px;
  text-align: center;
  color: #64748b;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.dropzone .dz-icon { font-size: 28px; margin-bottom: 6px; color: #faab73; }
.dropzone .dz-text { font-size: 14px; color: #64748b; }
.dropzone:hover { background: rgba(250, 187, 143, 0.5); border-color: #fe6027; }
.dropzone.dragover { background: rgba(250, 187, 143, 0.5); border-color: #fe6027; }

/* Drag & Drop für Review-Tabellen */
.drop-zone.drag-over { outline: 2px dashed #94a3b8; background:#f8fafc; }
tr.draggable-row { cursor: grab; }
tr.draggable-row.dragging { opacity: .7; }

/* Plananalyse */
.plan-list { display:flex; flex-direction:column; gap:12px; }
.plan-item { display:grid; grid-template-columns: 1fr auto; align-items:center; gap:12px; padding:16px; border:1px solid var(--border); border-radius:12px; background:#fff; }
.plan-main { display:flex; align-items:center; gap:12px; flex:1; }
.plan-main { cursor: pointer; }
.plan-text { display:flex; flex-direction:column; min-width:0; }
.plan-title { font-weight:600; color:#111827; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.plan-subtitle { color: var(--muted); font-style: italic; margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.plan-actions { display:flex; align-items:center; gap:8px; }

/* Status-Dropdown (ähnlich Präsenz) */
.status-select { position: relative; display: inline-flex; align-items: center; gap:8px; padding:8px 12px; height:40px; border:1px solid #d1d5db; border-radius:12px; background:#fff; cursor:pointer; min-width: 170px; width: 240px; }
.status-select .label { font-size:14px; color:#111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-select .chev { margin-left:auto; width: 0; height: 0; border-left:6px solid transparent; border-right:6px solid transparent; border-top:6px solid #9ca3af; }
.status-select.open .chev { border-top-color: transparent; border-bottom:6px solid #9ca3af; }
.status-menu { position:absolute; top:44px; left:0; z-index:1000; background:#fff; border:1px solid #e5e7eb; border-radius:12px; box-shadow: var(--shadow); padding:6px; width:100%; display:none; }
.status-select.open .status-menu { display:block; }
.status-option { display:flex; align-items:center; gap:10px; padding:10px 12px; border-radius:10px; cursor:pointer; }
.status-option:hover { background:#FFF8EF; color:#E56D00; }
.status-option.selected { background:#FFE8D6; color:#fe6027; }
.status-option .check { opacity:0; color:#fe6027; font-weight:600; width:14px; text-align:center; }
.status-option.selected .check { opacity:1; }

/* Generische Dots für Status */
.dot { width:10px; height:10px; border-radius:9999px; display:inline-block; }
.dot-green { background:#10b981; }
.dot-yellow { background:#f59e0b; }
.dot-gray { background:#9ca3af; }
.dot-red { background:#ef4444; }

/* Plananalyse – Details */
.plan-details { display:none; margin-top:12px; padding:8px 0 0 0; border:none; background:transparent; grid-column: 1 / -1; }
.plan-item.open .plan-details { display:block; }
.plan-grid { display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:16px; align-items:start; }
@media (max-width: 1000px) { .plan-grid { grid-template-columns: 1fr; } }
.plan-col .section-caption { color: var(--muted); font-weight:600; letter-spacing:.02em; margin-bottom:8px; text-transform: uppercase; font-size:12px; }
/* Mehr Luft, wenn nach einer Zweispalten-Zeile ein einzelnes Feld folgt (z. B. Plangrösse/Format) */
.plan-col .row + .form-section { margin-top: 12px; }

/* Chevron drehen, wenn geöffnet */
.plan-item .icon-btn.chev svg { transition: transform .15s ease; }
.plan-item.open .icon-btn.chev svg { transform: rotate(180deg); }

/* Massstabsprüfung Styles */
.scale-result {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  font-size: 13px;
}
.scale-result strong {
  font-weight: 600;
}
.status-ok { color: var(--success); }
.status-warn { color: var(--warning); }
.status-error { color: var(--danger); }
.download-link {
  display: inline-block;
  margin-top: 6px;
  padding: 6px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.download-link:hover {
  background: #f3f4f6;
  border-color: var(--accent);
}

/* Geprüfter Plan herunterladen Button */
.download-plan-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding: 12px 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  transition: background .15s, border-color .15s, box-shadow .15s;
  cursor: pointer;
}
.download-plan-btn:hover {
  background: #f9fafb;
  border-color: #c5ccd3;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  text-decoration: none;
}
.download-plan-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Verantwortliche – Unterschrift-Popover */
.responsible-section {
  position: relative;
  padding-bottom: 6px;
}
.responsible-section .form-input {
  position: relative;
  z-index: 1;
}
.responsible-section::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: transparent;
  transition: background-color .15s ease, opacity .15s ease;
  opacity: 0.3;
}
.responsible-section.signature-ok::after {
  background: #10b981; /* grün */
  opacity: 1;
}
.responsible-section.signature-missing::after {
  background: #ef4444; /* rot */
  opacity: 0.8;
}

.signature-popover {
  position: absolute;
  z-index: 1200;
  min-width: 260px;
  max-width: 320px;
  padding: 14px 16px 12px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(148, 163, 184, 0.5);
  transform: translateY(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
}
.signature-popover.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
.signature-popover-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}
.signature-popover-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff3e8;
  color: #fe6027;
  font-size: 11px;
}
.signature-popover-title {
  letter-spacing: .01em;
}
.signature-popover-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.signature-preview {
  width: 100%;
  height: 120px;
  border-radius: 12px;
  background: #f3f4f6;
  border: 1px dashed #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.signature-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.signature-preview-placeholder {
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
  padding: 0 8px;
}
.signature-name {
  font-size: 13px;
  color: #4b5563;
  margin-top: 4px;
}

