/* Begriffskarten öffnen über dem Artikel, ohne dessen Position zu verändern. */
button[data-term]:not(.term-saved-open){display:inline;padding:0 2px;border:0;border-radius:0;background:transparent;color:var(--violet);font:inherit;font-weight:700;text-align:inherit;line-height:inherit;text-decoration:underline dotted;text-decoration-thickness:1px;text-underline-offset:.2em}
button[data-term]:not(.term-saved-open):hover{background:var(--violet-soft);filter:none}
.terms-toggle{flex-shrink:0;padding:7px 12px;font-size:.75rem;background:var(--paper);color:var(--violet);border-color:var(--line);font-variant-numeric:tabular-nums}
.terms-toggle-floating{position:fixed;right:20px;bottom:20px;z-index:30;box-shadow:0 5px 24px #14294c26}
.terms-dialog{box-sizing:border-box;width:min(560px,calc(100% - 32px));max-height:calc(100dvh - 48px);padding:28px;border:1px solid var(--line);border-radius:22px;background:var(--paper);color:var(--ink);box-shadow:0 24px 90px #08172f40;font:16px/1.6 var(--font);overflow:auto;overscroll-behavior:contain}
.terms-dialog::backdrop{background:#09192e66}
.terms-head{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:22px}
.term-eyebrow{font-size:.68rem;letter-spacing:.1em;text-transform:uppercase;font-weight:750;color:var(--violet)}
.terms-dialog .term-close{background:transparent;color:var(--muted);border:1px solid var(--line);padding:7px 11px;font-size:.73rem;white-space:nowrap}
.term-close span{font-size:1.1rem;margin-left:5px}
.terms-dialog h2{font-size:2rem;line-height:1.13;margin:0 0 23px;letter-spacing:-.025em}
.terms-dialog h2:focus{outline:none}
.terms-dialog p{margin:0 0 16px;font-size:.92rem}
.term-definition{max-width:48ch}
.term-example{border-left:3px solid var(--blue);background:var(--blue-soft);padding:17px 19px;margin:23px 0}
.term-example strong{display:block;color:var(--blue);font-size:.75rem;margin-bottom:8px}
.term-example p:last-child{margin:0}
.terms-dialog .term-note{font-size:.8rem;color:var(--muted)}
.terms-dialog details{margin:20px 0;font-size:.85rem}
.terms-dialog details p{font-size:.83rem;margin-top:12px}
.terms-dialog summary{font-size:.85rem}
.term-layers,.term-layers ol{list-style:none;padding:10px 0 0 13px;margin:0;border-left:2px solid var(--violet);font-size:.81rem}
.term-layers{margin:14px 0;color:var(--violet)}
.term-layers li{padding:0 0 8px 0}
.term-actions{display:flex;align-items:center;flex-wrap:wrap;gap:12px;padding-top:18px;border-top:1px solid var(--line);margin-top:24px}
.term-actions button{font-size:.8rem;padding:9px 14px}
.term-actions .term-collection-link{background:transparent;border-color:transparent;color:var(--muted);padding-left:0}
.term-actions button[aria-pressed=true]{background:var(--violet);color:var(--paper)}
.terms-dialog.terms-drawer{position:fixed;inset:0 0 0 auto;margin:0;width:min(430px,100%);height:100dvh;max-height:100dvh;border-radius:20px 0 0 20px;border-right:0;padding-top:30px}
.terms-dialog .term-collection-intro,.terms-dialog .term-empty{color:var(--muted);font-size:.86rem}
.term-saved-list{list-style:none;margin:26px 0 0;padding:0}
.term-saved-list li{padding:17px 0;border-top:1px solid var(--line)}
.terms-dialog .term-saved-open{display:flex;align-items:center;justify-content:space-between;gap:15px;width:100%;border:0;background:transparent;border-radius:4px;color:var(--ink);padding:5px 0;text-align:left;font-size:.95rem;font-weight:650}
.term-saved-open span{color:var(--violet)}
.terms-dialog .term-remove{border:0;border-radius:4px;background:transparent;color:var(--muted);font-size:.73rem;padding:5px 0;font-weight:400;text-decoration:underline;text-underline-offset:3px}
.terms-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
@media(max-width:700px){.terms-toggle{position:fixed;right:14px;bottom:calc(14px + env(safe-area-inset-bottom));z-index:30;padding:10px 14px;box-shadow:0 5px 24px #14294c26}.terms-dialog{padding:23px 21px;max-height:calc(100dvh - 28px)}.terms-dialog h2{font-size:1.8rem}.terms-dialog.terms-drawer{border-radius:0;padding-bottom:calc(28px + env(safe-area-inset-bottom))}}
@media print{.terms-toggle,.terms-dialog{display:none!important}}

@media(max-width:600px){.mast{flex-wrap:wrap;gap:10px}.mast>span{display:none}.mast .terms-toggle{position:static;inset:auto;transform:none;box-shadow:none;font-size:.8rem;max-width:none;margin:0}.mast .theme-toggle{margin-left:auto}}

/* Fassung 45: Marke links, zurückhaltende Lesefunktionen rechts. */
.mast{gap:24px;padding:24px 28px;flex-wrap:nowrap}
.mast .brand{font-size:1.65rem;line-height:1.2;gap:12px;letter-spacing:-.025em;margin-right:auto}
.mast .brand img{width:44px;height:44px}
.mast .terms-toggle{order:1;display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:8px 4px;font-size:.9rem;font-weight:500;border:0;border-radius:4px;background:transparent;color:var(--muted)}
.mast .terms-toggle:before{content:"";width:16px;height:20px;flex-shrink:0;background:currentColor;clip-path:polygon(0 0,100% 0,100% 100%,50% 75%,0 100%,0 0)}
.mast .theme-toggle{order:2;display:grid;place-items:center;width:44px;height:44px;min-width:44px;padding:10px;margin:0;border:0;border-radius:50%;background:transparent;color:var(--muted)}
.mast .theme-toggle:hover,.mast .terms-toggle:hover{background:var(--blue-soft);color:var(--ink);filter:none}
.theme-toggle svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.theme-toggle .theme-sun{display:none}
.theme-toggle[data-mode="dark"] .theme-sun{display:block}
.theme-toggle[data-mode="dark"] .theme-moon{display:none}
@media(max-width:600px){.mast{display:grid;grid-template-columns:1fr 44px;gap:8px 12px;padding:18px 20px 12px}.mast .brand{font-size:1.4rem;gap:10px}.mast .brand img{width:36px;height:36px}.mast .theme-toggle{grid-column:2;grid-row:1;margin:0}.mast .terms-toggle{grid-column:1/-1;grid-row:2;justify-self:end;font-size:.85rem}}

.mast .terms-toggle{position:static;inset:auto;box-shadow:none;justify-content:center;min-width:44px;padding:8px;gap:6px;font-variant-numeric:tabular-nums}
@media(max-width:600px){.mast{grid-template-columns:1fr auto 44px;gap:8px;padding:18px 20px}.mast .brand{font-size:1.3rem}.mast .terms-toggle{grid-column:2;grid-row:1}.mast .theme-toggle{grid-column:3;grid-row:1}}

/* Glossar und Sammlung verwenden dieselben Erklärungen. */
#begriffe dt{display:flex;align-items:baseline;justify-content:space-between;gap:16px;margin-top:20px}
#begriffe .glossary-save{flex-shrink:0;padding:8px 10px;min-height:44px;font-size:.8rem;background:transparent;color:var(--violet);border:1px solid var(--line)}
#begriffe .glossary-save[aria-pressed=true]{background:var(--violet-soft)}
.terms-dialog .term-saved-list p{font-size:.9rem;margin:8px 0;color:var(--ink)}
.terms-dialog .term-copy-status{margin:10px 0;color:var(--muted);font-size:.85rem}
.term-copy-fallback{box-sizing:border-box;width:100%;min-height:180px;padding:12px;font:inherit;color:var(--ink);background:var(--paper);border:1px solid var(--line)}
