/* Assistenten (ASSI): Markdown-Leiste, Stammdaten, Felder, Haken, eigene Einträge (FR-12), E-Mail-Vorlagen,
   Testmatrix, Testfälle, LDconnect. Regeln aus dem <style> des Ist (index.html). Die Schrittliste und den Kopf des
   Details (.erv-steplist, .erv-step-btn, .erv-stepdetail …), die Phasen-Karten, .erv-btn und .erv-fld-label bringt
   projektplan.css mit; beide Dateien gehören auf die Projektseite. */

/* Markdown-Werkzeugleiste über den Freitextfeldern: zurückhaltend, ein Tooltip je Leiste (mdTipZeigen) */
.md-field{display:block;}
.md-toolbar{display:flex; flex-wrap:wrap; align-items:center; gap:4px; margin-bottom:5px; position:relative;}
.md-tool{
  font-size:12px; line-height:1; height:26px; padding:0 9px; cursor:pointer; white-space:nowrap;
  border:1px solid var(--border); border-radius:6px; background:var(--surface-1); color:var(--text-secondary);
}
.md-tip{
  position:absolute; top:calc(100% + 6px); z-index:12; width:250px; pointer-events:none;
  background:var(--text-primary); color:var(--surface-1); font-size:11px; line-height:1.45;
  padding:6px 9px; border-radius:6px; box-shadow:var(--shadow);
}
.md-tool:hover{background:var(--page); color:var(--text-primary); border-color:var(--text-muted);}
.md-tool:focus-visible{outline:2px solid var(--accent); outline-offset:1px;}
.md-tool-bold{font-weight:var(--fw-bold);} .md-tool-italic{font-style:italic;}
.md-tool-code{font-family:var(--font-mono);}
.md-hint{font-size:11px; color:var(--text-muted); margin-left:4px;}
@media (max-width:620px){ .md-hint{display:none;} }

/* Stammdaten (read-only) und Rahmen des eigenen Panels */
.erv-stammdaten{display:flex; gap:22px; flex-wrap:wrap; font-size:12.8px;}
.erv-stammdaten .erv-sd-item{display:flex; flex-direction:column; gap:2px;}
.erv-stammdaten .erv-sd-label{font-size:11px; color:var(--text-muted);}
.erv-stammdaten .erv-sd-value{font-weight:var(--fw-semibold); color:var(--text-primary);}
.erv-layout{display:grid; grid-template-columns:230px 1fr; gap:18px;}
@media (max-width:760px){.erv-layout{grid-template-columns:1fr;}}
.assi-fuss{display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-top:18px; padding-top:12px; border-top:1px solid var(--grid); font-size:12px; color:var(--text-muted);}

/* Gruppen, Hinweise, Felder */
.erv-group{margin-bottom:20px;}
.erv-group h5{font-size:13px; margin:0 0 9px; color:var(--text-primary); font-weight:var(--fw-semibold);}
.erv-notice{display:flex; gap:9px; border-radius:var(--radius-sm); padding:10px 12px; margin:0 0 13px; font-size:12.6px; line-height:1.5; border:1px solid transparent;}
.erv-notice-tag{flex:0 0 auto; font-family:var(--font-mono); font-size:11px; padding:2px 6px; border-radius:4px; height:fit-content; font-weight:var(--fw-semibold); color:#fff;}
.erv-notice-info{background:color-mix(in srgb, var(--accent) 10%, var(--page)); border-color:var(--accent);}
.erv-notice-info .erv-notice-tag{background:var(--accent);}
.erv-notice-important{background:color-mix(in srgb, var(--status-warning) 14%, var(--page)); border-color:var(--status-warning); color:var(--status-warning-text);}
.erv-notice-important .erv-notice-tag{background:var(--status-warning); color:var(--text-primary);}
.erv-notice-todo{background:color-mix(in srgb, var(--status-good) 12%, var(--page)); border-color:var(--status-good); color:var(--success-text);}
.erv-notice-todo .erv-notice-tag{background:var(--status-good);}
.erv-field-grid{display:grid; grid-template-columns:1fr 1fr; gap:12px;}
@media (max-width:640px){.erv-field-grid{grid-template-columns:1fr;}}
.erv-fld{display:flex; flex-direction:column; gap:4px; margin-bottom:12px;}
.erv-fld-wide{grid-column:1/-1;}
.erv-fld input[type=text], .erv-fld input[type=date], .erv-fld input[type=number], .erv-fld select, .erv-fld textarea{
  font:inherit; font-size:13px; padding:7px 10px; border:1px solid var(--border); border-radius:var(--radius-sm);
  background:var(--page); color:var(--text-primary); width:100%;
}
.erv-fld textarea{resize:vertical; min-height:60px; line-height:1.5; font-family:inherit;}
.erv-fld input:focus, .erv-fld select:focus, .erv-fld textarea:focus{outline:2px solid var(--accent); outline-offset:1px; border-color:var(--accent);}
.erv-fld-hint{font-size:11px; color:var(--text-muted);}
.erv-radio-group{display:flex; gap:12px; flex-wrap:wrap; margin-top:2px;}
.erv-radio-opt{display:flex; align-items:center; gap:6px; font-size:12.6px; color:var(--text-primary); cursor:pointer;}
.erv-radio-opt input{accent-color:var(--accent); width:14px; height:14px;}

/* Haken */
.erv-ck-row{border:1px solid var(--border); background:var(--page); border-radius:var(--radius-sm); padding:9px 11px; margin-bottom:7px; transition:border-color .15s, background .15s;}
.erv-ck-row.is-done{border-color:var(--status-good); background:color-mix(in srgb, var(--status-good) 10%, var(--page));}
.erv-ck-top{display:flex; align-items:flex-start; gap:6px;}
.erv-ck-top .erv-ck-label{flex:1 1 auto;}
.erv-ck-label{display:flex; align-items:flex-start; gap:9px; cursor:pointer; font-size:12.6px; line-height:1.45; color:var(--text-primary);}
.erv-ck-label input{margin-top:2px; width:15px; height:15px; accent-color:var(--status-good); flex:0 0 auto; cursor:pointer;}
.erv-ck-label .sub{margin:4px 0 0; padding-left:18px; color:var(--text-secondary); font-size:12px;}
.erv-ck-note{margin-top:7px; width:100%; font:inherit; font-size:11.8px; color:var(--text-secondary); border:1px dashed var(--border); border-radius:6px; padding:6px 8px; min-height:32px; background:var(--surface-1); resize:vertical;}
.erv-ck-note:focus{outline:1.5px solid var(--accent);}

/* Eigene Einträge und Ausblenden (FR-12); ohne „Liste anpassen“ (body.cu-editing) bleiben die Werkzeuge verborgen */
.cu-btn{flex:0 0 auto; border:0; background:transparent; color:var(--text-secondary); cursor:pointer; font-size:12px; padding:2px 6px; border-radius:var(--radius-sm);}
.cu-btn:hover,.cu-btn:focus-visible{background:var(--grid); color:var(--text-primary);}
.cu-foot{margin-top:14px; padding-top:10px; border-top:1px dashed var(--border);}
.cu-foot h6{margin:0 0 6px; font-size:12px; color:var(--text-secondary); font-weight:var(--fw-semibold);}
.cu-add{display:flex; gap:6px; margin:8px 0;}
.cu-add input{flex:1 1 auto; min-width:0;}
.cu-tag{font-size:11px; color:var(--accent-soft-text); background:var(--accent-soft-bg); padding:1px 5px; border-radius:8px; margin-left:6px;}
.cu-pool:empty{display:none;}
.cu-start{display:none;}
body:not(.cu-editing) [data-cu-hide], body:not(.cu-editing) .cu-edit, body:not(.cu-editing) .cu-gap, body:not(.cu-editing) .cu-form{display:none;}
.cu-del{color:var(--status-critical-text);}
.cu-tool{display:flex; align-items:center; justify-content:space-between; gap:12px; margin:0 0 8px; padding:7px 11px; border:1px dashed var(--border); border-radius:var(--radius-sm); font-size:11.5px; color:var(--text-muted);}
.cu-sw{display:inline-flex; align-items:center; gap:6px; font-size:12px; color:var(--text-primary); cursor:pointer; white-space:nowrap;}
.cu-sw input{accent-color:var(--accent); width:14px; height:14px;}
.cu-gap{position:relative; height:16px; margin:-3px 0 4px; display:flex; align-items:center; justify-content:center;}
.cu-gap::before{content:''; position:absolute; left:0; right:0; top:50%; border-top:1px dashed var(--border);}
.cu-plus{position:relative; width:18px; height:18px; padding:0; border-radius:50%; border:1px solid var(--border); background:var(--surface-1); color:var(--accent); font-size:13px; line-height:1; cursor:pointer;}
.cu-plus:hover,.cu-plus:focus-visible{border-color:var(--accent); background:var(--accent-soft-bg); color:var(--accent-soft-text);}
.cu-form{margin:2px 0 9px; padding:10px 12px; border:1px solid var(--accent); border-radius:var(--radius-sm); background:var(--surface-1);}
.cu-form textarea{width:100%; font:inherit; font-size:12.6px; color:var(--text-primary); background:var(--page); border:1px solid var(--border); border-radius:6px; padding:6px 8px; resize:vertical;}
.cu-form textarea:focus{outline:1.5px solid var(--accent);}
.cu-form-row{display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-top:7px;}
.cu-count{font-size:11px; color:var(--text-muted);}
.cu-form-btns{margin-left:auto; display:flex; gap:6px;}
.cu-hidden-list{font-size:12px; color:var(--text-secondary); margin:6px 0;}
.cu-hidden-list div{display:flex; gap:8px; align-items:center; justify-content:space-between; padding:2px 0;}

/* Knopf „Zurücksetzen“ (die übrigen .erv-btn-Regeln stehen in projektplan.css) */
.erv-btn.danger{background:transparent; color:var(--status-critical-text); border-color:var(--status-critical);}

/* ERV: E-Mail-Vorlagen, Testmatrix, Change Requests, Testfälle (P2.2) */
.erv-email-box{background:var(--inset-bg); border-radius:var(--radius-md); padding:14px 14px 12px; margin-top:4px;}
.erv-email-box textarea{width:100%; min-height:240px; background:var(--surface-1); color:var(--text-primary); border:1px solid var(--border); border-radius:var(--radius-sm); padding:11px; font-family:var(--font-mono); font-size:11.8px; line-height:1.6; resize:vertical;}
.erv-email-actions{display:flex; gap:8px; margin-top:9px; flex-wrap:wrap;}
.erv-tm-grid{display:grid; grid-template-columns:repeat(2,1fr); gap:12px; margin-top:4px;}
@media (max-width:640px){.erv-tm-grid{grid-template-columns:1fr;}}
.erv-tm-card{border:1px solid var(--border); background:var(--page); border-radius:var(--radius-sm); padding:11px 12px;}
.erv-tm-card .erv-tm-title{font-weight:var(--fw-semibold); font-size:12.5px; margin-bottom:7px; color:var(--text-secondary);}
.erv-tm-nums{display:flex; align-items:center; gap:6px; margin-bottom:7px;}
.erv-tm-nums input{width:52px; padding:5px 7px; border:1px solid var(--border); border-radius:6px; font-variant-numeric:tabular-nums; text-align:center; background:var(--surface-1); color:var(--text-primary);}
.erv-tm-track{height:7px; border-radius:5px; background:var(--grid); overflow:hidden;}
.erv-tm-fill{height:100%; background:var(--status-good); border-radius:5px;}
.erv-cr-item{border:1px solid var(--border); background:var(--page); border-radius:var(--radius-sm); padding:12px; margin-bottom:11px; position:relative;}
.erv-cr-item .erv-cr-remove{position:absolute; top:8px; right:8px; background:none; border:none; color:var(--text-muted); cursor:pointer; font-size:15px;}
.erv-cr-item .erv-cr-remove:hover{color:var(--status-critical-text);}
.erv-cr-num{font-variant-numeric:tabular-nums; font-size:11px; color:var(--text-muted); margin-bottom:5px; display:block;}
.erv-tf-table{overflow-x:auto; margin-bottom:10px;}
.erv-tf-row{display:grid; grid-template-columns:110px 150px 90px 52px 70px 110px 1fr 28px 28px; gap:6px; align-items:center; padding:5px 0; border-bottom:1px solid var(--grid); font-size:12px;}
.erv-tf-row:last-child{border-bottom:none;}
.erv-tf-row.erv-tf-head{border-bottom:1px solid var(--border);}
.erv-tf-row input, .erv-tf-row select{font:inherit; font-size:12px; padding:4px 6px; border:1px solid var(--border); border-radius:6px; background:var(--surface-1); color:var(--text-primary); width:100%;}
.erv-tf-status{text-align:center;}
.erv-tf-remove{background:none; border:none; color:var(--text-muted); cursor:pointer; font-size:13px;}
.erv-tf-remove:hover{color:var(--status-critical-text);}
.erv-tf-actions{display:flex; gap:8px; flex-wrap:wrap; margin-top:6px;}
.erv-tf-summary{margin-top:12px; background:var(--inset-bg); border-radius:var(--radius-md); padding:12px 14px;}
.erv-tf-summary h6{font-size:11.5px; margin:0 0 6px; color:var(--text-secondary);}
.erv-tf-summary pre{white-space:pre-wrap; font-family:inherit; font-size:12.5px; margin:0; color:var(--text-primary);}

/* LDconnect Diamant: Angaben aus der Anleitung */
.ldc-ref{margin-top:14px; border:1px solid var(--border); border-radius:8px; background:var(--surface-1);}
.ldc-ref > summary{cursor:pointer; padding:9px 14px; font-weight:var(--fw-semibold); font-size:13px; color:var(--text-primary);}
.ldc-refbody{padding:2px 14px 14px; display:flex; flex-direction:column; gap:10px; font-size:13px; color:var(--text-primary);}
.ldc-refbody p, .ldc-refbody ul{margin:0;}
.ldc-refbody ul{padding-left:20px;}
.ldc-ref-h{font-size:12.5px; margin:4px 0 0; color:var(--text-secondary); font-weight:var(--fw-semibold);}
.ldc-pre{margin:0; background:var(--grid); border:1px solid var(--border); border-radius:6px; padding:10px 12px; overflow-x:auto; font-family:var(--font-mono); font-size:12.5px; line-height:1.5; white-space:pre;}
.ldc-tbl{overflow-x:auto;}
.ldc-tbl table{border-collapse:collapse; width:100%; font-size:12.8px;}
.ldc-tbl th, .ldc-tbl td{border:1px solid var(--border); padding:5px 8px; text-align:left; vertical-align:top;}
.ldc-tbl th{background:var(--grid); font-weight:var(--fw-semibold);}
