:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --line: #d7deea;
  --border: var(--line);
  --text: #183046;
  --muted: #5f7285;
  --accent: #0b7a55;
  --accent-soft: #e8f5ef;
  --danger: #b91c1c;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, sans-serif; background: var(--bg); color: var(--text); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 20px; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar h1 { font-size:1.35rem; }
.topbar p { margin:4px 0 0; font-size:.86rem; }
h1, h2, h3 { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.badge { background: var(--accent-soft); color: var(--accent); border: 1px solid #c6e8d6; padding: 6px 10px; border-radius: 999px; }
.layout { padding: 16px 20px 20px; display: grid; grid-template-columns: minmax(0, 2fr) minmax(340px, 1fr); gap: 16px; }
.organs-grid { display: grid; gap: 14px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: 0 4px 14px rgba(15, 23, 42, 0.045); }
.card-head, .section-row { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.organ-text, .section-text, .organ-addendum, .section-addendum { width: 100%; min-height: 78px; margin-top: 10px; padding: 10px 11px; border-radius: 10px; border: 1px solid var(--line); resize: vertical; font: inherit; background: #fff; overflow-y:auto; }
.section-text, .section-addendum { min-height: 74px; }
.organ-addendum { min-height: 70px; }
.generated-text[readonly] { cursor:default; background:#f8fafc; }
.editable-generated-text { background:#fff; border-color:#c9d4df; }
.editable-generated-text:hover { border-color:#9db0c2; }
.sections-card { display: grid; gap: 12px; height: fit-content; position: sticky; top: 62px; max-height: calc(100vh - 74px); overflow-y: auto; }
button { border: none; border-radius: 12px; padding: 10px 14px; background: var(--accent); color: white; font-weight: bold; cursor: pointer; }
button.secondary { background: #eef2f7; color: var(--text); }
.button-link { display:inline-flex; align-items:center; justify-content:center; border-radius:12px; padding:10px 14px; background:var(--accent); color:white; font-weight:bold; text-decoration:none; }
.button-link.secondary { background:#eef2f7; color:var(--text); }
button:disabled { cursor: not-allowed; opacity: 0.48; }
.small-btn { padding: 8px 12px; font-size: 12px; }
button:hover { opacity: 0.95; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.toolbar { display: flex; gap: 10px; justify-content: flex-end; align-items:center; }
.context-menu { position: fixed; width: min(390px, calc(100vw - 16px)); min-width: 240px; background: white; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 24px rgba(15, 23, 42, 0.18); padding: 8px; z-index: 50; }
.context-menu button { width: 100%; background: transparent; color: var(--text); text-align: left; padding: 10px 12px; border-radius: 8px; }
.context-menu button:hover { background: #f3f6fb; }
.hidden { display: none !important; }
.modal { position: fixed; inset: 0; background: rgba(7, 18, 31, 0.45); display: grid; place-items: center; z-index: 60; }
.modal-panel { width: min(780px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow: auto; background: white; border-radius: 18px; padding: 18px; box-shadow: 0 20px 50px rgba(15, 23, 42, 0.3); }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.icon-btn { background: transparent; color: var(--text); font-size: 24px; padding: 4px 8px; }
.wizard-footer { display: flex; justify-content: flex-end; gap: 10px; margin: 18px -18px -2px; padding: 12px 18px; position: sticky; bottom: -18px; background: rgba(255,255,255,.96); border-top: 1px solid var(--line); backdrop-filter: blur(6px); z-index: 2; }
.choice-list { display: grid; gap: 8px; }
.choice-btn { width: 100%; text-align: left; background: #f6f8fb; color: var(--text); border: 1px solid var(--line); line-height: 1.35; white-space: normal; }
.choice-btn.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.field-block { display: grid; gap: 10px; }
.field-block label { font-weight: bold; }
.field-block input[type='text'], .field-block textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.field-block textarea { min-height: 80px; resize: vertical; }
.polyp-location-distance { display:grid; grid-template-columns:minmax(0, 1fr) minmax(120px, 180px) auto; gap:8px; align-items:center; padding:10px; border:1px solid var(--line); border-radius:10px; background:#fafcff; }
.polyp-location-distance label { font-size:13px; }
.polyp-location-distance input { width:100%; padding:9px 10px; border:1px solid var(--line); border-radius:8px; font:inherit; }
.polyp-location-distance span { color:var(--muted); font-size:13px; white-space:nowrap; }
.polyp-location-tiles { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:8px; }
.polyp-location-tiles > span { grid-column:1 / -1; color:var(--muted); font-size:12px; font-weight:bold; }
.polyp-location-tile { min-height:44px; }
.polyp-location-tile.active { background:var(--accent-soft); border:1px solid var(--accent); color:var(--accent); }
@media (max-width: 560px) { .polyp-location-distance { grid-template-columns:1fr auto; } .polyp-location-distance label { grid-column:1 / -1; } .polyp-location-tiles { grid-template-columns:1fr; } }
.login-body { display: grid; place-items: center; min-height: 100vh; }
.login-card { background: white; border: 1px solid var(--line); border-radius: 18px; padding: 28px; width: min(420px, calc(100vw - 32px)); box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12); }
.stack { display: grid; gap: 14px; }
.stack input { width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.alert { color: var(--danger); background: #fee2e2; border: 1px solid #fecaca; padding: 10px 12px; border-radius: 10px; margin: 12px 0; }
.notice { color:#075d42; background:var(--accent-soft); border:1px solid #c6e8d6; padding:10px 12px; border-radius:10px; }
@media (max-width: 1100px) {
  .layout { grid-template-columns: 1fr; }
  .sections-card { position: static; max-height: none; overflow: visible; }
}

.generated-text { background: #f8fafc; }
.sub-label { display:block; margin-top: 10px; font-size: 12px; color: var(--muted); font-weight: bold; }

.tabs { display: flex; gap: 10px; padding: 16px 20px 0; }
.tab-btn { background: #eef2f7; color: var(--text); border: 1px solid var(--line); }
.tab-btn.active { background: var(--accent); color: white; border-color: var(--accent); }
#koloskopie-text { min-height: 300px; }
#koloskopie-setup-text { min-height: 120px; }
#dru-text, #proktoskopie-text, #terminal-ileum-text { min-height: 120px; }

.kolo-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.compact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 12px; }
.compact-grid label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.compact-grid select { border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; font: inherit; }
.field-hint { color: var(--muted); font-size: 11px; font-weight: 500; line-height: 1.35; }
.bbps-hint { margin: 0 0 4px; }
.bbps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 10px 0 12px; }
.bbps-group { border: 1px solid var(--border); border-radius: 12px; padding: 10px; background: #fafafa; }
.bbps-group strong { display: block; margin-bottom: 6px; }
.bbps-group label { margin-right: 10px; white-space: nowrap; }
.bbps-group:focus, .bbps-group:focus-within { outline: 3px solid rgba(11, 122, 85, 0.28); outline-offset: 2px; border-color: var(--accent); background: var(--accent-soft); }

button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid rgba(11, 122, 85, 0.28); outline-offset: 2px; }
#wizard-title { line-height: 1.25; }
#wizard-step-container { min-height: 120px; }
@media (max-height: 720px) { .modal { place-items: start center; padding-top: 12px; } .modal-panel { max-height: calc(100vh - 24px); } }

.app-version { text-align:center; padding: 10px 16px 18px; font-size: 0.78rem; opacity: .62; }

/* v22.11: interval control lives with the recommendation heading. */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.section-head h2 { margin-bottom: 0; }


/* v22.14: compact action clusters and denser, more ergonomic context menus. */
.card-head { align-items: center; }
.card-actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.section-actions { display:flex; gap:8px; flex-wrap:wrap; justify-content:flex-end; }
.context-menu { max-height: min(72vh, 620px); overflow-y: auto; min-width: min(300px, calc(100vw - 16px)); }
.context-menu button { border: 1px solid transparent; }
.context-menu button:hover, .context-menu button:focus-visible { background: var(--accent-soft); border-color: #c6e8d6; color: #075d42; opacity: 1; }
.card-head .small-btn, .section-actions .small-btn { white-space: nowrap; }
@media (max-width: 700px) { .section-head { align-items:flex-start; flex-direction:column; } .section-actions { width:100%; justify-content:flex-start; } }

/* v22.19: high-throughput handling, reversible actions and compact secondary fields. */
.workflow-bar { grid-column: 1 / -1; display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.kolo-workflow-bar { justify-content:flex-end; }
.addendum-disclosure { margin-top:10px; }
.addendum-disclosure summary { color:var(--muted); font-size:12px; font-weight:bold; cursor:pointer; user-select:none; width:max-content; }
.addendum-disclosure[open] summary { color:var(--accent); }
.addendum-disclosure .organ-addendum, .addendum-disclosure .section-addendum { min-height:76px; margin-top:8px; }

.wizard-history-section { border-bottom:1px solid var(--line); padding-bottom:14px; }
.missing-required { background:#fff3cd !important; border-color:#e0a800 !important; box-shadow:0 0 0 2px rgba(224,168,0,.12); }
.missing-required input, .missing-required select, .missing-required textarea { border-color:#c58d00; background:#fffdf5; }
.signature-toggle { margin-right:auto; white-space:nowrap; }
.profile-panel { max-width:620px; }
.profile-fields { display:grid; gap:12px; padding:4px 0 18px; }
.profile-fields label { display:grid; gap:6px; font-weight:650; }
.profile-fields textarea { min-height:100px; resize:vertical; }
.profile-copy-headings { border:1px solid var(--line); border-radius:10px; padding:8px 10px; }
.profile-copy-headings summary { cursor:pointer; font-weight:650; }
.profile-copy-headings .profile-toggle-row { margin-top:10px; }
.kolo-histology-panel { margin-top:12px; display:grid; gap:9px; }
.wizard-history { display:grid; gap:7px; margin-top:10px; }
.history-item { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:8px; padding:8px 10px; border:1px solid var(--line); border-radius:10px; background:#f8fafc; }
.history-main { min-width:0; }
.history-main strong, .history-main span { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.history-main span { color:var(--muted); font-size:11px; margin-top:2px; }
.history-actions { display:flex; gap:5px; }
.history-actions button { padding:5px 8px; font-size:11px; }
.history-actions .delete-run { color:var(--danger); }

.context-menu-head { position:sticky; top:-8px; background:white; z-index:2; padding:8px 6px 7px; border-bottom:1px solid var(--line); margin-bottom:4px; }
.context-menu-title { display:flex; justify-content:space-between; align-items:center; gap:8px; flex-wrap:wrap; font-weight:bold; }
.context-menu-query { min-height:18px; margin-top:4px; color:var(--accent); font-size:12px; }
.menu-hotkey { display:inline-grid; place-items:center; min-width:22px; height:22px; margin-right:7px; border:1px solid var(--line); border-radius:6px; color:var(--muted); font-size:11px; }
.context-menu button.menu-active { background:var(--accent-soft); border-color:#c6e8d6; color:#075d42; }
.context-menu-more { margin-top:6px; border-top:1px solid var(--line) !important; color:var(--accent) !important; font-weight:700; }
.context-menu-search { width:100%; margin-top:8px; padding:10px; border:1px solid var(--line); border-radius:8px; font:inherit; background:#fff; color:var(--text); }
.context-menu-results { min-width:0; }

.wizard-quick-options { display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-top:12px; padding:9px 11px; border:1px solid var(--line); border-radius:10px; background:#f8fafc; }
.wizard-quick-options.hidden { display:none; }
.wizard-quick-option { display:flex; align-items:center; gap:7px; margin:0; font-size:13px; font-weight:650; }
.wizard-status-control { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.wizard-status-control > span { color:var(--muted); font-size:12px; font-weight:700; }
.wizard-status-control button { padding:5px 8px; font-size:11px; background:white; color:var(--text); border:1px solid var(--line); }
.wizard-status-control button.active { background:var(--accent); color:white; border-color:var(--accent); }

.wizard-preview { margin-top:14px; padding:10px 12px; border:1px solid #c6e8d6; border-radius:12px; background:var(--accent-soft); }
.wizard-preview summary { color:#075d42; font-weight:bold; cursor:pointer; }
.wizard-preview-summary { margin-left:6px; }
.wizard-preview-content { display:grid; gap:8px; margin-top:10px; }
.wizard-preview-content > div { display:grid; grid-template-columns:90px 1fr; gap:8px; align-items:start; }
.wizard-preview span { color:#075d42; font-size:12px; font-weight:bold; }
.wizard-preview p { margin:0; font-size:13px; white-space:pre-wrap; }

.toast { position:fixed; right:18px; bottom:18px; z-index:100; display:flex; align-items:center; gap:12px; max-width:min(520px, calc(100vw - 36px)); padding:11px 14px; border-radius:12px; color:white; background:#183046; box-shadow:0 12px 28px rgba(15,23,42,.28); }
.toast button { padding:6px 9px; background:white; color:#183046; font-size:12px; }

/* v22.22: Sedierungsdokumentation und kompakte Abrechnungsvorschläge. */
/* v22.23: OPS-Vorschläge für die Koloskopie und Word-Export. */
/* v22.24: Praxisformat für Word-Exporte und OPS-Vorschläge für die ÖGD. */
/* v22.25: Strukturierter Organexport und exklusive Histologie-Ortsauswahl. */
/* v22.27: kompakter Workflow, Messwertmodus, Statusprüfung und klinische Fokusführung. */
/* v22.28: klinische Wizardtexte bleiben für schnelle Nuancenkorrekturen direkt editierbar. */
/* v22.29: fehlende Kerndokumentation wird bis zur Eingabe dezent markiert. */
/* v22.30: sichere Einladungskonten, Profil und exportierte Unterschriftenzeile. */
.needs-input { border-color:#e5a72b !important; background:#fff8e8 !important; box-shadow:0 0 0 2px rgba(229,167,43,.10); }
.organ-card.needs-input .card-head h2 { color:#8a5700; }
.bbps-group.needs-input { border-radius:10px; padding:5px; }
.needs-input:focus { outline:2px solid rgba(229,167,43,.35); outline-offset:1px; }
.procedure-card { grid-column:1 / -1; }
.procedure-compact-grid { display:grid; grid-template-columns:repeat(2, minmax(280px,1fr)); gap:14px; margin-top:10px; }
.procedure-subsection { min-width:0; padding:10px; border:1px solid var(--line); border-radius:11px; background:#fafbfc; }
.subsection-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.subsection-actions { display:flex; align-items:center; justify-content:flex-end; gap:8px; flex-wrap:wrap; }
.procedure-options { display:flex; align-items:flex-end; gap:14px; flex-wrap:wrap; margin-top:12px; }
.dose-field { display:grid; gap:6px; min-width:170px; font-weight:600; }
.dose-field input { width:100%; padding:9px 10px; border:1px solid var(--line); border-radius:10px; font:inherit; background:#fff; }
.dose-field input:disabled { background:#eef2f7; color:var(--muted); }
.check-control { display:flex; align-items:center; gap:8px; min-height:40px; padding:8px 10px; border:1px solid var(--line); border-radius:10px; background:#f8fafc; font-weight:600; cursor:pointer; }
.check-control input { width:18px; height:18px; margin:0; accent-color:var(--accent); }
.check-control:has(input:checked) { border-color:#7fc5a9; background:var(--accent-soft); color:#075d42; }
.option-tile-group { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:10px; }
.option-tile { max-width:100%; padding:8px 10px; border:1px solid var(--line); border-radius:10px; background:#f8fafc; color:var(--text); font:inherit; font-size:13px; font-weight:600; text-align:left; white-space:normal; }
.option-tile.active { border-color:#7fc5a9; background:var(--accent-soft); color:#075d42; }
.compact-tile { min-height:38px; padding:7px 10px; }
.ai-control { width:max-content; max-width:100%; margin-top:10px; }
.profile-inline-link { text-decoration:none; }
.profile-inline-link:hover { color:var(--accent); text-decoration:underline; }
.empty-profile-hint { padding:7px 9px; border:1px dashed #e5a72b; border-radius:9px; color:#8a5700; background:#fff8e8; font-size:12px; }
.kolo-procedure-data { margin-bottom:14px; }
.screening-control { border-color:#c6e8d6; background:var(--accent-soft); color:#075d42; }
.procedure-summary { margin-left:auto; align-self:center; font-size:12px; font-weight:600; }
.kolo-procedure-options { margin:4px 0 14px; padding:12px; border:1px solid var(--line); border-radius:12px; background:#fafbfc; }
.billing-section { border-top:1px solid var(--line); }
.billing-grid { display:grid; gap:10px; margin-top:10px; }
.billing-field { min-width:0; }
.billing-field-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:5px; }
.billing-field-head label { font-size:12px; font-weight:bold; }
.billing-text { width:100%; min-height:112px; padding:10px 11px; border:1px solid var(--line); border-radius:10px; resize:vertical; font:12px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace; white-space:pre-wrap; }
.billing-note { margin:8px 0 0; color:var(--muted); font-size:11px; line-height:1.4; }
.histology-location-options { display:flex; gap:7px; flex-wrap:wrap; margin-top:9px; }
.histology-free-text { display:grid; gap:6px; max-width:680px; margin-top:12px; font-weight:600; }
.histology-free-text input { width:100%; padding:9px 10px; border:1px solid var(--line); border-radius:10px; font:inherit; background:#fff; }
.histology-location-panel.no-histology-active .histology-option,
.histology-location-panel.no-histology-active .histology-free-text { opacity:.45; cursor:not-allowed; }
.histology-none-option { border-color:#d7deea; }

.tabs { position:sticky; top:0; z-index:35; padding:8px 20px; background:rgba(245,247,251,.96); border-bottom:1px solid var(--line); backdrop-filter:blur(8px); }
.kolo-setup-card, .colon-card { grid-column:1 / -1; }
.compact-organ-card .organ-text { min-height:68px; }
#koloskopie-text { min-height:150px; }
#koloskopie-setup-text { min-height:82px; }
#dru-text, #proktoskopie-text, #terminal-ileum-text { min-height:68px; }

.output-disclosure { border:1px solid var(--line); border-radius:11px; background:#fafbfc; }
.output-disclosure > summary { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 11px; cursor:pointer; font-weight:bold; list-style:none; }
.output-disclosure > summary::-webkit-details-marker { display:none; }
.output-disclosure > summary::before { content:'›'; color:var(--muted); font-size:20px; line-height:1; transition:transform .12s ease; }
.output-disclosure[open] > summary::before { transform:rotate(90deg); }
.summary-badge { margin-left:auto; padding:3px 7px; border-radius:999px; background:#eef2f7; color:var(--muted); font-size:11px; font-weight:600; }
.disclosure-content, .output-disclosure .wizard-history { margin:0 10px 10px; }
.wizard-history-section { padding-bottom:0; border-bottom:0; }
.sticky-toolbar { position:sticky; bottom:-14px; z-index:5; margin:0 -14px -14px; padding:11px 14px; border-top:1px solid var(--line); background:rgba(255,255,255,.97); backdrop-filter:blur(8px); box-shadow:0 -6px 15px rgba(15,23,42,.06); }
.completeness-status { margin-right:auto; max-width:165px; color:#9a5b00; font-size:11px; font-weight:bold; line-height:1.25; }
.completeness-status.complete { color:var(--accent); }

.measurement-control { display:grid; grid-template-columns:minmax(0,1fr) auto auto auto; align-items:center; gap:6px; }
.measurement-control input { min-width:0; }
.measurement-unit { min-width:30px; color:var(--muted); font-weight:bold; text-align:center; }
.measurement-step { padding:8px 10px; border:1px solid var(--line); border-radius:9px; background:#eef2f7; color:var(--text); }
.measurement-hint { margin:0; color:var(--muted); font-size:11px; }
.quick-input-panel { width:min(460px, calc(100vw - 32px)); }
.quick-input-label { display:block; margin-bottom:7px; font-weight:bold; }
.quick-input-panel input { width:100%; padding:11px 12px; border:1px solid var(--line); border-radius:10px; font:inherit; }
.quick-input-panel .field-hint { display:block; min-height:17px; margin:7px 0 0; }
.quick-input-actions { display:flex; justify-content:flex-end; gap:9px; margin-top:16px; }
.quick-input-actions #procedure-input-remove { margin-right:auto; color:var(--danger); }

@media (max-width:700px) {
  .card-head { align-items:flex-start; }
  .card-actions { justify-content:flex-start; }
  .wizard-footer { justify-content:stretch; flex-wrap:wrap; }
  .wizard-footer button { flex:1 1 42%; }
  .wizard-preview div { grid-template-columns:1fr; gap:2px; }
  .procedure-options { align-items:stretch; }
  .dose-field, .check-control, .procedure-summary { width:100%; margin-left:0; }
  .procedure-compact-grid { grid-template-columns:1fr; }
  .sticky-toolbar { flex-wrap:wrap; }
  .completeness-status { order:-1; width:100%; max-width:none; }
  .topbar p { display:none; }
}

.account-card { width:min(560px, calc(100vw - 32px)); }
.account-layout, .management-layout { width:min(1120px, calc(100vw - 32px)); margin:24px auto; display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:16px; }
.full-width, .invite-card { grid-column:1 / -1; }
.account-form { margin-top:16px; }
.account-form label, .inline-form label, .invite-result label { display:grid; gap:6px; font-weight:600; }
.account-form input, .inline-form input, .invite-result input { width:100%; padding:10px 12px; border:1px solid var(--line); border-radius:10px; font:inherit; background:#fff; }
.account-form textarea, .account-form select { width:100%; padding:10px 12px; border:1px solid var(--line); border-radius:10px; font:inherit; background:#fff; }
.account-form textarea { resize:vertical; min-height:92px; }
.profile-card { grid-column:1 / -1; }
.profile-fieldset { display:grid; gap:12px; margin:4px 0; padding:14px; border:1px solid var(--line); border-radius:12px; }
.profile-fieldset legend { padding:0 6px; font-weight:bold; }
.profile-device-grid { display:grid; grid-template-columns:minmax(280px,1fr) minmax(220px,.7fr); align-items:start; gap:12px; }
.profile-toggle-row { display:flex; gap:10px; flex-wrap:wrap; }
.account-form input:disabled { background:#eef2f7; color:var(--muted); }
.password-rules { margin:0; color:var(--muted); font-size:12px; line-height:1.45; }
.inline-form { display:grid; grid-template-columns:minmax(250px, 1fr) 150px auto; align-items:end; gap:12px; margin-top:16px; }
.invite-result { display:grid; grid-template-columns:1fr auto; gap:10px; align-items:end; margin-top:16px; padding:14px; border:1px solid #c6e8d6; border-radius:12px; background:var(--accent-soft); }
.invite-result strong { grid-column:1 / -1; }
.table-wrap { overflow-x:auto; margin-top:12px; }
.management-table { width:100%; border-collapse:collapse; font-size:13px; }
.management-table th, .management-table td { padding:10px; border-bottom:1px solid var(--line); text-align:left; vertical-align:middle; }
.management-table th { color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:.04em; }
.status-pill { display:inline-block; padding:4px 8px; border-radius:999px; font-size:11px; font-weight:bold; }
.status-pill.active { color:#075d42; background:var(--accent-soft); }
.status-pill.inactive { color:#8a5700; background:#fff3d6; }
@media (max-width:760px) {
  .account-layout, .management-layout { grid-template-columns:1fr; margin:16px auto; }
  .inline-form, .invite-result { grid-template-columns:1fr; }
  .invite-result strong { grid-column:auto; }
  .topbar { align-items:flex-start; flex-direction:column; }
  .topbar-actions { width:100%; flex-wrap:wrap; }
  .profile-device-grid { grid-template-columns:1fr; }
}

/* v23.5: stable dialog actions, accessible focus and narrow-screen layout. */
body.modal-open { overflow:hidden; }
.layout > *, .organs-grid, .card, .card-head > *, .section-row > * { min-width:0; }
.card-head, .section-row, .toolbar { flex-wrap:wrap; }
button, .button-link, summary, input, textarea, select { touch-action:manipulation; }
summary:focus-visible, a:focus-visible { outline:3px solid rgba(11,122,85,.45); outline-offset:3px; }
#wizard-modal .modal-panel { display:flex; flex-direction:column; overflow:hidden; padding:0; max-height:calc(100dvh - 32px); }
#wizard-modal .modal-head { flex:none; gap:12px; padding:16px 18px 12px; margin:0; border-bottom:1px solid var(--line); }
.wizard-progress { margin-top:5px; color:var(--muted); font-size:12px; font-weight:600; }
.wizard-body { min-height:0; overflow-y:auto; overscroll-behavior:contain; padding:16px 18px; }
#wizard-modal .wizard-footer { flex:none; position:static; margin:0; padding:12px 18px; flex-wrap:wrap; }
.wizard-keyboard-hint { flex:none; margin:0; padding:0 18px 12px; line-height:1.4; }
.wizard-error { flex:none; margin:10px 18px 0; padding:10px 12px; border:1px solid #fecaca; border-radius:10px; background:#fff1f2; color:var(--danger); font-size:14px; line-height:1.4; }
.wizard-completion { margin:0; padding:14px; border-radius:10px; border:1px solid #c6e8d6; background:var(--accent-soft); line-height:1.5; }
.choice-btn { min-height:44px; }
.modal[aria-busy="true"] .wizard-body { opacity:.65; cursor:progress; }
.modal[aria-busy="true"] .wizard-progress::after { content:' · Wird übernommen …'; }
@media (max-width:700px) {
  .layout { padding:12px; gap:12px; }
  .tabs { padding:8px 12px; }
  .card-head { gap:8px; }
  .card-head h2, .section-head h2 { font-size:1.18rem; }
  .card-actions { margin-left:auto; gap:6px; }
  .toolbar { gap:8px; }
  .toolbar > button { flex:1 1 140px; }
  .histology-location-options .check-control, .option-tile-group .check-control { width:auto; flex:1 1 135px; }
  .histology-location-options .histology-none-option { flex-basis:100%; }
  #wizard-modal .modal-panel { width:calc(100vw - 16px); max-height:calc(100dvh - 16px); border-radius:12px; }
  #wizard-modal .modal-head, .wizard-body { padding:12px; }
  #wizard-modal .wizard-footer { padding:10px 12px; gap:8px; }
  #wizard-modal .wizard-footer button { min-height:44px; flex:1 1 44%; }
  .wizard-keyboard-hint { display:none; }
  .wizard-preview-content > div { grid-template-columns:1fr; }
  .wizard-error { margin:8px 12px 0; }
}
@media (prefers-reduced-motion:reduce) { .output-disclosure > summary::before { transition:none; } }


/* v23.6: direct finding-tile actions below each editable organ report. */
.finding-quick-actions { display:flex; align-items:center; justify-content:flex-start; gap:6px; flex-wrap:wrap; margin-top:6px; }
.finding-quick-action { min-height:30px; padding:5px 9px; border-radius:8px; border:1px solid transparent; font-size:11px; line-height:1.2; font-weight:700; box-shadow:none; }
.finding-quick-action-normal { background:#e8f5ef; color:#075d42; border-color:#a9d7c3; }
.finding-quick-action-normal:hover, .finding-quick-action-normal:focus-visible { background:#d8efe5; border-color:#79bd9f; opacity:1; }
.finding-quick-action-not-examined { background:#fde8e8; color:#9b1c1c; border-color:#f3b6b6; }
.finding-quick-action-not-examined:hover, .finding-quick-action-not-examined:focus-visible,
.finding-quick-action-not-examined.active { background:#f8d2d2; border-color:#e48a8a; opacity:1; }
@media (max-width:700px) { .finding-quick-action { min-height:36px; padding:7px 10px; } }
