/* ==========================================================================
   Apoidea Dienstbesprechung – Corporate Identity
   Farben und Formensprache wie im Portfolio-Generator / der Turnhallen-App.
   ========================================================================== */

:root {
  /* Apoidea CI */
  --teal: #2BBCB4;
  --teal-dark: #1FA8A1;
  --teal-light: #40D0C8;
  --yellow: #E9A825;
  --yellow-light: #F5BE4D;
  --yellow-soft: #FFF7E2;
  --navy: #1B5E7A;
  --skyblue: #A8D8D8;
  --peach: #FAAA8D;
  --olive: #9AAF4F;
  --pink: #E95C94;

  /* UI */
  --bg-main: #F0F8F8;
  --bg-card: #FFFFFF;
  --bg-elevated: #F0F8F8;
  --border: #D0E8E8;
  --border-strong: #A8D8D8;
  --text: #2C3E50;
  --text-muted: #7A9A9A;
  --text-subtle: #A6BEBE;
  --danger: #E95C94;
  --success: #9AAF4F;

  --shadow-sm: 0 2px 6px rgba(27, 94, 122, 0.06);
  --shadow: 0 8px 24px rgba(27, 94, 122, 0.10);
  --shadow-lg: 0 18px 40px rgba(27, 94, 122, 0.16);

  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 8px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-main);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.layout { display: flex; min-height: 100%; }

/* --- Anmeldung ------------------------------------------------------------*/
.login-screen {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
}
.login-screen.hidden { display: none !important; }
.login-card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 34px 30px; width: 100%; max-width: 360px; text-align: center;
  display: flex; flex-direction: column; gap: 12px;
}
.login-logo { width: 84px; height: 84px; margin: 0 auto 4px; }
.login-card h1 { font-size: 21px; font-weight: 800; color: var(--navy); }
.login-sub { font-size: 13.5px; color: var(--text-muted); font-weight: 600; margin-bottom: 4px; }
.login-card .btn { margin-top: 4px; }
.login-error {
  background: #FDE9F0; color: #B8376A; font-size: 13px; font-weight: 700;
  padding: 9px 12px; border-radius: var(--radius-xs);
}

.logout-btn {
  background: rgba(255,255,255,0.18); border: none; color: #fff; cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 700;
  padding: 7px 12px; border-radius: var(--radius-xs); margin-top: 10px; z-index: 1;
}
.logout-btn:hover { background: rgba(255,255,255,0.3); }

/* --- Sidebar --------------------------------------------------------------*/
.sidebar {
  width: 280px; min-width: 280px;
  background: linear-gradient(180deg, var(--teal) 0%, var(--teal-dark) 100%);
  color: #fff;
  display: flex; flex-direction: column;
  padding: 20px 16px;
  position: relative; overflow: hidden;
}
/* Wolken-Dekoration wie in den anderen Apoidea-Apps */
.sidebar::after {
  content: ''; position: absolute; left: -20px; right: -20px; bottom: -30px; height: 120px;
  background:
    radial-gradient(circle at 20% 100%, rgba(255,255,255,0.16) 42px, transparent 43px),
    radial-gradient(circle at 48% 100%, rgba(255,255,255,0.16) 56px, transparent 57px),
    radial-gradient(circle at 80% 100%, rgba(255,255,255,0.16) 38px, transparent 39px);
  pointer-events: none;
}

.sidebar-head { display: flex; align-items: center; gap: 12px; padding-bottom: 18px; border-bottom: 1px solid rgba(255,255,255,0.22); }
.sidebar-logo { width: 52px; height: 52px; background: #fff; border-radius: 14px; padding: 3px; box-shadow: var(--shadow-sm); }
.sidebar-brand { display: flex; flex-direction: column; line-height: 1.2; }
.sidebar-brand strong { font-size: 19px; font-weight: 800; letter-spacing: 0.01em; }
.sidebar-brand span { font-size: 12.5px; opacity: 0.9; font-weight: 600; }

.sidebar-section { display: flex; align-items: center; justify-content: space-between; margin: 18px 4px 10px; }
.sidebar-title { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.85; }

.icon-btn {
  background: rgba(255,255,255,0.18); border: none; color: inherit; cursor: pointer;
  width: 30px; height: 30px; border-radius: 9px; font-size: 16px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center; transition: background 0.2s ease;
}
.icon-btn:hover { background: rgba(255,255,255,0.32); }

.history-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; z-index: 1; }
.history-item {
  background: rgba(255,255,255,0.14); border-radius: var(--radius-sm); padding: 10px 30px 10px 12px;
  cursor: pointer; position: relative; transition: background 0.2s ease;
}
.history-item:hover { background: rgba(255,255,255,0.26); }
.history-item.active { background: #fff; color: var(--navy); box-shadow: var(--shadow-sm); }
.hi-title { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hi-date { font-size: 11px; opacity: 0.8; }
.hi-del {
  position: absolute; right: 6px; top: 8px; background: none; border: none; color: inherit;
  opacity: 0.55; cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 5px; border-radius: 6px;
}
.hi-del:hover { opacity: 1; background: rgba(0,0,0,0.12); }
.history-empty { font-size: 13px; opacity: 0.8; padding: 8px 4px; }
.sidebar-note { font-size: 11px; opacity: 0.85; margin-top: 14px; line-height: 1.45; z-index: 1; }

/* --- Hauptbereich ---------------------------------------------------------*/
.app { flex: 1; padding: 32px 40px 40px; display: flex; flex-direction: column; gap: 22px; max-width: 1000px; margin: 0 auto; width: 100%; }

.header .logo { display: flex; align-items: center; gap: 14px; }
.header h1 { font-size: 27px; font-weight: 800; color: var(--navy); line-height: 1.2; }
.subtitle { color: var(--text-muted); font-size: 14px; font-weight: 600; margin-top: 2px; }
.header .icon-btn { background: var(--teal); }

.card {
  background: var(--bg-card); border-radius: var(--radius); padding: 26px;
  box-shadow: var(--shadow); border: 1px solid var(--border);
}

.step-label { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 16px; color: var(--navy); margin-bottom: 18px; }
.step-num {
  width: 27px; height: 27px; border-radius: 50%; background: var(--yellow); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800;
  box-shadow: 0 2px 6px rgba(233, 168, 37, 0.4);
}

/* --- Tabs -----------------------------------------------------------------*/
.tabs { display: flex; gap: 8px; background: var(--bg-elevated); padding: 5px; border-radius: 14px; margin-bottom: 20px; }
.tab {
  flex: 1; background: none; border: none; font-family: inherit; font-size: 14.5px; font-weight: 700;
  color: var(--text-muted); padding: 10px; border-radius: 10px; cursor: pointer; transition: all 0.2s ease;
}
.tab:hover { color: var(--teal-dark); }
.tab.active { background: #fff; color: var(--navy); box-shadow: var(--shadow-sm); }

/* --- Recorder -------------------------------------------------------------*/
.recorder { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px 0 8px; }
.record-btn {
  width: 78px; height: 78px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 22px rgba(43, 188, 180, 0.42); transition: transform 0.2s ease;
}
.record-btn:hover { transform: scale(1.05); }
.record-dot { width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: all 0.2s ease; }
.record-btn.recording { background: linear-gradient(135deg, var(--pink) 0%, #C7457A 100%); box-shadow: 0 8px 22px rgba(233, 92, 148, 0.45); animation: pulse 1.6s infinite; }
.record-btn.recording .record-dot { border-radius: 6px; width: 22px; height: 22px; }
@keyframes pulse { 0%,100% { box-shadow: 0 8px 22px rgba(233,92,148,0.45); } 50% { box-shadow: 0 8px 34px rgba(233,92,148,0.7); } }

.recorder-info { display: flex; flex-direction: column; align-items: center; }
.record-time { font-size: 26px; font-weight: 800; color: var(--navy); font-variant-numeric: tabular-nums; }
.record-hint { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.visualizer { width: 240px; height: 48px; }

/* --- Dropzone -------------------------------------------------------------*/
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 34px 20px;
  text-align: center; cursor: pointer; transition: all 0.2s ease; background: var(--bg-elevated);
}
.dropzone:hover, .dropzone.dragover { border-color: var(--teal); background: #E6F6F5; }
.dropzone.has-file { padding: 16px; cursor: default; }
.dropzone-icon { width: 42px; height: 42px; color: var(--teal); margin-bottom: 10px; }
.dropzone-title { font-weight: 800; font-size: 15.5px; color: var(--navy); }
.dropzone-hint { font-size: 13.5px; color: var(--text-muted); margin-top: 3px; font-weight: 600; }
.dropzone-formats { font-size: 12px; color: var(--text-subtle); margin-top: 8px; font-weight: 600; }
.dropzone.has-file .dropzone-content { display: none; }

.file-preview { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; }
.file-info { display: flex; align-items: center; gap: 12px; min-width: 0; }
.file-icon { font-size: 22px; }
.file-meta { display: flex; flex-direction: column; min-width: 0; text-align: left; }
.file-name { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-size { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.remove-btn { background: none; border: none; color: var(--text-muted); font-size: 21px; cursor: pointer; line-height: 1; padding: 0 5px; border-radius: 6px; }
.remove-btn:hover { color: var(--danger); background: var(--bg-elevated); }

/* --- Formularfelder -------------------------------------------------------*/
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 20px; margin-top: 18px; }
.control-group { display: flex; flex-direction: column; gap: 6px; }
.control-group.full { grid-column: 1 / -1; margin-top: 4px; }
.control-label { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.optional { text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--text-subtle); }
.field-hint { font-size: 11.5px; color: var(--text-subtle); font-weight: 600; }

.input, .select {
  font-family: inherit; font-size: 14.5px; color: var(--text); background: #fff;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); padding: 10px 13px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease; width: 100%;
}
.input:focus, .select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(43,188,180,0.16); }
.input::placeholder { color: var(--text-subtle); }
textarea.input { resize: vertical; line-height: 1.5; }
.select { cursor: pointer; }
.input-num { width: 66px; padding: 5px 8px; font-size: 13px; }

/* Toggle */
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; }
.toggle input { display: none; }
.toggle-track { width: 42px; height: 24px; border-radius: 12px; background: var(--border-strong); position: relative; transition: background 0.2s ease; flex-shrink: 0; }
.toggle-thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.2s ease; box-shadow: var(--shadow-sm); }
.toggle input:checked + .toggle-track { background: var(--teal); }
.toggle input:checked + .toggle-track .toggle-thumb { transform: translateX(18px); }
.toggle-label { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.badge { font-size: 9.5px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; background: var(--yellow-soft); color: #9A6B10; padding: 3px 7px; border-radius: 6px; }

/* --- Tagesordnung vom DB-Plan ---------------------------------------------*/
.agenda-box {
  margin-top: 20px; padding: 16px; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  display: flex; flex-direction: column; gap: 10px;
}
.agenda-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.agenda-actions { display: flex; align-items: center; gap: 8px; }
.agenda-preview { display: flex; gap: 10px; flex-wrap: wrap; }
.agenda-preview img {
  max-height: 150px; border-radius: var(--radius-xs);
  border: 1px solid var(--border-strong); background: #fff;
}
.agenda-status { font-size: 12.5px; font-weight: 700; padding: 8px 12px; border-radius: var(--radius-xs); }
.agenda-status.info { background: #E6F6F5; color: var(--teal-dark); }
.agenda-status.error { background: #FDE9F0; color: #B8376A; }

/* --- Buttons --------------------------------------------------------------*/
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: inherit; font-size: 14.5px; font-weight: 800; cursor: pointer;
  border: 1.5px solid transparent; border-radius: 13px; padding: 11px 20px; transition: all 0.2s ease;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.block { width: 100%; margin-top: 22px; padding: 14px; font-size: 16px; }
.btn-primary { background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%); color: #fff; box-shadow: 0 4px 12px rgba(43,188,180,0.32); }
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 7px 18px rgba(43,188,180,0.42); }
.btn-secondary { background: #fff; color: var(--navy); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { border-color: var(--teal); color: var(--teal-dark); background: var(--bg-elevated); }
.btn.success { background: var(--olive); color: #fff; border-color: var(--olive); }
.btn-sm { padding: 7px 14px; font-size: 13px; }

.spinner { width: 15px; height: 15px; border: 2.5px solid rgba(255,255,255,0.35); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
.btn-secondary .spinner { border-color: rgba(43,188,180,0.3); border-top-color: var(--teal); }
@keyframes spin { to { transform: rotate(360deg); } }

.link-btn { background: none; border: none; color: var(--teal-dark); cursor: pointer; font-family: inherit; font-weight: 800; font-size: 13.5px; padding: 0; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--navy); }

/* --- Status ---------------------------------------------------------------*/
.status { margin-top: 16px; padding: 12px 15px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 700; }
.status.info { background: #E6F6F5; color: var(--teal-dark); }
.status.error { background: #FDE9F0; color: #B8376A; }

/* --- Ergebnis-Bereiche ----------------------------------------------------*/
.result-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.result-header .step-label { margin-bottom: 0; }
.result-meta { font-size: 12.5px; color: var(--text-muted); font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }


.result-text {
  width: 100%; min-height: 230px; max-height: 440px; font-family: inherit; font-size: 14.5px; line-height: 1.65;
  color: var(--text); background: var(--bg-elevated); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 15px; resize: vertical;
}
.result-text:focus { outline: none; border-color: var(--teal); }

.result-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; align-items: center; }
.export-actions { padding-top: 18px; border-top: 1px solid var(--border); }
.export-label { font-size: 13px; font-weight: 800; color: var(--text-muted); margin-right: 4px; }
.sig-extra { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--text-muted); margin-left: auto; }
.footnote { font-size: 12px; color: var(--text-subtle); font-weight: 600; margin-top: 12px; }

.hints-box { display: flex; flex-direction: column; gap: 12px; padding: 18px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 20px; }
.hints-box .form-grid { margin-top: 0; }
.hints-title { font-size: 13px; font-weight: 800; color: var(--navy); }

/* ==========================================================================
   Protokoll – bewusst wie ein gesetztes Word-Dokument: schwarz-weiß, keine
   Markenfarben. Einzige Ausnahme ist das Logo im Briefkopf.
   ========================================================================== */
.protocol-view {
  --doc-text: #000;
  --doc-soft: #333;
  --doc-muted: #595959;
  --doc-rule: #000;
  --doc-rule-light: #bfbfbf;
  --doc-shade: #f2f2f2;
  color: var(--doc-text);
  padding-top: 4px;
}

.p-doc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.p-title { font-size: 24px; font-weight: 700; color: var(--doc-text); line-height: 1.15; letter-spacing: -0.01em; }
.p-logo { width: 72px; height: 72px; flex-shrink: 0; }
.p-doc-rule { border-top: 2px solid var(--doc-rule); border-bottom: 1px solid var(--doc-rule); height: 3px; margin-top: 10px; }

.p-fields { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 16px 0 4px; font-size: 14.5px; }
.p-fields dt { font-weight: 700; color: var(--doc-text); }
.p-fields dd { color: var(--doc-text); }

.protocol-view section { margin-top: 24px; }
.protocol-view h3 {
  font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--doc-text); padding-bottom: 5px; border-bottom: 1px solid var(--doc-rule); margin-bottom: 12px;
}
.protocol-view p { font-size: 14.5px; }
.protocol-view ul { list-style: none; padding: 0; }
.protocol-view li { position: relative; padding-left: 19px; margin-bottom: 5px; font-size: 14.5px; }
.protocol-view li::before { content: '•'; position: absolute; left: 5px; color: var(--doc-text); }

/* Namen als Fließtext – wie man es in Word schreiben würde */
.p-names { font-size: 14.5px; }
.p-name + .p-name::before { content: ', '; }

/* TOPs */
.p-top { margin-bottom: 18px; }
.p-top + .p-top { border-top: 1px solid var(--doc-rule-light); padding-top: 18px; margin-top: 22px; }
.p-top-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.p-top-num { font-size: 15px; font-weight: 700; color: var(--doc-text); white-space: nowrap; }
.p-top-title { font-size: 15px; font-weight: 700; color: var(--doc-text); }

.p-agree {
  background: var(--doc-shade); border: 1px solid var(--doc-rule-light);
  padding: 10px 14px; margin: 10px 0 0 19px;
}
.p-agree-label { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--doc-text); display: block; margin-bottom: 3px; }
.p-agree-text { font-size: 14.5px; }
.p-agree-meta { font-size: 13px; font-weight: 700; color: var(--doc-text); margin-top: 6px; display: flex; gap: 18px; flex-wrap: wrap; }

/* Aufgaben-Tabelle */
.todo-table { width: 100%; border-collapse: collapse; }
.todo-table th, .todo-table td { text-align: left; padding: 8px 10px; font-size: 13.5px; border-bottom: 1px solid var(--doc-rule-light); vertical-align: top; }
.todo-table th { text-transform: uppercase; font-size: 10.5px; letter-spacing: 0.05em; background: var(--doc-shade); font-weight: 700; color: var(--doc-text); }
.todo-table td:first-child { width: 56%; }

/* Fuß der Vorlage */
.p-consent { border: 1px solid var(--doc-rule); padding: 14px 17px; margin-top: 32px; font-size: 14.5px; font-weight: 700; color: var(--doc-text); }
.p-signatures { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 30px; margin-top: 22px; }
.p-sig { break-inside: avoid; }
.p-sig-x { font-size: 19px; line-height: 1; color: var(--doc-text); }
.p-sig-line { border-bottom: 1px solid var(--doc-rule); margin-top: 2px; }
.p-sig-label { font-size: 10.5px; color: var(--doc-muted); margin-top: 4px; }

/* Hinweis auf die KI-Erstellung – gehört zur App, nicht ins Dokument.
   Steht deshalb außerhalb von .protocol-view und wird beim Drucken ausgeblendet. */
.ki-banner {
  display: flex; align-items: flex-start; gap: 11px;
  background: var(--yellow-soft); border: 1.5px solid var(--yellow);
  border-radius: var(--radius-sm); padding: 12px 15px; margin-bottom: 18px;
  font-size: 13px; line-height: 1.5; color: #7A5B12; font-weight: 600;
}
.ki-banner-icon { font-size: 16px; line-height: 1.3; }
.ki-banner strong {
  display: block; font-size: 13px; font-weight: 800; color: #8A6410; margin-bottom: 2px;
}

/* --- Bearbeitungsmodus ----------------------------------------------------*/
.edit-note {
  font-size: 12.5px; color: #7A5B12; background: var(--yellow-soft);
  border: 1px solid var(--yellow); border-radius: var(--radius-sm);
  padding: 9px 13px; margin-bottom: 18px; line-height: 1.5; font-weight: 600;
}
.edit-note b { color: var(--navy); }

.ed { display: inline; white-space: pre-wrap; }
.ed.editing {
  display: inline-block; min-width: 46px; border-radius: 7px; padding: 1px 6px; margin: -1px -3px;
  border: 1px dashed var(--border-strong); cursor: text; transition: all 0.15s ease;
}
.ed.editing:hover { background: var(--bg-elevated); }
.ed.editing:focus { outline: none; border-style: solid; border-color: #666; background: #fff; box-shadow: 0 0 0 3px rgba(0,0,0,0.07); }
.ed.editing:empty::before,
.ed.editing:has(br:only-child)::before { content: attr(data-ph); color: var(--text-subtle); font-weight: 600; }

.protocol-view.editing .p-title .ed.editing,
.protocol-view.editing p .ed.editing,
.protocol-view.editing li .ed.editing,
.protocol-view.editing .p-agree-text .ed.editing { display: block; }
.protocol-view.editing .p-fields dd .ed.editing { display: block; min-width: 180px; }
.protocol-view.editing .p-name + .p-name::before { content: ''; }
.protocol-view.editing .todo-table .ed.editing { display: block; min-width: 0; }
.protocol-view.editing li { display: flex; align-items: flex-start; gap: 5px; }
.protocol-view.editing li .ed.editing { flex: 1; }
.protocol-view.editing .p-top-title { flex: 1; }

.ed-del {
  background: none; border: none; color: var(--text-subtle); cursor: pointer;
  font-size: 16px; line-height: 1; padding: 0 5px; border-radius: 5px; flex-shrink: 0;
}
.ed-del:hover { color: var(--danger); background: var(--bg-elevated); }
.todo-table .td-del { width: 1%; }

.ed-add {
  margin-top: 9px; background: #fff; border: 1.5px dashed var(--border-strong); color: var(--text-muted);
  border-radius: 20px; padding: 4px 14px; font-size: 12px; font-weight: 800; cursor: pointer; font-family: inherit;
}
.ed-add:hover { color: var(--teal-dark); border-color: var(--teal); background: var(--bg-elevated); }

.footer { text-align: center; color: var(--text-subtle); font-size: 11.5px; font-weight: 600; margin-top: auto; padding-top: 14px; }
.hidden { display: none !important; }
.mobile-only { display: none; }

/* --- Druck: nur das Protokoll ---------------------------------------------*/
@media print {
  @page { size: A4; margin: 14mm 15mm; }
  body { background: #fff; }
  .sidebar, .header, .footer, #inputCard, #transcriptCard,
  .result-header, .export-actions, .hints-box, .edit-note, .ki-banner,
  .ed-add, .ed-del { display: none !important; }
  .layout, .app { display: block; padding: 0; margin: 0; max-width: none; }
  .card { background: #fff; border: none; box-shadow: none; padding: 0; border-radius: 0; }
  .protocol-view { font-size: 11pt; }
  .ed.editing { border: none; padding: 0; margin: 0; background: none; box-shadow: none; }
  .protocol-view section, .p-top, .p-sig, .todo-table tr { break-inside: avoid; }
  .p-consent { break-inside: avoid; }
  .p-signatures { gap: 16px 26px; }
}

/* --- Responsive -----------------------------------------------------------*/
@media (max-width: 900px) {
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 30; transform: translateX(-100%);
    transition: transform 0.25s ease; box-shadow: var(--shadow-lg);
  }
  .sidebar.open { transform: translateX(0); }
  .mobile-only { display: inline-flex; }
  .app { padding: 22px 16px 32px; }
}
@media (max-width: 620px) {
  .header h1 { font-size: 21px; }
  .form-grid, .p-signatures { grid-template-columns: 1fr; }
  .controls { flex-direction: column; align-items: stretch; }
  .p-fields { grid-template-columns: 1fr; gap: 2px; }
  .p-fields dt { margin-top: 8px; }
  .sig-extra { margin-left: 0; }
}
