/* GAG-Artikel-Redaktion – Design nach „GAG-Dokumentdesign“
   Alle Schriften liegen in assets/fonts/ und werden vom eigenen Server geladen (kein Google-Fonts-Abruf, DSGVO):
   Poppins (Überschriften, Bedienelemente), GAG Text = Carlito-Latin-Teilmenge (Fließtext der Oberfläche),
   Source Serif 4 (Artikeltext). Alle unter der SIL Open Font License 1.1, Lizenzen liegen daneben. */
@font-face { font-family: "GAG Head"; font-weight: 300; font-display: swap; src: url("fonts/poppins-300.woff") format("woff"); }
@font-face { font-family: "GAG Head"; font-weight: 500; font-display: swap; src: url("fonts/poppins-500.woff") format("woff"); }
@font-face { font-family: "GAG Head"; font-weight: 600; font-display: swap; src: url("fonts/poppins-600.woff") format("woff"); }
@font-face { font-family: "GAG Head"; font-weight: 700; font-display: swap; src: url("fonts/poppins-700.woff") format("woff"); }
@font-face { font-family: "GAG Serif"; font-weight: 400; font-style: normal; font-display: swap; src: url("fonts/SourceSerif4-Regular.woff") format("woff"); }
@font-face { font-family: "GAG Text"; font-weight: 400; font-display: swap; src: url("fonts/gagtext-400.woff?v=2") format("woff"); }
@font-face { font-family: "GAG Text"; font-weight: 700; font-display: swap; src: url("fonts/gagtext-700.woff?v=2") format("woff"); }

:root {
  --ink: #23262b; --muted: #5d6570; --navy: #27355a; --blue: #2b6f9e; --teal: #2f9fb8;
  --green: #4f8f45; --red: #c9473d; --orange: #d9853b; --magenta: #b8467e;
  --tint1: #eef4f9; --tint2: #eef6ef; --tint3: #fbf3ea; --line: #dde2e8; --line2: #e3e7ec;
  --bg: #f5f7f9; --card: #fff;
  --head: "GAG Head", Poppins, Montserrat, Inter, "Segoe UI", system-ui, sans-serif;
  --serif: "GAG Serif", "Source Serif 4", Georgia, "Times New Roman", serif;
  --text: "GAG Text", Carlito, Lato, "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --r: 3mm;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--text); font-size: 16.5px; line-height: 1.5; hyphens: auto; }
a { color: var(--blue); }
code { font-size: .9em; background: var(--tint1); padding: 0 .3em; border-radius: 3px; }
[hidden] { display: none !important; }

/* Farbstreifen oben */
.stripe { display: flex; height: 5px; position: sticky; top: 0; z-index: 20; }
.stripe span { flex: 1; }

.page { max-width: 980px; margin: 0 auto; padding: 0 16px 40px; }
.page.wide { max-width: 1440px; }

/* Kopf */
header.top { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 0 20px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
header.top .logo img { width: 260px; max-width: 42vw; display: block; }
.titlebox { text-align: right; min-width: 0; }
.kicker { font-family: var(--head); font-weight: 500; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--blue); }
h1 { font-family: var(--head); font-weight: 700; font-size: clamp(24px, 4vw, 38px); line-height: 1.05; margin: 6px 0 5px; color: var(--navy); letter-spacing: -.01em; overflow-wrap: anywhere; }
.edition { font-family: var(--head); font-weight: 300; font-size: 14px; color: var(--muted); }

/* Navigation Admin */
.adminnav { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin: -8px 0 20px; }
.adminnav a, .linklike { font-family: var(--head); font-weight: 500; font-size: 14px; color: var(--navy); text-decoration: none; padding: 7px 12px; border-radius: 6px; background: none; border: 0; cursor: pointer; }
.adminnav a:hover, .linklike:hover { background: var(--tint1); }
.adminnav a.on { background: var(--navy); color: #fff; }
.spacer { flex: 1; }
form.inline { display: inline; }

/* Präambel */
.preamble { margin: 0 0 22px; padding: 18px 22px 18px 26px; background: var(--tint1); border-radius: var(--r); position: relative; }
.preamble::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 5px; border-radius: 0 4px 4px 0; background: var(--teal); }
.preamble p { margin: 0 0 8px; }
.preamble p:first-child { font-family: var(--head); font-weight: 500; font-size: 17px; line-height: 1.45; color: var(--navy); }
.preamble p:first-child strong { color: var(--blue); font-weight: 600; }
.preamble p:last-child { margin-bottom: 0; }

/* Karten */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 22px 24px; margin: 0 0 20px; }
.card.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.card.flush { padding: 0; overflow-x: auto; }
details.card summary { cursor: pointer; font-family: var(--head); font-weight: 600; color: var(--navy); }
details.card[open] summary { margin-bottom: 14px; }

/* Abschnittsüberschriften mit römischer Ziffer */
.sec { margin-bottom: 30px; }
.sec:last-of-type { margin-bottom: 10px; }
.sh { display: flex; align-items: center; gap: 13px; margin: 0 0 14px; }
.sh .roman { flex: none; width: 38px; height: 38px; border-radius: 8px; color: #fff; font-family: var(--head); font-weight: 700; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.sh h2, h2.plain, .section-title { font-family: var(--head); font-weight: 600; font-size: 19px; line-height: 1.25; margin: 0; color: var(--navy); }
h2.plain { margin-bottom: 14px; }
.section-title { margin: 26px 0 12px; }
.sh h2 small { display: block; font-weight: 400; font-size: 13.5px; color: var(--muted); margin-top: 2px; }
h3.sub { font-family: var(--head); font-weight: 600; font-size: 15px; color: var(--navy); margin: 20px 0 8px; }
.s1 .roman { background: var(--blue); } .s2 .roman { background: var(--green); } .s3 .roman { background: var(--orange); } .s4 .roman { background: var(--magenta); } .s5 .roman { background: var(--navy); } .s6 .roman { background: var(--teal); }
.copyrow { display: flex; gap: 8px; align-items: center; }
.copyrow input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13.5px; }
.checks-row { display: flex; flex-wrap: wrap; gap: 6px 28px; margin: 12px 0 4px; }
.grid2.hours { grid-template-columns: 1fr 1fr; gap: 0 8px; }

/* Formulare */
.lbl { display: block; font-family: var(--head); font-weight: 500; font-size: 13.5px; color: var(--navy); margin: 14px 0 5px; }
.sh + .lbl { margin-top: 0; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=url], input[type=number], input:not([type]), select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid #c9d1da; border-radius: 6px; padding: 9px 11px; }
input:focus, select:focus, textarea:focus, .crop-canvas:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
textarea { resize: vertical; line-height: 1.5; }
textarea.bodytext { min-height: 360px; font-size: 16px; }
select[size] { padding: 4px; }
select[size] option { padding: 5px 8px; border-radius: 4px; }
input.short { width: 150px; }
#teacherFilter { margin-bottom: 6px; }
.emailfield { display: flex; align-items: stretch; border: 1px solid #c9d1da; border-radius: 6px; overflow: hidden; background: #fff; }
.emailfield:focus-within { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
.emailfield input { border: 0 !important; outline: 0 !important; min-width: 0; flex: 1; }
.emailfield span { display: flex; align-items: center; padding: 0 12px; background: var(--tint1); color: var(--muted); border-left: 1px solid #c9d1da; white-space: nowrap; }
.submitter { margin: 0 0 22px; padding-bottom: 12px; border-bottom: 1px solid var(--line2); }
.check { display: inline-flex; gap: 8px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.check input { margin-top: 4px; }
.radios { display: grid; gap: 10px; margin-bottom: 8px; }
.radios .check { border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 22px; }
.grid2 > .card { margin-bottom: 20px; }
.grid2.tight { gap: 0 12px; }
.grid4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 16px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 6px; }
.toolbar button { font-family: var(--head); font-size: 13px; font-weight: 500; color: var(--navy); background: var(--tint1); border: 1px solid #d3dfea; border-radius: 6px; padding: 5px 10px; cursor: pointer; }
.toolbar button b { display: inline-block; width: 18px; height: 18px; line-height: 18px; text-align: center; border-radius: 4px; background: var(--navy); color: #fff; font-size: 11px; margin-right: 4px; }
.toolbar button:hover, .toolbar button.on { background: #dfeaf4; }
.rich { min-height: 65vh; overflow-y: auto; resize: vertical; background: #fff; border: 1px solid #c9d1da; border-radius: 6px; padding: 12px 14px; line-height: 1.55; font-size: 16.5px; hyphens: manual; position: relative; white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; }
.rich:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
.rich p { margin: 0 0 9px; }
.rich h3 { font-family: var(--head); font-weight: 600; font-size: 1.12em; line-height: 1.3; color: var(--navy); margin: 16px 0 6px; padding-left: 10px; border-left: 3px solid var(--teal); }
.rich > :first-child { margin-top: 0; }
.rich.empty::before { content: attr(data-placeholder); position: absolute; left: 15px; top: 12px; color: #98a1ab; pointer-events: none; }
.toolbar button[aria-pressed=true] { background: var(--navy); color: #fff; border-color: var(--navy); }
.toolbar button[aria-pressed=true] b { background: #fff; color: var(--navy); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; font-family: var(--head); font-weight: 600; font-size: 14.5px; padding: 9px 18px; border-radius: 7px; border: 1px solid #c9d1da; background: #fff; color: var(--navy); cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--tint1); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: #1d2947; }
.btn.danger { color: var(--red); border-color: #e6c7c3; }
.btn.danger:hover { background: #fbf1ef; }
.btn.small { font-size: 13px; padding: 5px 11px; }
.btn:disabled { opacity: .5; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 18px; }

/* Meldungen */
.flash { padding: 11px 15px; border-radius: 6px; margin: 0 0 16px; border: 1px solid; }
.flash.ok { background: var(--tint2); border-color: #c8dfc4; color: #2f5d29; }
.flash.warn { background: var(--tint3); border-color: #ecd3b4; color: #7a4a14; }
.flash.err { background: #fbf1ef; border-color: #e6c7c3; color: #8f2c24; }
.flash ul { margin: 0; padding-left: 18px; }
.note { display: flex; gap: 16px; padding: 13px 18px; border: 1.2px solid #ecd3b4; background: var(--tint3); border-radius: var(--r); margin: 0 0 16px; }
.note .lbl { flex: none; width: 170px; margin: 2px 0 0; font-weight: 600; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--orange); }
.note p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.em { font-weight: 700; color: var(--red); }
.center { text-align: center; }
.nowrap { white-space: nowrap; }

/* Fotos */
.dropzone { position: relative; border: 2px dashed #b9c7d5; border-radius: var(--r); padding: 26px; text-align: center; background: #fafcfd; transition: .15s; }
.dropzone p { margin: 3px 0; }
.dropzone.over { border-color: var(--teal); background: var(--tint1); }
.dropzone.full { opacity: .45; pointer-events: none; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin: 16px 0; }
.imgcard { margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; }
.imgcard img { display: block; width: 100%; height: auto; background: #eef1f4; }
.imgcard figcaption { padding: 9px 10px 11px; display: grid; gap: 6px; }
.imgcard figcaption input[type=text] { padding: 6px 8px; font-size: 14px; }
.imgcard.excluded img { opacity: .3; filter: grayscale(1); }
.imgcard .consent { font-size: 13.5px; line-height: 1.35; padding: 7px 8px; border-radius: 6px; background: var(--tint2); }
.imgcard.needs-consent .consent { background: var(--tint3); }
.imgcard.missing { border-color: var(--red); box-shadow: 0 0 0 2px #f3d2ce; }
.imgcard.missing .consent { background: #fbf1ef; color: #8f2c24; }
.consent-ok { color: var(--green); font-weight: 600; }
.radios.resp { margin-bottom: 12px; }
.radios.resp .check:has(input:checked) { border-color: var(--teal); background: var(--tint1); }
#teacherPick { margin: 0 0 6px 28px; }
.imgbtns { display: flex; flex-wrap: wrap; gap: 5px; }

/* Zuschneide-Dialog */
dialog.cropdlg { width: min(980px, 96vw); max-width: 96vw; border: 0; border-radius: 10px; padding: 0; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog.cropdlg::backdrop { background: rgba(20, 24, 32, .6); }
.crop-head, .crop-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 18px; }
.crop-head { justify-content: space-between; border-bottom: 1px solid var(--line); font-family: var(--head); color: var(--navy); }
.crop-foot { border-top: 1px solid var(--line); }
.crop-stage { padding: 14px; display: flex; justify-content: center; background: #2a2f38; }
.crop-canvas { display: block; touch-action: none; user-select: none; }

/* Vergleichs- und Bearbeitungsansicht */
.editor-grid { display: grid; grid-template-columns: minmax(0, var(--lfr, 1fr)) 16px minmax(0, var(--rfr, 2fr)); gap: 0; margin-bottom: 20px; align-items: start; }
.pane { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; min-width: 0; }
.pane-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--line); background: #fafbfc; border-radius: var(--r) var(--r) 0 0; font-family: var(--head); font-size: 14px; color: var(--navy); }
.pane-head select { width: auto; padding: 4px 8px; font-size: 14px; }
.paper { padding: 18px 22px; }
.paper.resizable { min-height: 65vh; overflow: auto; resize: vertical; }
.pane-left .paper.resizable { max-height: none; }
.paper .lbl:first-child { margin-top: 0; }
.paper h3 { font-family: var(--head); font-weight: 600; font-size: 1.04em; color: var(--navy); margin: 18px 0 6px; }
.paper p { margin: 0 0 10px; }
.art-title { font-family: var(--head); font-weight: 700; font-size: 1.4em; color: var(--navy); margin: 0 0 4px; line-height: 1.2; }
.meta { margin-bottom: 10px; }
del { background: #fbe1de; color: #8f2c24; text-decoration: line-through; text-decoration-color: rgba(143,44,36,.6); border-radius: 2px; }
ins { background: #dcefd8; color: #23561c; text-decoration: none; border-radius: 2px; }
.blk-del { opacity: .85; }
.chg-type { box-shadow: -4px 0 0 var(--orange); padding-left: 6px; }

/* Listen / Tabellen */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-bottom: 14px; }
.tabs a { font-family: var(--head); font-weight: 500; font-size: 14px; text-decoration: none; color: var(--navy); padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; }
.tabs a.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.tabs .search { margin-left: auto; }
.tabs .search input { width: 220px; padding: 6px 10px; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-family: var(--head); font-weight: 500; font-size: 12.5px; letter-spacing: .04em; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line); background: #fafbfc; }
table.list td { padding: 11px 14px; border-bottom: 1px solid var(--line2); vertical-align: top; }
table.list td input { padding: 5px 8px; }
table.list tr.clickable { cursor: pointer; }
table.list tr.clickable:hover td { background: #f7fafc; }
table.list a { text-decoration: none; color: var(--navy); }
table.list tr.inactive td { opacity: .55; }
table.kv { border-collapse: collapse; width: 100%; }
table.kv th { text-align: left; font-weight: 400; color: var(--muted); padding: 5px 16px 5px 0; vertical-align: top; width: 38%; font-size: 14.5px; }
table.kv td { padding: 5px 0; }
.badge { display: inline-block; font-family: var(--head); font-weight: 600; font-size: 11.5px; letter-spacing: .03em; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.st-kollege { background: var(--tint1); color: var(--blue); }
.st-schulleitung { background: #f7ecf2; color: var(--magenta); }
.st-admin { background: var(--tint3); color: #a35e1c; }
.st-fertig { background: var(--tint2); color: var(--green); }
.st-draft { background: #eee; color: var(--muted); }

.detail-top { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.timeline { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow: auto; }
.timeline li { position: relative; padding: 0 0 12px 20px; border-left: 2px solid var(--line); margin-left: 5px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--teal); }
.timeline li.bad::before { background: var(--red); }
.timeline .ts { display: block; font-size: 13px; color: var(--muted); }
.admin-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.admin-actions form { border: 1px solid var(--line2); border-radius: 8px; padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.admin-actions p { margin: 0; width: 100%; }
.admin-actions select { width: auto; max-width: 100%; }

/* Statusseite */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li { display: flex; gap: 14px; align-items: center; opacity: .55; }
.steps li.done, .steps li.current { opacity: 1; }
.steps .dot { flex: none; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--head); font-weight: 600; background: #eef1f4; color: var(--muted); }
.steps li.done .dot { background: var(--tint2); color: var(--green); }
.steps li.current .dot { background: var(--blue); color: #fff; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.checks li span { display: inline-block; width: 22px; font-weight: 700; }
.checks .ok span { color: var(--green); } .checks .no span { color: var(--red); }

footer.foot { display: flex; justify-content: space-between; border-top: 1px solid var(--line); margin-top: 30px; padding-top: 10px; font-size: 13px; color: #6b7380; }

@media (max-width: 900px) {
  .editor-grid, .detail-top { grid-template-columns: 1fr !important; gap: 18px; }
  .splitter, .widthbar { display: none !important; }
  .paper.resizable { min-height: 40vh; }
}
@media (max-width: 640px) {
  header.top { flex-direction: column; align-items: flex-start; }
  .titlebox { text-align: left; }
  .card { padding: 18px 16px; }
  .note { flex-direction: column; gap: 4px; }
  .tabs .search { margin-left: 0; width: 100%; }
  .tabs .search input { width: 100%; }
}

/* Schulleitung */
.plainlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plainlist a { font-weight: 700; color: var(--navy); text-decoration: none; }
.plainlist a:hover { text-decoration: underline; }

/* ---------- Seitenbreite ---------- */
html[data-width=weit] .page.has-widthbar { max-width: 1840px; }
html[data-width=extra] .page.has-widthbar { max-width: none; padding-left: 24px; padding-right: 24px; }
.widthbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px;
  margin: -6px 0 20px; padding: 10px 14px 10px 16px; border-radius: var(--r);
  background: linear-gradient(90deg, #e3f3f7, var(--tint1)); border: 1px solid #c6e3eb; }
.wb-hint { font-family: var(--head); font-size: 14.5px; color: var(--navy); }
.wb-icon { display: inline-block; font-size: 18px; color: var(--teal); margin-right: 4px; transform: translateY(1px); }
.seg { display: inline-flex; border: 1px solid #b8d4df; border-radius: 8px; overflow: hidden; background: #fff; }
.seg button { font-family: var(--head); font-weight: 600; font-size: 14px; color: var(--navy); background: #fff; border: 0; padding: 8px 16px; cursor: pointer; }
.seg button + button { border-left: 1px solid #b8d4df; }
.seg button:hover { background: var(--tint1); }
.seg button[aria-pressed=true] { background: var(--navy); color: #fff; }

/* ---------- Schriftgröße ---------- */
.fontctl { display: inline-flex; align-items: center; gap: 2px; font-family: var(--head); font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.fontctl .fc-lbl { margin-right: 4px; }
.fontctl button { font-family: var(--head); font-weight: 700; font-size: 13px; color: var(--navy); background: #fff; border: 1px solid #c9d1da; border-radius: 6px; width: 34px; height: 28px; cursor: pointer; }
.fontctl button:hover:not(:disabled) { background: var(--tint1); }
.fontctl button:disabled { opacity: .35; cursor: default; }
.fontctl .fs-val { min-width: 44px; text-align: center; cursor: default; user-select: none; }
.toolbar .fontctl { margin-left: auto; }
.viewtools { display: flex; justify-content: flex-end; margin: -6px 0 6px; }

/* ---------- Spaltentrenner ---------- */
.splitter { align-self: stretch; cursor: col-resize; display: flex; justify-content: center; touch-action: none; outline: none; }
.splitter span { width: 4px; margin: 40px 0; border-radius: 4px; background: #d3dbe3; transition: background .15s, width .15s; position: relative; }
.splitter span::before { content: "⋮"; position: sticky; top: 45vh; display: block; width: 18px; margin-left: -7px; padding: 6px 0;
  text-align: center; font-size: 15px; line-height: 1; color: var(--muted); background: #fff; border: 1px solid #c9d1da; border-radius: 6px; }
.splitter:hover span, .splitter:focus-visible span, .splitter.dragging span { background: var(--teal); width: 5px; }
body.col-resizing { cursor: col-resize; user-select: none; }
body.col-resizing * { cursor: col-resize !important; }

/* ---------- Foto-Fehler & Hinweise ---------- */
.photo-errors { margin-top: 12px; border-width: 2px; font-size: 15.5px; }
.photo-errors ul { margin: 6px 0 0; }
.toast { position: fixed; z-index: 100; top: 14px; left: 50%; transform: translate(-50%, -20px); opacity: 0; transition: opacity .2s, transform .2s;
  width: min(720px, calc(100vw - 24px)); display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px 14px 18px;
  border-radius: 10px; box-shadow: 0 12px 40px rgba(20,24,32,.28); font-size: 15.5px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: #fbf1ef; border: 2px solid var(--red); color: #7d241d; }
.toast.warn { background: var(--tint3); border: 2px solid var(--orange); color: #6c3f10; }
.toast-body { flex: 1; }
.toast ul { margin: 0; padding-left: 18px; }
.toast-close { flex: none; border: 0; background: none; font-size: 18px; line-height: 1; cursor: pointer; color: inherit; padding: 2px 4px; }

/* ---------- Foto-Vorschau ---------- */
.imgcard a[data-lightbox] { position: relative; display: block; cursor: zoom-in; }
.zoomhint { position: absolute; right: 8px; bottom: 8px; font-family: var(--head); font-size: 12px; font-weight: 600; color: #fff;
  background: rgba(20,24,32,.62); padding: 3px 8px; border-radius: 5px; opacity: 0; transition: opacity .15s; }
.imgcard a[data-lightbox]:hover .zoomhint, .imgcard a[data-lightbox]:focus .zoomhint { opacity: 1; }
body.lb-open { overflow: hidden; }
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(16,19,26,.9); display: grid; grid-template-columns: 64px 1fr 64px;
  grid-template-rows: auto 1fr auto; color: #fff; }
.lb-bar { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; background: rgba(0,0,0,.35); font-family: var(--head); font-size: 14px; }
.lb-info { color: #b9c2cc; font-size: 13px; }
.lb-btn { font-family: var(--head); font-weight: 600; font-size: 13.5px; color: #fff; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  border-radius: 7px; padding: 7px 12px; cursor: pointer; text-decoration: none; }
.lb-btn:hover { background: rgba(255,255,255,.22); }
.lb-btn[aria-pressed=true] { background: #fff; color: var(--navy); }
.lb-stage { grid-column: 2; grid-row: 2; display: flex; align-items: center; justify-content: center; min-height: 0; overflow: hidden; padding: 12px; }
.lb-stage img { max-width: min(100%, 1100px); max-height: min(calc(100vh - 150px), 760px); object-fit: contain; border-radius: 4px; background: #fff; cursor: zoom-in; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.lightbox.full .lb-stage { grid-column: 1 / -1; overflow: auto; display: block; text-align: center; }
.lightbox.full .lb-stage img { max-width: none; max-height: none; cursor: zoom-out; }
.lightbox.full .lb-nav { display: none; }
.lb-nav { grid-row: 2; align-self: center; justify-self: center; width: 48px; height: 64px; border: 0; border-radius: 8px; font-size: 38px; line-height: 1;
  color: #fff; background: rgba(255,255,255,.1); cursor: pointer; }
.lb-nav:hover { background: rgba(255,255,255,.22); }
.lb-prev { grid-column: 1; } .lb-next { grid-column: 3; }
.lb-caption { grid-column: 1 / -1; text-align: center; padding: 10px 16px 16px; font-size: 15px; color: #e6eaee; }
@media (max-width: 640px) {
  .lightbox { grid-template-columns: 40px 1fr 40px; }
  .lb-nav { width: 36px; font-size: 28px; }
}

/* ---------- Zweispaltige Textanzeige ----------
   ui.js setzt .wide-enough, sobald das Feld selbst mind. 820 px breit ist. */
.colctl { display: inline-flex; align-items: center; gap: 5px; font-family: var(--head); font-size: 12.5px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.colctl input { margin: 0; }
html:not([data-width]) .colctl { display: none; }
html[data-width] .two-col.wide-enough { columns: 2; column-gap: 2.6em; column-rule: 1px solid var(--line2); }
html[data-width] .two-col.wide-enough h3 { break-after: avoid; }
html[data-width] .two-col.wide-enough p { orphans: 2; widows: 2; }
html[data-width] .two-col.wide-enough > .meta, html[data-width] .two-col.wide-enough > .art-title,
html[data-width] .two-col.wide-enough > .byline, html[data-width] .two-col.wide-enough > .viewtools { column-span: all; }
html[data-width] .rich.two-col.wide-enough, html[data-width] .paper.resizable.two-col.wide-enough { resize: none; height: auto !important; }
.wc strong { color: var(--navy); font-weight: 600; }
.wc-plus { color: var(--green); font-weight: 600; }
.wc-minus { color: var(--red); font-weight: 600; }
.wc-same { color: var(--muted); }
.viewtools { gap: 14px; align-items: center; }
.viewtools .wc { margin-right: auto; }

/* ---------- Sonderzeichen-Leiste ---------- */
.charbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 8px; padding: 7px 10px; background: #fafbfc; border: 1px solid var(--line); border-radius: 6px; }
.cb-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.cb-lbl { font-family: var(--head); font-size: 11.5px; color: var(--muted); margin-right: 4px; }
.cb-char { font-family: var(--text); font-size: 16px; line-height: 1; min-width: 30px; height: 30px; padding: 0 6px; color: var(--ink);
  background: #fff; border: 1px solid #d3dbe3; border-radius: 5px; cursor: pointer; }
.cb-char:hover { background: var(--tint1); border-color: #b8cddd; }
.cb-char:active { background: #dfeaf4; }
.cb-shift { margin-left: auto; font-family: var(--head); font-size: 12.5px; font-weight: 600; color: var(--navy); background: #fff;
  border: 1px solid #c9d1da; border-radius: 6px; padding: 5px 10px; cursor: pointer; }
.cb-shift[aria-pressed=true] { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---------- Links und rechts auf gleicher Höhe ----------
   Beide Spalten teilen sich die Zeilen des Rasters (subgrid): Kopfzeilen gleich hoch,
   darunter jeweils Kopfzeile · Titel · Autorenzeile · Text in identischen Abständen. */
.editor-grid { grid-template-rows: auto auto; }
.editor-grid > .pane { display: grid; grid-row: span 2; grid-template-rows: subgrid; row-gap: 0; }
.editor-grid > .splitter { grid-row: 1 / span 2; }
.pane-head { min-height: 52px; }
.pane-head .toolbar { margin: 0; flex: 1; position: relative; }

/* Bearbeitbares „Dokument“ rechts */
.paper.doc { font-size: 16.5px; }
.paper.doc:focus-within { box-shadow: inset 0 0 0 2px #cfe8ee; border-radius: 0 0 var(--r) var(--r); }
.doc-title, .doc-byline { display: block; width: 100%; border: 0 !important; outline: 0 !important; padding: 0 !important; background: transparent;
  border-radius: 0; box-shadow: inset 0 -1px 0 transparent; transition: box-shadow .15s, background .15s; }
.paper.doc input.doc-title { font-family: var(--head); font-weight: 700; font-size: 1.4em; line-height: 1.2; color: var(--navy); margin: 0 0 4px; }
.paper.doc input.doc-byline { font-family: var(--text); font-size: 1em; line-height: 1.5; color: var(--muted); margin: 0 0 10px; }
.doc-title:hover, .doc-byline:hover { box-shadow: inset 0 -1px 0 #c9d1da; }
.doc-title:focus, .doc-byline:focus { box-shadow: inset 0 -2px 0 var(--teal); background: #f7fbfc; }
.doc-title::placeholder, .doc-byline::placeholder { color: #a7b0ba; font-weight: 400; }
.paper.doc .rich { border: 0; border-radius: 0; padding: 0; min-height: 60vh; font-size: 1em; outline: none; }
.paper.doc .rich:focus { outline: none; border: 0; }
.paper.doc .rich.empty::before { left: 0; top: 0; }
#cmpView .meta, .paper.doc .meta, #curView .meta { margin-bottom: 10px; line-height: 1.5; min-height: 1.5em; }
.rich { font-size: 16.5px; }
.paper.doc .rich { font-size: 1em; line-height: 1.5; }

/* Werkzeuge & Sonderzeichen */
.toolbar { position: relative; }
.toolbar button.tb-chars { font-family: var(--head); font-size: 13px; font-weight: 500; color: var(--navy); background: #fff; border: 1px solid #d3dfea; border-radius: 6px; padding: 5px 10px; cursor: pointer; }
.toolbar button.tb-chars.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.tb-help { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid #c9d1da;
  font-family: var(--head); font-size: 12px; font-weight: 700; color: var(--muted); cursor: help; background: #fff; }
.tb-hint { margin: 0 0 6px; }
.charbar { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0; margin: 0; background: #fff;
  box-shadow: 0 12px 32px rgba(20,24,32,.18); border-color: #c9d1da; }
.pane-head .charbar { left: -16px; right: -16px; top: calc(100% + 10px); }
.cb-end { margin-left: auto; display: inline-flex; gap: 6px; }
.cb-shift { margin-left: 0; }
.cb-close { font-size: 14px; line-height: 1; border: 1px solid #c9d1da; background: #fff; border-radius: 6px; padding: 5px 9px; cursor: pointer; color: var(--muted); }
.cb-close:hover { background: #fbf1ef; color: var(--red); }
.editor-grid > .pane-left { grid-column: 1; }
.editor-grid > .splitter { grid-column: 2; }
.editor-grid > .pane-right { grid-column: 3; }
@media (max-width: 900px) {
  .editor-grid { grid-template-rows: none; }
  .editor-grid > .pane-left, .editor-grid > .pane-right { grid-column: 1; grid-row: auto; display: flex; flex-direction: column; }
}

/* ---------- Typografie-Prüfung beim Einreichen ---------- */
dialog.typodlg { width: min(860px, 96vw); max-height: 90vh; border: 0; border-radius: 10px; padding: 0; box-shadow: 0 20px 60px rgba(0,0,0,.35); display: none; }
dialog.typodlg[open] { display: flex; flex-direction: column; }
dialog.typodlg::backdrop { background: rgba(20,24,32,.55); }
.ty-head { display: flex; flex-wrap: wrap; gap: 10px 20px; justify-content: space-between; align-items: flex-start; padding: 16px 20px 12px; border-bottom: 1px solid var(--line); }
.ty-head > div > strong { font-family: var(--head); font-size: 18px; color: var(--navy); }
.ty-head p strong { color: var(--navy); }
.ty-head p { margin: 4px 0 0; max-width: 560px; }
.ty-all { display: flex; gap: 6px; }
.ty-list { list-style: none; margin: 0; padding: 8px 20px; overflow-y: auto; flex: 1; counter-reset: ty; }
.ty-item { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line2); }
.ty-meta { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.ty-kind { font-family: var(--head); font-weight: 600; font-size: 11.5px; padding: 2px 8px; border-radius: 999px; }
.ty-kind.quote { background: var(--tint1); color: var(--blue); }
.ty-kind.dash { background: #f7ecf2; color: var(--magenta); }
.ty-kind.apos { background: var(--tint3); color: #a35e1c; }
.ty-swap code { font-size: 15px; background: #fff; border: 1px solid #d3dbe3; padding: 0 6px; border-radius: 4px; }
.ty-snip { font-size: 16px; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; }
.ty-mark { border-radius: 3px; padding: 0 2px; font-weight: 700; }
.ty-item.accepted .ty-mark { background: #c9ecc3; color: #1d5a16; box-shadow: 0 0 0 1px #8fcf85; }
.ty-item.accepted .ty-old { display: none; }
.ty-item.rejected .ty-mark { background: #f3dcd9; color: #8f2c24; }
.ty-item.rejected .ty-new { display: none; }
.ty-btns { display: inline-flex; border: 1px solid #c9d1da; border-radius: 7px; overflow: hidden; }
.ty-btns button { font-family: var(--head); font-weight: 600; font-size: 13px; border: 0; background: #fff; color: var(--navy); padding: 6px 11px; cursor: pointer; }
.ty-btns button + button { border-left: 1px solid #c9d1da; }
.ty-btns .ty-yes[aria-pressed=true] { background: var(--green); color: #fff; }
.ty-btns .ty-no[aria-pressed=true] { background: var(--red); color: #fff; }
.ty-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line); background: #fafbfc; border-radius: 0 0 10px 10px; }
@media (max-width: 640px) { .ty-item { grid-template-columns: 1fr; } }

.exception-on input { border-color: var(--orange); background: var(--tint3); }

/* ---------- Beitragsbild ---------- */
.feature-badge { display: inline-block; font-family: var(--head); font-weight: 700; font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: #fff; background: var(--teal); padding: 3px 10px; border-radius: 5px; white-space: nowrap; }
.extra-badge { display: inline-block; font-family: var(--head); font-weight: 500; font-size: 11.5px; color: var(--muted); background: #eef1f4;
  padding: 2px 9px; border-radius: 5px; }
.feature-hint { display: flex; gap: 14px; align-items: flex-start; padding: 12px 16px; margin: 0 0 14px; border: 1.5px solid #bfe3ec;
  background: #eef8fa; border-radius: var(--r); }
.feature-hint p { margin: 0; font-size: 15px; }
.feat-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 8px 10px; background: #eef8fa; border-bottom: 1px solid #bfe3ec;
  font-size: 12.5px; color: #1f6f80; line-height: 1.35; }
.feat-head.extra { background: #fafbfc; border-bottom-color: var(--line2); }
.imgcard.featured { border: 3px solid var(--teal); box-shadow: 0 4px 16px rgba(47,159,184,.18); }
.imgs .imgcard.featured { grid-column: span 2; }
@media (max-width: 640px) { .imgs .imgcard.featured { grid-column: auto; } }
.dropzone.missing { border-color: var(--red); background: #fbf1ef; }

.feat-pick { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-family: var(--head); font-size: 12px; font-weight: 500;
  color: var(--navy); cursor: pointer; white-space: nowrap; }
.feat-pick input { margin: 0; }
.imgcard.featured .feat-pick { color: #1f6f80; font-weight: 600; }
.feat-pick:has(input:disabled) { opacity: .4; cursor: not-allowed; }

/* ---------- Seite aus PDF wählen ---------- */
dialog.pdfdlg { width: min(1000px, 96vw); max-height: 90vh; border: 0; border-radius: 10px; padding: 0; box-shadow: 0 20px 60px rgba(0,0,0,.35); display: none; }
dialog.pdfdlg[open] { display: flex; flex-direction: column; }
dialog.pdfdlg::backdrop { background: rgba(20,24,32,.6); }
.pdf-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 14px 20px 6px; }
.pdf-head strong { font-family: var(--head); font-size: 18px; color: var(--navy); }
.pdf-head p { margin: 2px 0 0; }
.pdf-hint { margin: 0; padding: 0 20px 12px; border-bottom: 1px solid var(--line); }
.pdf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; padding: 16px 20px 20px; overflow-y: auto; background: #f1f3f6; flex: 1; }
.pdf-page { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; background: #fff; border: 2px solid transparent; border-radius: 8px;
  cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.08); font: inherit; }
.pdf-page:hover, .pdf-page:focus-visible { border-color: var(--teal); outline: none; box-shadow: 0 4px 14px rgba(47,159,184,.25); }
.pdf-thumb { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 3 / 4; background: #fafbfc; }
.pdf-thumb canvas { max-width: 100%; max-height: 100%; box-shadow: 0 0 0 1px #e3e7ec; }
.pdf-page:not(.ready) .pdf-thumb { background: repeating-linear-gradient(45deg, #f4f6f8, #f4f6f8 8px, #eef1f4 8px, #eef1f4 16px); }
.pdf-no { font-family: var(--head); font-size: 13px; font-weight: 500; color: var(--navy); }
.pdf-busy { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px; background: rgba(255,255,255,.85);
  font-family: var(--head); color: var(--navy); border-radius: 10px; }
.pdf-busy[hidden] { display: none; }
.spinner { width: 22px; height: 22px; border: 3px solid #cfe8ee; border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Links ---------- */
.toolbar button.tb-link { display: inline-flex; align-items: center; gap: 5px; font-family: var(--head); font-size: 13px; font-weight: 500; color: var(--navy);
  background: #fff; border: 1px solid #d3dfea; border-radius: 6px; padding: 5px 10px; cursor: pointer; }
.toolbar button.tb-link:hover { background: var(--tint1); }
.rich a, .paper a, .ty-snip a { color: var(--blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.rich a { cursor: text; background: #eef6fb; border-radius: 2px; }
ins a { color: inherit; } del a { color: inherit; }
dialog.linkdlg { width: min(520px, 94vw); border: 0; border-radius: 10px; padding: 18px 20px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog.linkdlg::backdrop { background: rgba(20,24,32,.5); }
.ld-head strong { font-family: var(--head); font-size: 18px; color: var(--navy); }
.ld-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 16px; }
.ld-err { margin: 8px 0 0; }

/* ---------- Anmerkungen der Stufen ---------- */
.notes { display: grid; gap: 10px; margin: 0 0 18px; }
.notes .note { margin: 0; border-left-width: 5px; }
.note-original { border-color: #bcd6ea !important; background: var(--tint1) !important; }
.note-original .lbl { color: var(--blue) !important; }
.note-kollege { border-color: #c8dfc4 !important; background: var(--tint2) !important; }
.note-kollege .lbl { color: var(--green) !important; }
.note-schulleitung { border-color: #e7c6d7 !important; background: #f9eff4 !important; }
.note-schulleitung .lbl { color: var(--magenta) !important; }

.addr-result { margin-top: 12px; }
.addr-result ul { margin: 6px 0 0; padding-left: 18px; list-style: none; }
.addr-result li { margin: 2px 0; }

/* ---------- Artikeltext in Serifenschrift (Anführungszeichen, Apostrophe und Striche gut unterscheidbar) ---------- */
.rich, .paper, .ty-snip, .ty-swap code, .cb-char, .typo-sample { font-family: var(--serif); }
.rich, .paper.doc .rich { font-size: 17px; line-height: 1.55; }
.paper { font-size: 17px; line-height: 1.55; }
.paper .meta, .paper .byline, .paper .viewtools, .paper .lbl, .paper .muted.small, .paper .wc { font-family: var(--text); }
.paper .byline { line-height: 1.5; }
.ty-swap code { font-size: 17px; }
.toolbar .cb-char, .cb-char { font-family: var(--serif); font-weight: 400; font-size: 23px; line-height: 1; min-width: 38px; height: 40px; padding: 0 6px;
  border-radius: 6px; background: #fff; border: 1px solid #d3dbe3; color: var(--ink); }
.toolbar .cb-char:hover { background: var(--tint1); border-color: #b8cddd; }
.toolbar .cb-char:active { background: #dfeaf4; }
.cb-group { gap: 3px; }
.cb-lbl { font-size: 12.5px; }
@media (max-width: 600px) { .toolbar .cb-char { font-size: 22px; min-width: 38px; height: 38px; } }

/* ---------- Textauszeichnung: hellblauer Textmarker ---------- */
:root { --marker: #c9e7f7; }
.rich mark, .paper mark, .ty-snip mark { background: linear-gradient(transparent 8%, var(--marker) 8%, var(--marker) 92%, transparent 92%);
  color: inherit; padding: 0 .12em; margin: 0 -.04em; border-radius: .25em;
  -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.rich mark a, .paper mark a { color: inherit; }
.paper del mark { opacity: .75; }
.toolbar button.tb-mark { display: inline-flex; align-items: center; gap: 6px; }
.tb-mark-ico { display: inline-block; font-family: var(--serif); font-size: 13px; line-height: 1; padding: 2px 4px; border-radius: 3px; background: var(--marker); color: var(--navy); }
.toolbar button.tb-mark[aria-pressed=true] .tb-mark-ico { background: #fff; }
.paper .mk-chg { border-bottom: 2px dashed var(--magenta); }
#cmpView mark { padding: 0; margin: 0; border-radius: 0; }

/* ---------- Fotonamen und Zuschneiden ---------- */
.imgname { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13.5px; }
.imgname-lbl { font-family: var(--head); font-weight: 500; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.imgname .auto-name { font-weight: 600; color: var(--navy); overflow-wrap: anywhere; }
.imgname input[type=text] { flex: 1 1 180px; min-width: 0; }
.imgname .check { margin-left: auto; color: var(--muted); }
.imgbtns .check { margin-left: auto; align-self: center; }
.crop-ok { color: var(--green); font-weight: 600; }
.crop-note { margin: 0; padding: 7px 9px; border-radius: 6px; background: #fbf1ef; color: #8f2c24; font-weight: 600; }
.crop-hint { margin: 0; padding: 8px 16px; font-size: 13.5px; background: var(--tint1); color: var(--navy); border-bottom: 1px solid var(--line); }
.crop-hint.must { background: #eef8fa; color: #1f6f80; font-weight: 600; }
.imgcard a[data-lightbox] img { max-height: 380px; object-fit: contain; }
.feature-hint p + p { margin-top: 6px; }
.crop-foot > .muted { flex: 1 1 220px; } .crop-foot > .spacer { display: none; }

/* ---------- Kein Foto: Hintergrundmuster mit Akzentfarbe und Stichwort ---------- */
.nophoto { margin: 12px 0; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; }
.nophoto > .check { font-size: 14.5px; }
.patterns { margin-top: 12px; }
.patterns > p { margin: 10px 0 0; }
.patpick { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px 20px; align-items: start; }
.imgcard .patpick, .pat-edit .patpick { grid-template-columns: 1fr; }
@media (max-width: 760px) { .patpick { grid-template-columns: 1fr; } }
.pat-preview { width: 100%; height: auto; display: block; border-radius: 8px; box-shadow: 0 0 0 1px var(--line), 0 6px 18px rgba(20,24,32,.10); }
.pat-lbl { display: block; font-family: var(--head); font-weight: 500; font-size: 13px; color: var(--navy); margin: 0 0 6px; }
.pat-opts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.pat-key, .pat-color { position: relative; cursor: pointer; }
.pat-key input, .pat-color input { position: absolute; opacity: 0; pointer-events: none; }
.pat-key { display: grid; gap: 3px; justify-items: center; font-size: 12.5px; color: var(--muted); }
.pat-key canvas { width: 72px; height: 48px; border-radius: 5px; border: 2px solid transparent; box-shadow: 0 0 0 1px var(--line); }
.pat-key input:checked + canvas { border-color: var(--teal); box-shadow: 0 3px 10px rgba(47,159,184,.3); }
.pat-key input:checked ~ span { color: var(--navy); font-weight: 600; }
.pat-color span { display: block; width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); border: 3px solid #fff; outline: 2px solid transparent; }
.pat-color em { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.pat-color input:checked + span { outline-color: var(--navy); }
.pat-key input:focus-visible + canvas, .pat-color input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 2px; }
.pat-text { display: flex; gap: 8px; align-items: center; }
.pat-text input { flex: 1; }
.patpick input:disabled ~ * { opacity: 1; }
.pat-edit { margin: 2px 0; }
.pat-edit summary { cursor: pointer; font-family: var(--head); font-weight: 500; font-size: 13.5px; color: var(--navy); }
.pat-edit[open] summary { margin-bottom: 8px; }
.pattern-note { color: var(--teal); font-weight: 600; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 18px; }
.chip { display: inline-block; font-family: var(--head); font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--tint3); color: #8a5a1e; vertical-align: middle; }
.chip.test { background: #fbf1ef; color: #8f2c24; }
.test-on ul { margin: 6px 0 0; padding-left: 18px; }
.trust-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 18px; margin: 8px 0; }
.trust-list .check { padding: 6px 8px; border-radius: 6px; font-size: 14.5px; }
.trust-list .check:has(input:checked) { background: var(--tint2); }
.trust-filter { max-width: 360px; }
.chip.ok { background: var(--tint2); color: #2f6a28; }
.trust-list .check[hidden] { display: none; }
.is-off { opacity: .4; pointer-events: none; filter: grayscale(1); }
details.holidays { margin: 14px 0 6px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: #fafbfc; }
details.holidays summary { cursor: pointer; font-family: var(--head); font-weight: 500; font-size: 14px; color: var(--navy); }
details.holidays textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.crop-modes { display: flex; gap: 0; padding: 10px 16px 0; }
.crop-modes button { font-family: var(--head); font-size: 13.5px; font-weight: 500; padding: 7px 14px; border: 1px solid #c9d1da; background: #fff; color: var(--navy); cursor: pointer; }
.crop-modes button:first-child { border-radius: 7px 0 0 7px; }
.crop-modes button:last-child { border-radius: 0 7px 7px 0; border-left: 0; }
.crop-modes button[aria-pressed=true] { background: var(--navy); color: #fff; border-color: var(--navy); }
.crop-modes + .crop-hint { margin-top: 10px; }
.blur-ok { color: #5b4b8a; font-weight: 600; }
.blur-pending { margin: 0; padding: 7px 9px; border-radius: 6px; background: #f1eef9; color: #4a3d78; font-weight: 600; }
.bulk-head, .bulk-foot { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; padding: 12px 16px; }
.bulk-head { border-bottom: 1px solid var(--line); position: sticky; top: 5px; z-index: 5; background: #fff; border-radius: var(--r) var(--r) 0 0; }
.bulk-head input[type=search] { max-width: 300px; }
.bulk-foot { border-top: 1px solid var(--line); }
.teacher-bulk tr.changed td { background: #fff8e6; }
.teacher-bulk select.anrede { min-width: 76px; }
.teacher-bulk select.anrede.empty { border-color: #e0a43c; background: #fffaf0; }
.teacher-bulk tbody tr[hidden] { display: none; }

/* Ablage auf dem Laufwerk (Artikelseite) */
.dav-state { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line2); display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.dav-state code { font-size: .92em; word-break: break-all; }
.dav-state .ok-text { color: var(--green); font-weight: 600; }
.dav-state form.inline { margin-left: auto; }
code.nowrap { white-space: nowrap; }

/* Rückfrage der Schulleitung */
.st-rueckfrage { background: #fbf1e6; color: #a35a12; }
.rueck-box { margin: 12px 0; padding: 12px 16px; background: #fdf6ec; border-left: 4px solid var(--orange); border-radius: 4px; }
.rueck-box .lbl { font-family: var(--head); font-size: 12px; font-weight: 600; color: #a35a12; margin: 0 0 4px; }
.rueck-box blockquote { margin: 0 0 4px; font-size: 1.02em; white-space: normal; }
.rueck-quote { margin: 4px 0; padding-left: 8px; border-left: 3px solid var(--orange); }
.decision h2.plain { margin-top: 6px; }
.dec-options { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 14px; }
@media (max-width: 760px) { .dec-options { grid-template-columns: 1fr; } }
.dec-opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 2px solid var(--line); border-radius: 8px; cursor: pointer; background: #fff; }
.dec-opt input { margin-top: 4px; accent-color: var(--navy); }
.dec-opt > span { display: flex; flex-direction: column; gap: 2px; }
.dec-opt strong { font-family: var(--head); font-weight: 600; color: var(--navy); }
.dec-ok:has(input:checked) { border-color: var(--green); background: var(--tint2); }
.dec-ok:has(input:checked) strong { color: #2f6a28; }
.dec-back:has(input:checked) { border-color: var(--orange); background: #fdf6ec; }
.dec-back:has(input:checked) strong { color: #a35a12; }
.dec-back-box { margin: 0 0 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.chip-add { font: inherit; font-size: 13px; padding: 4px 10px; border-radius: 999px; border: 1px solid #e6cfae; background: #fff; color: #7a4a14; cursor: pointer; }
.chip-add:hover { background: #fdf6ec; }
.chip-add.on { background: var(--orange); border-color: var(--orange); color: #fff; }
textarea.need { border-color: var(--red); box-shadow: 0 0 0 3px #f6dcd8; }
.btn.primary.warnbtn { background: #b9661b; border-color: #b9661b; }
.btn.primary.warnbtn:hover { background: #9c5413; }

/* Entwürfe und Presse-Link */
.st-entwurf { background: #eef1f6; color: #4a5672; }
.draft-note { margin-bottom: 14px; }
.draft-hint { margin-top: 10px; }
.draft-discard { margin: -6px 0 24px; text-align: right; }
.stored-head { margin: 18px 0 8px; font-size: 1.02em; }
.press-head { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.press-head h2 { margin: 0; }
.press-head .actions { margin: 0; }
.press-text .paper { border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.press-actions { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 6px; }

/* Beitragsbild zuschneiden: fester Rahmen, Vorschau-Rahmen der Website */
.crop-stage.fc-stage { flex-direction: column; align-items: center; gap: 10px; padding: 12px 14px 14px; }
.fc-tabs { display: flex; flex-wrap: wrap; justify-content: center; }
.fc-tabs button { font-family: var(--head); font-size: 13px; font-weight: 500; padding: 6px 12px; border: 1px solid #56607a; background: #3a4150; color: #e8ecf3; cursor: pointer; margin-left: -1px; }
.fc-tabs button:first-child { border-radius: 7px 0 0 7px; margin-left: 0; }
.fc-tabs button:last-child { border-radius: 0 7px 7px 0; }
.fc-tabs button[aria-pressed=true] { background: #fff; color: var(--navy); border-color: #fff; font-weight: 600; }
.fc-view { line-height: 0; box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
.fc-canvas { cursor: grab; }
.fc-canvas.grabbing { cursor: grabbing; }
.fc-zoom { display: flex; align-items: center; gap: 10px; width: min(100%, 560px); color: #e8ecf3; font-family: var(--head); font-size: 18px; }
.fc-zoom input[type=range] { flex: 1; min-width: 0; padding: 0; border: 0; background: transparent; accent-color: #3fd6f0; height: 28px; }
.fc-zoom .btn.small { white-space: nowrap; }
.fc-note { margin: 0; color: #dfe5ee; font-size: 13.5px; text-align: center; max-width: 760px; }
.fc-warn { margin: 0; padding: 7px 12px; border-radius: 6px; background: #fff3d6; color: #6b4a00; font-size: 13.5px; max-width: 760px; }
@media (max-width: 600px) { .fc-tabs button { padding: 6px 8px; font-size: 12px; } dialog.cropdlg { width: 100vw; max-width: 100vw; } .crop-stage.fc-stage { padding: 10px 6px; } }
.size-warn { color: #a35a12; font-weight: 600; }
input.need { border-color: var(--red); box-shadow: 0 0 0 3px #f6dcd8; }
/* Beitragsbild in Originalgröße: Dialog darf den ganzen Bildschirm nutzen */
dialog.cropdlg.cropdlg-full { max-width: 99vw; max-height: 99vh; }
.cropdlg-full .crop-stage.fc-stage { padding: 10px 14px 12px; gap: 8px; }
.fc-scale { margin: 0; color: #aeb7c6; font-size: 12.5px; text-align: center; }
