/* ERD-Messhilfe · isolierte UI-Ergänzung, nutzt die bestehenden Farben und Karten */
.erd-open{display:inline-flex;align-items:center;gap:5px;margin-top:8px;padding:4px 0;border:0;background:none;color:#5c7b46;font-size:10px;text-align:left;text-decoration:underline;text-underline-offset:3px}
.erd-open svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round;flex:none}
.erd-open:hover{color:var(--accent)}
body.erd-dialog-open{overflow:hidden}
.erd-dialog{width:min(1040px,calc(100vw - 32px));max-width:none;max-height:calc(100vh - 32px);padding:0;border:1px solid #d7dfcf;border-radius:10px;background:#f7f7f1;color:var(--ink);box-shadow:0 24px 70px rgba(25,40,28,.28)}
.erd-dialog::backdrop{background:rgba(28,40,30,.46)}
.erd-shell{max-height:calc(100vh - 32px);overflow:auto;border-radius:9px}
.erd-head{position:sticky;top:0;z-index:2;display:flex;justify-content:space-between;gap:20px;padding:20px 24px 16px;border-bottom:1px solid var(--line);background:#fbfbf6}
.erd-head h2{font:400 30px Georgia,serif;letter-spacing:-.8px;margin:8px 0 6px}
.erd-head p{max-width:760px;margin:0;color:#7b8b70;font-size:11.5px;line-height:1.7}
.erd-close{flex:none;width:36px;height:36px;border:0;border-radius:50%;background:#edf1e7;color:#5c6f54;font-size:23px;line-height:1}
.erd-close:hover{background:#e2e9da}
.erd-grid{display:grid;grid-template-columns:minmax(0,1fr) 292px;gap:20px;padding:20px 24px 28px}
.erd-flow{min-width:0}
.erd-step{background:#fff;border:1px solid var(--line);border-radius:8px;padding:17px 19px;margin-bottom:14px}
.erd-step-head{display:flex;gap:11px;align-items:flex-start;margin-bottom:13px}
.erd-step-head>span{flex:none;display:grid;place-items:center;width:27px;height:27px;border-radius:50%;background:#e8eee1;color:#547a43;font-size:11px;font-weight:650}
.erd-step-head h3{margin:1px 0 4px;font-size:15px;font-weight:600;letter-spacing:-.1px}
.erd-step-head p{margin:0;color:#829175;font-size:10.5px;line-height:1.6}
.erd-refchoice{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:0 0 13px;padding:0;border:0}
.erd-refchoice legend{grid-column:1/-1;margin-bottom:1px;color:#7e8d72;font-size:9px;letter-spacing:1.2px;font-weight:650;text-transform:uppercase}
.erd-refchoice label{display:flex;gap:7px;align-items:flex-start;padding:9px;border:1px solid #dce3d5;border-radius:6px;background:#fbfcf8;cursor:pointer;line-height:1.45}
.erd-refchoice label:has(input:checked){border-color:#9fb8a2;background:#f0f5e9;box-shadow:inset 0 0 0 1px #c8d8bf}
.erd-refchoice input{flex:none;margin:2px 0 0}
.erd-refchoice b{display:block;font-size:10.5px;color:#3e5a38;margin-bottom:2px}
.erd-refchoice small{display:block;font-size:9px;color:#849475;line-height:1.5}
.erd-svg-wrap{margin:4px 0 3px;padding:8px 6px;border:1px solid #e2e8db;border-radius:6px;background:#fafbf6;overflow-x:auto}
.erd-svg-wrap svg{display:block;width:100%;height:auto}
.erd-svg-wrap .erd-diagram-mobile{display:none}
.erd-legend{display:flex;flex-wrap:wrap;gap:5px 12px;margin:6px 0 3px;color:#8a9a7c;font-size:9px}
.erd-legend span{display:inline-flex;align-items:center;gap:4px}
.erd-swatch{display:inline-block;width:9px;height:9px;border-radius:2px}
.erd-swatch.rim{background:#c9d3c0}.erd-swatch.nipple{background:#b5a17b}.erd-swatch.spoke{background:#2e5140}.erd-swatch.axis{background:repeating-linear-gradient(90deg,#9aaa8b 0 2px,transparent 2px 4px)}
.erd-mode{margin:6px 0 0;color:#617d50;font-size:9.5px;letter-spacing:.1px}
.erd-fields{display:grid;grid-template-columns:1fr 1fr;gap:10px 12px;margin:8px 0}
.erd-gap-fields{grid-template-columns:repeat(3,minmax(0,1fr))}
.erd-field{min-width:0}
.erd-field label{display:flex;justify-content:space-between;align-items:baseline;gap:6px;margin-bottom:5px;color:#4e6546;font-size:10.5px;line-height:1.4}
.erd-field label span{color:#9aaa8b;font-size:8.5px;white-space:nowrap}
.erd-field input{width:100%;min-height:37px;padding:8px 9px;border:1px solid #dce3d5;border-radius:5px;background:#fcfdf9;color:#2d4429;font:12px Inter,ui-sans-serif,sans-serif}
.erd-field input::placeholder{color:#bac3b1;font-size:10px}
.erd-field input:disabled{background:#f0f2ea;color:#9aa892}
.erd-field input[aria-invalid=true]{border-color:#bf7861;background:#fff8f2}
.erd-help{margin:4px 0 0;color:#8a987e;font-size:8.5px;line-height:1.45}
.erd-check,.erd-confirm{display:flex;align-items:flex-start;gap:8px;margin:8px 0;color:#5d7154;font-size:10px;line-height:1.6}
.erd-check input,.erd-confirm input{flex:none;margin:2px 0 0}
.erd-confirm{padding:9px 10px;border:1px solid #e2e8db;border-radius:5px;background:#fbfcf8}
.erd-details{margin:10px 0;padding:8px 0;border-top:1px solid #edf0e8;border-bottom:1px solid #edf0e8}
.erd-details summary{cursor:pointer;color:#5c7b46;font-size:10px}
.erd-details p{margin:8px 0 2px;color:#8a987e;font-size:9.5px;line-height:1.6}
.erd-alert{margin:0 0 10px;padding:9px 11px;border-left:2px solid #bb5d4e;background:#fff4ef;color:#8f4d42;font-size:10px;line-height:1.6}
.erd-alert ul{margin:5px 0 0;padding-left:16px}
.erd-result-head{display:flex;justify-content:space-between;align-items:flex-end;gap:14px;padding:9px 0 10px;border-bottom:1px solid #edf0e8}
.erd-result-label{display:block;color:#7e8d72;font-size:9px;letter-spacing:1.2px;font-weight:650}
.erd-result-head strong{font:400 34px Georgia,serif;letter-spacing:-1px;color:var(--accent)}
.erd-result-head small{margin-left:3px;color:#8a9a7c;font-size:11px}
.erd-spread{max-width:310px;color:#8a9a7c;font-size:9.5px;line-height:1.5;text-align:right}
.erd-ok{color:#547a43}.erd-warn{color:#92713d}.erd-muted{color:#8a9a7c}
.erd-table-wrap{margin:10px 0;overflow-x:auto}
.erd-table{width:100%;border-collapse:collapse;font-size:10px}
.erd-table caption{caption-side:top;padding:2px 0 5px;color:#9aaa8b;font-size:8.5px;text-align:left}
.erd-table th,.erd-table td{padding:5px 4px;border-bottom:1px solid #eef1e8;text-align:right;white-space:nowrap}
.erd-table thead th{color:#8a987e;font-size:8px;font-weight:600;letter-spacing:.4px;text-transform:uppercase}
.erd-table th:first-child,.erd-table td:first-child{text-align:left}
.erd-table tbody th{color:#5d7154;font-weight:500}
.erd-formula{margin:10px 0;padding:9px 10px;border:1px solid #e4e9dc;border-radius:5px;background:#f7f9f2;color:#536a4b;font:9.5px/1.65 ui-monospace,SFMono-Regular,Consolas,monospace;white-space:pre-wrap;overflow-wrap:anywhere}
.erd-checks{list-style:none;margin:8px 0 0;padding:0;color:#718765;font-size:9.5px;line-height:1.7}
.erd-checks li{padding-left:13px;text-indent:-13px}
.erd-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:11px}
.erd-actions .primary,.erd-actions .secondary{font-size:10px}
.erd-note{margin:7px 0 0;color:#8a987e;font-size:9px;line-height:1.6}
.erd-aside{display:flex;flex-direction:column;gap:9px;min-width:0}
.erd-note-box{padding:11px 12px;border:1px solid #dfe7d7;border-radius:7px;background:#eef2e7}
.erd-note-box h3{margin:0 0 5px;color:#48623f;font-size:11px;font-weight:600}
.erd-note-box p{margin:0;color:#6d7c6c;font-size:9.5px;line-height:1.65}
.erd-note-box.erd-limits{border-color:#e5d7bd;background:#f8f1e4}
.erd-note-box.erd-limits p{color:#7f6a4a}
.erd-inset{display:block;width:100%;height:auto;margin:7px auto 0}
.erd-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:900px){.erd-grid{grid-template-columns:1fr}.erd-aside{display:grid;grid-template-columns:1fr 1fr}}
@media(max-width:760px){
 .erd-dialog{width:calc(100vw - 12px);max-height:calc(100vh - 12px)}
 .erd-shell{max-height:calc(100vh - 12px)}
 .erd-head{padding:15px 15px 12px}
 .erd-head h2{font-size:23px}
 .erd-head p{font-size:10.5px}
 .erd-grid{padding:13px}
 .erd-step{padding:14px}
 .erd-refchoice{grid-template-columns:1fr}
 .erd-fields,.erd-gap-fields{grid-template-columns:1fr}
 .erd-aside{grid-template-columns:1fr}
 .erd-result-head{display:block}
 .erd-spread{max-width:none;margin-top:5px;text-align:left}
 .erd-table .erd-col-param{display:none}
 .erd-table{font-size:9.5px}
 .erd-svg-wrap .erd-diagram-desktop{display:none}
 .erd-svg-wrap .erd-diagram-mobile{display:block}
 .erd-svg-wrap svg{min-width:0}
}
@media(prefers-reduced-motion:reduce){.erd-dialog *{scroll-behavior:auto;transition:none!important;animation:none!important}}
@media print{.erd-dialog{display:none!important}}
