/* Fotowand Lehrerzimmer – Webseite
   Farben und Schrift wie die gedruckte Fotowand (tex/fotowand-design.sty). */

@font-face { font-family: "Fotowand Sans"; font-weight: 400; font-display: swap;
  src: url("/schrift/FotowandSans-Regular.woff2") format("woff2"); }
@font-face { font-family: "Fotowand Sans"; font-weight: 600; font-display: swap;
  src: url("/schrift/FotowandSans-Semibold.woff2") format("woff2"); }
@font-face { font-family: "Fotowand Sans"; font-weight: 700; font-display: swap;
  src: url("/schrift/FotowandSans-Bold.woff2") format("woff2"); }

:root {
  --papier: #F5F2EC;
  --flaeche: #E8E3D9;
  --linie: #D6CFC2;
  --linie-stark: #B9B1A3;
  --weiss: #FFFFFF;
  --text: #1E2933;
  --textsek: #4E5A64;
  --navy: #2D3E70;
  --navy-dunkel: #223159;
  --navy-hell: #E8EBF2;
  --refkarte: #E1E5EF;
  --fehler: #A3283A;
  --fehler-hell: #FBEAEC;
  --hinweis-hell: #FFF4DB;
  --hinweis-linie: #E2B95A;
  --erfolg: #2E7D4F;
  --radius: 12px;
  --radius-klein: 8px;
  --schatten: 0 1px 2px rgba(30, 41, 51, .06), 0 2px 8px rgba(30, 41, 51, .05);
  --leiste-hoehe: 76px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--papier);
  color: var(--text);
  font-family: "Fotowand Sans", "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.6rem, 5vw, 2.1rem); font-weight: 700; letter-spacing: -.01em; }
h1:focus { outline: none; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.02rem; font-weight: 600; margin-top: 1.2em; }
p { margin: 0 0 1em; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0);
  clip-path: inset(50%); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
.leise { color: var(--textsek); }
.mittig { text-align: center; }
.klein-text { font-size: .9rem; }
[hidden] { display: none !important; }

.sprung { position: absolute; left: -999px; top: 8px; background: var(--navy); color: #fff; padding: 8px 12px;
  border-radius: var(--radius-klein); z-index: 100; }
.sprung:focus { left: 8px; }

:focus-visible { outline: 3px solid rgba(45, 62, 112, .45); outline-offset: 2px; }

/* ---------------------------------------------------------------- Kopf */
.kopf { padding: max(14px, env(safe-area-inset-top)) 16px 10px; }
.kopf-innen { max-width: 980px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 10px 24px; }
.marke { margin: 0; font-weight: 700; font-size: 1.05rem; display: flex; align-items: center; gap: 10px; }
.marke span:not(.marke-zeichen) { color: var(--navy); }
.marke-zeichen { width: 26px; height: 18px; border-radius: 3px; background: var(--weiss);
  border: 1.5px solid var(--navy); position: relative; flex: none; }
.marke-zeichen::before { content: ""; position: absolute; left: 3px; top: 3px; width: 7px; height: 9px;
  border-radius: 1.5px; background: var(--navy); }
.marke-zeichen::after { content: ""; position: absolute; left: 13px; top: 4px; width: 8px; height: 2px;
  background: var(--navy); box-shadow: 0 4px 0 var(--linie-stark); }

.fortschritt { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.fortschritt li { display: flex; align-items: center; gap: 6px; color: var(--textsek); font-size: .92rem; }
.fortschritt li + li::before { content: ""; width: 14px; height: 2px; background: var(--linie); border-radius: 1px; }
.fortschritt .nr { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; font-size: .85rem; background: var(--flaeche); color: var(--textsek); }
.fortschritt li.erledigt .nr { background: var(--navy-hell); color: var(--navy); }
.fortschritt li.aktuell .nr { background: var(--navy); color: #fff; }
.fortschritt li.aktuell { color: var(--text); font-weight: 600; }
@media (max-width: 620px) {
  .fortschritt .titel { display: none; }
  .fortschritt li.aktuell .titel { display: inline; }
}

/* ---------------------------------------------------------------- Inhalt */
main { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 18px 16px 8px; }
main:focus { outline: none; }
main.breit { max-width: 980px; }
.einleitung { color: var(--textsek); font-size: 1.08rem; }

.tafel { background: var(--weiss); border: 1px solid var(--flaeche); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--schatten); }
@media (min-width: 640px) { .tafel { padding: 26px 28px; } }

.ablauf { list-style: none; counter-reset: a; padding: 0; margin: 0 0 22px; display: grid; gap: 10px; }
.ablauf li { counter-increment: a; display: grid; grid-template-columns: 34px 1fr; column-gap: 12px;
  align-items: baseline; color: var(--textsek); }
.ablauf li::before { content: counter(a); grid-row: span 2; width: 30px; height: 30px; border-radius: 50%;
  background: var(--navy-hell); color: var(--navy); font-weight: 700; display: grid; place-items: center;
  align-self: start; }
.ablauf strong { color: var(--text); display: block; }

.einverstaendnis p { margin-bottom: .8em; }

/* ---------------------------------------------------------------- Formular */
.formular { display: grid; gap: 22px; }
.feld { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.feld > label, .feld > legend, .auswahl legend { font-weight: 600; padding: 0; }
.feldpaar { display: grid; gap: 22px; }
@media (min-width: 560px) { .feldpaar { grid-template-columns: 1fr 1fr; gap: 16px; } }
input[type=text], input:not([type]), input[type=search] {
  font: inherit; color: inherit; width: 100%; min-height: 50px; padding: 10px 14px;
  border: 1.5px solid var(--linie-stark); border-radius: var(--radius-klein); background: var(--weiss);
  -webkit-appearance: none; appearance: none;
}
input:focus { border-color: var(--navy); outline: 3px solid rgba(45, 62, 112, .18); outline-offset: 0; }
input.gross { font-size: 1.6rem; font-weight: 700; letter-spacing: .06em; max-width: 220px; text-transform: uppercase; }
input[aria-invalid=true] { border-color: var(--fehler); }
.hilfe { margin: 0; font-size: .93rem; color: var(--textsek); }
.feldfehler { margin: 0; color: var(--fehler); font-weight: 600; font-size: .95rem; }
.feldfehler:empty { display: none; }

.haken { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-weight: 400; }
.haken input { width: 24px; height: 24px; margin: 0; flex: none; accent-color: var(--navy); margin-top: 1px; }
.haken.klein { font-size: .95rem; align-items: center; }
.haken.klein input { width: 20px; height: 20px; }
.einverstaendnis .haken { padding: 14px 16px; background: var(--navy-hell); border-radius: var(--radius-klein);
  font-weight: 600; margin: 6px 0 8px; }

.auswahl { border: 0; padding: 14px 0 0; margin: 0; }
.auswahl legend { margin-bottom: 8px; }
.segmente { display: inline-flex; border: 1.5px solid var(--linie-stark); border-radius: 999px; overflow: hidden;
  background: var(--weiss); }
.segmente label { position: relative; cursor: pointer; }
.segmente input { position: absolute; opacity: 0; inset: 0; }
.segmente span { display: block; padding: 10px 18px; font-weight: 600; min-height: 46px; line-height: 26px; }
.segmente label + label span { border-left: 1.5px solid var(--linie-stark); }
.segmente input:checked + span { background: var(--navy); color: #fff; }
.segmente input:focus-visible + span { outline: 3px solid rgba(45, 62, 112, .45); outline-offset: -3px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: inherit; font-size: .98rem; min-height: 40px; padding: 6px 14px; border-radius: 999px;
  border: 1.5px solid var(--linie-stark); background: var(--weiss); color: var(--text); cursor: pointer; }
.chip[aria-pressed=true] { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip:disabled { opacity: .45; cursor: default; }
@media (hover: hover) { .chip:not(:disabled):hover { border-color: var(--navy); } }

.gewaehlt { display: flex; flex-wrap: wrap; gap: 8px; min-height: 0; }
.gewaehlt:empty::before { content: "Noch kein Fach gewählt."; color: var(--textsek); font-size: .95rem; }
.gewaehlt.leer-still:empty { display: none; }
.gewaehlt-eintrag { display: inline-flex; align-items: center; gap: 2px; background: var(--navy-hell);
  color: var(--navy); border-radius: 999px; padding: 3px 4px 3px 12px; font-weight: 600; }
.gewaehlt-eintrag .pos { font-size: .8rem; opacity: .7; margin-right: 4px; }
.gewaehlt-eintrag button { font: inherit; border: 0; background: transparent; color: var(--navy);
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 1.05rem; line-height: 1; }
.gewaehlt-eintrag button:hover { background: rgba(45, 62, 112, .12); }
.eigenes-fach { display: flex; gap: 8px; margin-top: 4px; }
.eigenes-fach input { flex: 1; min-width: 0; }

.weitere { border-top: 1px solid var(--linie); padding-top: 14px; }
.weitere summary { cursor: pointer; font-weight: 600; color: var(--navy); min-height: 32px; }
.weitere .feld { margin-top: 12px; }

/* ---------------------------------------------------------------- Knöpfe */
.knopf { font: inherit; font-weight: 600; min-height: 50px; padding: 10px 20px; border-radius: 10px;
  border: 1.5px solid transparent; cursor: pointer; display: inline-flex; align-items: center;
  justify-content: center; gap: 8px; text-align: center; text-decoration: none; user-select: none;
  -webkit-tap-highlight-color: transparent; }
.knopf.haupt { background: var(--navy); color: #fff; }
.knopf.haupt:hover { background: var(--navy-dunkel); }
.knopf.zweit { background: var(--weiss); color: var(--navy); border-color: var(--linie-stark); }
.knopf.zweit:hover { border-color: var(--navy); }
.knopf.warnend { background: var(--fehler); color: #fff; }
.knopf.klein { min-height: 42px; padding: 6px 14px; font-size: .95rem; }
.knopf:disabled, .knopf[aria-disabled=true] { opacity: .55; cursor: default; }
.knopf.laedt::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor;
  border-right-color: transparent; animation: drehen .8s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }
.textknopf { font: inherit; background: none; border: 0; padding: 6px 2px; color: var(--navy); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; min-height: 40px; }
.rund { font: inherit; font-size: 1.4rem; font-weight: 600; width: 44px; height: 44px; flex: none; border-radius: 50%;
  border: 1.5px solid var(--linie-stark); background: var(--weiss); color: var(--navy); cursor: pointer; line-height: 1; }
.rund:disabled { opacity: .45; }

/* ---------------------------------------------------------------- Weiter-Leiste
   Sitzt direkt unter dem Inhalt. Ist die Seite länger als der Bildschirm,
   schwebt sie am unteren Rand mit (position: sticky). */
.leiste { position: sticky; bottom: 0; z-index: 20; margin: 28px -16px 0;
  padding: 12px 16px max(12px, env(safe-area-inset-bottom));
  background: rgba(245, 242, 236, .94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.leiste::before { content: ""; position: absolute; left: 0; right: 0; top: -14px; height: 14px; pointer-events: none;
  background: linear-gradient(to bottom, rgba(245, 242, 236, 0), rgba(245, 242, 236, .94)); }
.leiste-innen { display: flex; gap: 12px; }
.leiste .knopf { flex: 1; }
.leiste .knopf.haupt { flex: 2; }
@media (min-width: 640px) {
  .leiste-innen { justify-content: flex-end; }
  .leiste .knopf, .leiste .knopf.haupt { flex: 0 0 auto; min-width: 170px; }
  .leiste .knopf.haupt { min-width: 230px; }
}

.fuss { text-align: center; color: var(--textsek); font-size: .9rem; padding: 8px 16px max(16px, env(safe-area-inset-bottom));
  display: flex; gap: 10px; justify-content: center; align-items: center; }
.fuss .textknopf { color: var(--textsek); }

/* ---------------------------------------------------------------- Hinweise */
.hinweis { background: var(--hinweis-hell); border-left: 4px solid var(--hinweis-linie); padding: 10px 14px;
  border-radius: 6px; font-size: .97rem; }
.fehlerkasten { background: var(--fehler-hell); border-left: 4px solid var(--fehler); color: var(--fehler);
  padding: 12px 16px; border-radius: 6px; font-weight: 600; }

/* ---------------------------------------------------------------- Foto */
.ablage { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  min-height: 280px; padding: 28px 20px; border: 2px dashed var(--linie-stark); border-radius: var(--radius);
  background: var(--weiss); cursor: pointer; text-align: center; margin-bottom: 12px; }
.ablage.drueber { border-color: var(--navy); background: var(--navy-hell); }
.ablage-symbol { width: 66px; height: 88px; border-radius: 8px; background: var(--flaeche); position: relative; }
.ablage-symbol::before { content: ""; position: absolute; left: 50%; top: 20px; width: 26px; height: 26px;
  margin-left: -13px; border-radius: 50%; background: var(--linie-stark); }
.ablage-symbol::after { content: ""; position: absolute; left: 50%; bottom: 14px; width: 46px; height: 22px;
  margin-left: -23px; border-radius: 23px 23px 4px 4px; background: var(--linie-stark); }
.ablage:focus-within { outline: 3px solid rgba(45, 62, 112, .45); outline-offset: 2px; }

.zuschnitt-raster { display: grid; gap: 18px; }
.buehne { position: relative; width: 100%; height: min(68vh, 120vw, 640px); min-height: 320px;
  background: #2A3138; border-radius: var(--radius); overflow: hidden; }
.zuschnitt-canvas { display: block; touch-action: none; cursor: grab; -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none; }
.zuschnitt-canvas.zieht { cursor: grabbing; }
.zuschnitt-canvas:focus-visible { outline: 3px solid #fff; outline-offset: -3px; }
.zuschnitt-seite { display: grid; gap: 14px; align-content: start; }
.zoom { display: flex; align-items: center; gap: 12px; }
.zoom input[type=range] { flex: 1; accent-color: var(--navy); height: 44px; }
.werkzeuge { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.werkzeuge .haken { margin-left: 4px; }
.live { background: var(--weiss); border: 1px solid var(--flaeche); border-radius: var(--radius); padding: 12px 14px 16px; }
.live p { margin: 0 0 8px; font-size: .92rem; }
#karte-live { width: 100%; max-width: 340px; }
@media (min-width: 860px) {
  .zuschnitt-raster { grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); align-items: start; }
  .buehne { height: min(72vh, 640px); }
}
.nur-touch, .nur-gross { display: none; }
@media (pointer: coarse) { .nur-touch { display: inline; } .nur-maus { display: none; } }
@media (pointer: fine) { .nur-gross { display: inline; } }

/* ---------------------------------------------------------------- Vorschau */
.vorschau-buehne { background: var(--flaeche); border-radius: var(--radius); padding: clamp(16px, 5vw, 48px);
  display: grid; place-items: center; margin-bottom: 10px; }
#karte-gross { width: 100%; max-width: 640px; }
#karte-gross .karte { box-shadow: 0 2px 4px rgba(30, 41, 51, .10), 0 10px 30px rgba(30, 41, 51, .10); }
.warnungen { display: grid; gap: 8px; margin: 14px 0; }
.warnung { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.aendern { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 16px 0 18px; }

.erfolg-zeichen { width: 76px; height: 76px; border-radius: 50%; background: var(--erfolg); margin: 20px auto 18px;
  position: relative; }
.erfolg-zeichen::after { content: ""; position: absolute; left: 27px; top: 16px; width: 18px; height: 34px;
  border: solid #fff; border-width: 0 5px 5px 0; transform: rotate(45deg); }

/* ---------------------------------------------------------------- Dialoge */
dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(640px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px); color: var(--text); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
dialog::backdrop { background: rgba(20, 26, 33, .5); }
.dialog-innen { padding: 22px 22px 20px; }
.dialog-innen p { color: var(--textsek); }
.dialog-innen form, .dialog-knoepfe { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 18px; }

/* ================================================================ Karte
   Maße exakt nach design/Fotokarte.dc.html (mm, pt). Die Karte wird in
   Originalgröße gesetzt und per transform skaliert (static/karte.js). */
.karte-rahmen { position: relative; width: 100%; }
.karte { position: absolute; left: 0; top: 0; transform-origin: 0 0; width: 85mm; height: 55mm; overflow: hidden;
  background: #FFFFFF; color: #1E2933; font-family: "Fotowand Sans", "Source Sans Pro", sans-serif;
  outline: 0.3mm solid rgba(30, 41, 51, .12); line-height: normal; -webkit-font-smoothing: antialiased; }
.karte.ref { background: #E1E5EF; }
.k-foto, .k-platzhalter { position: absolute; left: 4.5mm; top: 4.5mm; width: 34.5mm; height: 46mm; border-radius: 1.5mm; }
.k-platzhalter { background: #DAD7D1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2mm; }
.k-platzhalter .kopf { width: 9mm; height: 9mm; border-radius: 50%; background: #B7B2A9; }
.k-platzhalter .koerper { width: 18mm; height: 8mm; border-radius: 9mm 9mm 1.5mm 1.5mm; background: #B7B2A9; }
.k-text { position: absolute; left: 42.5mm; top: 4.5mm; width: 38mm; height: 46mm; display: flex; flex-direction: column; overflow: hidden; }
.k-kuerzel { font-size: 30pt; font-weight: 700; line-height: 30pt; height: 30pt; margin-top: -1.6mm; letter-spacing: .02em; white-space: nowrap; }
.k-name { font-size: 12.5pt; font-weight: 600; line-height: 14.5pt; margin-top: 2.2mm; text-wrap: pretty; }
.k-nachname { font-weight: 700; line-height: 1.05; margin-top: -1mm; }
.k-zeile { display: flex; align-items: center; gap: 2mm; margin-top: 1.6mm; white-space: nowrap; overflow: hidden; flex: none; }
.k-vorname { font-size: 11pt; line-height: 13pt; }
.k-pille { height: 4.6mm; padding: 0 1.6mm; border: 0.6pt solid #67779A; border-radius: 2.3mm; font-size: 8.5pt;
  font-weight: 700; letter-spacing: .04em; display: flex; align-items: center; box-sizing: border-box; flex: none; }
.k-faecher { font-size: 9.5pt; line-height: 11.5pt; margin-top: 1.3mm; color: #4E5A64; display: -webkit-box;
  -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-wrap: pretty; flex: none; }
.k-luecke { flex: 1; }
.k-badges { display: flex; flex-direction: column; align-items: flex-start; gap: 1.2mm; flex: none; }
.k-badge { height: 5.5mm; padding: 0 2.2mm; border-radius: 2.75mm; background: #E8EBF2; color: #2D3E70;
  font-size: 8pt; font-weight: 600; display: flex; align-items: center; white-space: nowrap; flex: none; }
.karte.ref .k-badge { background: #2D3E70; color: #FFFFFF; }
