/* Oberfläche der App. Die Seiten selbst (Anschreiben, Lebenslauf) stehen in seiten.css. */
:root {
  --papier: #f3f0ea;
  --flaeche: #fffdf9;
  --tinte: #1d2327;
  --grau: #646b70;
  --linie: #ddd6cb;
  --akzent: #1f5563;
  --akzent-hell: #e3eef0;
  --warn: #9a4a1c;
  --radius: 8px;
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  color: var(--tinte);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--papier); min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }

.kopf {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 10px 20px; background: var(--flaeche); border-bottom: 1px solid var(--linie);
}
.marke { display: flex; align-items: center; gap: 10px; }
.marke strong { display: block; font-size: 15px; }
.marke-zeichen {
  width: 34px; height: 34px; border-radius: 7px; display: grid; place-items: center;
  background: var(--akzent); color: #fff; font-family: "Source Serif 4", serif; font-weight: 700; font-size: 19px;
}
.modus { font-size: 12px; color: var(--grau); }
.modus.ki { color: var(--akzent); }
.kopf-aktionen { display: flex; gap: 8px; flex-wrap: wrap; }

.knopf {
  border: 1px solid var(--akzent); background: var(--flaeche); color: var(--akzent);
  border-radius: var(--radius); padding: 8px 14px; font-weight: 500; cursor: pointer; font-size: 14px;
}
.knopf:hover { background: var(--akzent-hell); }
.knopf.haupt { background: var(--akzent); color: #fff; }
.knopf.haupt:hover { background: #17434e; }
.knopf.leise { border-color: var(--linie); color: var(--tinte); }
.knopf.leise:hover { background: #f1ece4; }
.knopf.klein { padding: 5px 10px; font-size: 13px; }
.knopf:disabled { opacity: .55; cursor: progress; }
.knopf:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [role=tab]:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }

.arbeitsflaeche { display: grid; grid-template-columns: minmax(380px, 560px) 1fr; gap: 0; align-items: start; }
.eingabe { border-right: 1px solid var(--linie); background: var(--flaeche); min-height: calc(100vh - var(--kopf-h, 58px)); }
.reiter { display: flex; position: sticky; top: var(--kopf-h, 58px); z-index: 10; background: var(--flaeche); border-bottom: 1px solid var(--linie); overflow-x: auto; }
.reiter button { flex: 1; border: 0; background: none; padding: 12px 8px; cursor: pointer; font-size: 13.5px; color: var(--grau); border-bottom: 2px solid transparent; white-space: nowrap; }
.reiter button.aktiv { color: var(--tinte); border-bottom-color: var(--akzent); font-weight: 600; }
.tafel { display: none; padding: 8px 20px 40px; }
.tafel.aktiv { display: block; }

fieldset { border: 0; border-top: 1px solid var(--linie); margin: 0; padding: 16px 0 18px; }
fieldset:first-child { border-top: 0; }
legend { font-weight: 600; font-size: 14px; padding: 0 0 10px; }
legend small, label small { font-weight: 400; color: var(--grau); }
.raster { display: grid; gap: 10px 12px; }
.raster.zwei { grid-template-columns: 1fr 1fr; }
.raster.vier { grid-template-columns: repeat(4, 1fr); }
.raster .breit, .raster .voll { grid-column: 1 / -1; }
.raster .doppelt { grid-column: span 2; }
.raster .dreifach { grid-column: span 3; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: #3b4246; }
input, select, textarea {
  width: 100%; border: 1px solid var(--linie); border-radius: 6px; background: #fff;
  padding: 7px 9px; font-size: 14px;
}
textarea { resize: vertical; line-height: 1.45; }
label.schalter { flex-direction: row; align-items: center; gap: 8px; font-size: 14px; color: var(--tinte); }
label.schalter input { width: auto; }
.hinweis { font-size: 13px; color: var(--grau); margin: 0 0 8px; line-height: 1.45; }
.hinweis.klein { font-size: 12px; margin-top: 8px; }
.hinweis.warn { color: var(--warn); }

.liste { display: flex; flex-direction: column; gap: 10px; margin-bottom: 10px; }
.eintrag { position: relative; border: 1px solid var(--linie); border-radius: var(--radius); padding: 10px 10px 10px 10px; background: #fcfaf6; }
.eintrag .raster { padding-right: 30px; }
.eintrag-knoepfe { position: absolute; top: 8px; right: 6px; display: flex; flex-direction: column; gap: 2px; }
.eintrag-knoepfe button { border: 0; background: none; cursor: pointer; color: var(--grau); width: 24px; height: 22px; border-radius: 4px; }
.eintrag-knoepfe button:hover { background: #ece6dc; color: var(--tinte); }

.ablage {
  border: 1.5px dashed #c4baab; border-radius: var(--radius); padding: 22px 12px; text-align: center;
  cursor: pointer; background: #fbf8f3; color: var(--grau); font-size: 13.5px; line-height: 1.5;
}
.ablage:hover, .ablage.ueber { border-color: var(--akzent); color: var(--akzent); }
.klein-ablage { padding: 12px; }
.foto-bereich { display: grid; gap: 14px; }
.foto-regler { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; margin-top: 10px; align-items: end; }
.foto-regler input[type=range] { padding: 0; border: 0; accent-color: var(--akzent); }
.stil-raster { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stil-karte { border: 2px solid transparent; border-radius: var(--radius); background: #fff; padding: 4px 4px 6px; cursor: pointer; display: flex; flex-direction: column; gap: 4px; align-items: center; font-size: 12px; }
.stil-karte canvas { width: 100%; height: auto; border-radius: 5px; background: #eee; }
.stil-karte.aktiv { border-color: var(--akzent); background: var(--akzent-hell); font-weight: 600; }
.unterschrift-vorschau { display: flex; align-items: center; gap: 8px; }
.unterschrift-vorschau img { max-height: 54px; max-width: 200px; }

.layout-wahl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.layout-karte { border: 1.5px solid var(--linie); border-radius: var(--radius); padding: 8px; cursor: pointer; gap: 6px; background: #fff; }
.layout-karte input { position: absolute; opacity: 0; pointer-events: none; }
.layout-karte.gewaehlt, .layout-karte:has(input:checked) { border-color: var(--akzent); background: var(--akzent-hell); }
.layout-karte:has(input:focus-visible) { outline: 2px solid var(--akzent); outline-offset: 2px; }
.layout-karte strong { font-size: 13.5px; color: var(--tinte); }
.layout-karte small { font-size: 11.5px; line-height: 1.35; }
.mini-vorschau { display: block; position: relative; width: 100%; aspect-ratio: 210 / 297; overflow: hidden; background: #fff; border: 1px solid #e3ddd3; border-radius: 3px; }
.mini-vorschau .seite { position: absolute; top: 0; left: 0; transform-origin: top left; pointer-events: none; }

.vorschau { position: sticky; top: var(--kopf-h, 58px); height: calc(100vh - var(--kopf-h, 58px)); overflow: auto; padding: 0 24px 40px; }
.vorschau-leiste { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; align-items: center; padding: 12px 0; background: var(--papier); font-size: 13px; color: var(--grau); }
.zoom { display: flex; gap: 6px; }
.seiten { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.seiten-rahmen { box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 8px 28px rgba(40,30,20,.12); background: #fff; overflow: hidden; flex: none; }
.seiten-rahmen .seite { transform-origin: top left; }

#export-buehne { position: fixed; left: -12000px; top: 0; }

.meldung {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 50;
  background: var(--tinte); color: #fff; padding: 10px 16px; border-radius: var(--radius); font-size: 14px; max-width: min(560px, 92vw);
  box-shadow: 0 6px 24px rgba(0,0,0,.2);
}
.meldung.fehler { background: #8c2f17; }

/* Onlinebetrieb (Zugangscode): Elemente nur für den jeweiligen Betrieb */
html:not([data-online]) [data-nur-online], html[data-online] [data-nur-lokal] { display: none !important; }
.einwilligung { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0 10px; font-size: 13px; line-height: 1.4; }
.einwilligung input { margin-top: 2px; flex: none; }
.anmelden-feld { display: grid; gap: 6px; margin: 14px 0 4px; font-weight: 600; }
.anmelden-feld input { font: 600 18px/1.2 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .08em; text-transform: uppercase; }
#anmelden-fehler:empty { display: none; }
.fuss-links { display: flex; gap: 16px; justify-content: center; padding: 10px 16px 18px; font-size: 12px; }
.fuss-links a, #anmelden-rechtliches a { color: inherit; }
dialog { border: 0; border-radius: 12px; padding: 20px; width: min(480px, 92vw); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(20,20,20,.35); }
dialog h2 { margin: 0 0 12px; font-size: 18px; }
.profil-liste { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; max-height: 300px; overflow: auto; }
.profil-liste button { text-align: left; }
.dlg-aktionen { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }

@media (max-width: 980px) {
  .arbeitsflaeche { grid-template-columns: minmax(0, 1fr); } /* sonst drückt die Reiterleiste die Seite breiter als das Handy */
  .eingabe { border-right: 0; min-height: 0; }
  .vorschau { position: static; height: auto; padding: 0 16px 40px; }
  .kopf { padding: 10px 16px; }
  .tafel { padding: 8px 16px 32px; }
}
@media (max-width: 520px) {
  .raster.zwei { grid-template-columns: 1fr; }
  .raster.vier { grid-template-columns: 1fr 1fr; }
  .stil-raster { grid-template-columns: repeat(2, 1fr); }
  .layout-wahl { grid-template-columns: 1fr 1fr; }
  .foto-regler { grid-template-columns: 1fr; }
}

@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  .kopf, .eingabe, .vorschau-leiste, #export-buehne, .meldung { display: none !important; }
  .arbeitsflaeche { display: block; }
  .vorschau { position: static; height: auto; overflow: visible; padding: 0; }
  .seiten { gap: 0; display: block; }
  .seiten-rahmen { box-shadow: none; width: auto !important; height: auto !important; break-after: page; }
  .seiten-rahmen .seite { transform: none !important; }
}
#seiten-info.warn { color: var(--warn); font-weight: 600; }

.ki-foto { margin-top: 16px; padding: 14px; border: 1px solid var(--linie); border-radius: var(--radius); background: #fbf8f3; }
.ki-foto h4 { margin: 0 0 6px; font-size: 14px; }
.ki-foto h4 small { font-weight: 400; color: var(--grau); }
.ki-foto .raster { margin: 10px 0; }
.ki-galerie { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.ki-galerie:empty { display: none; }
.ki-bild { position: relative; border: 2px solid transparent; border-radius: var(--radius); padding: 3px; background: #fff; cursor: pointer; }
.ki-bild img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 5px; display: block; }
.ki-bild.aktiv { border-color: var(--akzent); background: var(--akzent-hell); }
.ki-bild span { display: block; font-size: 11px; text-align: center; padding-top: 3px; color: var(--grau); }
.ki-bild button { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; cursor: pointer; font-size: 12px; line-height: 22px; padding: 0; }
.auslesen-zeile { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
@media (max-width: 520px) { .ki-galerie { grid-template-columns: repeat(2, 1fr); } }

.zurueck-wahl { display: flex; flex-direction: column; gap: 10px; }
.zurueck-option { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 12px 14px; }
.zurueck-option strong { font-size: 15px; }
.zurueck-option span { font-size: 13px; color: var(--grau); font-weight: 400; line-height: 1.4; }
.zurueck-option.gefahr strong { color: #8c2f17; }
.zurueck-option.gefahr:hover { background: #fbeee9; border-color: #e3b8a8; }

.knopf-zeile { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: -2px; }
.knopf-zeile .hinweis { margin: 0; }
.dokumente { margin-top: 4px; }
.dok-kopf { margin: 0 0 6px; font-size: 13px; }
.dok-kopf small { color: var(--grau); }
.dok-liste { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.dok-eintrag { display: grid; grid-template-columns: 54px 1fr auto; gap: 10px; align-items: center; border: 1px solid var(--linie); border-radius: var(--radius); padding: 8px; background: #fcfaf6; }
.dok-bild { width: 54px; aspect-ratio: 210 / 297; background: #fff; border: 1px solid #e3ddd3; border-radius: 3px; overflow: hidden; display: flex; align-items: center; justify-content: center; font-size: 10px; color: var(--grau); }
.dok-bild img { width: 100%; height: 100%; object-fit: contain; }
.dok-mitte { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dok-mitte small { color: var(--grau); font-size: 11.5px; }
.dok-mitte small.warn { color: var(--warn); }
.dok-mitte .schalter { font-size: 12.5px; }
.dok-knoepfe { display: flex; flex-direction: column; gap: 2px; }
.dok-knoepfe button { border: 0; background: none; cursor: pointer; color: var(--grau); width: 24px; height: 22px; border-radius: 4px; }
.dok-knoepfe button:hover { background: #ece6dc; color: var(--tinte); }

/* ---------- Startseite und Bewerbungsart ---------- */

/* Welche Ansicht sichtbar ist, setzt ein kleines Skript im <head> vor dem ersten Zeichnen */
html[data-ansicht="start"] .kopf, html[data-ansicht="start"] .arbeitsflaeche { display: none; }
html[data-ansicht="app"] .start { display: none; }
html[data-art="stelle"] [data-nur]:not([data-nur~="stelle"]),
html[data-art="praktikum"] [data-nur]:not([data-nur~="praktikum"]),
html[data-art="initiativ"] [data-nur]:not([data-nur~="initiativ"]) { display: none !important; }

/* Farben je Bewerbungsart */
[data-art-wahl="stelle"], html[data-art="stelle"] .art-chip { --farbe: #1f5563; --farbe-hell: #e3eef0; }
[data-art-wahl="praktikum"], html[data-art="praktikum"] .art-chip { --farbe: #85570f; --farbe-hell: #f5ead6; }
[data-art-wahl="initiativ"], html[data-art="initiativ"] .art-chip { --farbe: #a1432d; --farbe-hell: #f6e2da; }

.start {
  --feder: cubic-bezier(.22, 1, .36, 1); /* annähernd kritisch gedämpfte Feder, kein Überschwingen */
  min-height: 100vh; min-height: 100dvh;
  background:
    radial-gradient(1100px 620px at 92% -12%, #d9e9ec 0%, rgba(217,233,236,0) 62%),
    radial-gradient(900px 520px at -12% 108%, #f0e2cf 0%, rgba(240,226,207,0) 60%),
    var(--papier);
}
.start-innen { max-width: 1120px; margin: 0 auto; padding: clamp(28px, 4.5vw, 56px) 24px 40px; }

.start-held { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; align-items: center; }
.start-zeile { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--akzent); }
.start-zeile .marke-zeichen { width: 30px; height: 30px; font-size: 17px; border-radius: 8px; }
.start h1 {
  font-family: "Source Serif 4", Georgia, serif; font-weight: 700; font-optical-sizing: auto;
  font-size: clamp(2.4rem, 5vw, 4.5rem); line-height: 1.02; letter-spacing: -0.028em;
  margin: 16px 0 8px; color: var(--tinte);
}
.start-lead { margin: 0 0 14px; font-size: clamp(1.25rem, 2.3vw, 1.65rem); line-height: 1.25; font-weight: 500; letter-spacing: -0.012em; color: var(--akzent); }
.start-unterzeile { margin: 0; max-width: 34em; font-size: 17px; line-height: 1.55; color: #4c5458; }
.start-merkmale { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; }
.start-merkmale li {
  position: relative; padding: 6px 13px 6px 30px; border-radius: 999px; font-size: 14px; font-weight: 500;
  background: rgba(255,255,255,.72); border: 1px solid rgba(29,35,39,.08);
}
.start-merkmale li::before {
  content: ""; position: absolute; left: 12px; top: 50%; width: 10px; height: 5px; margin-top: -4px;
  border-left: 2px solid var(--akzent); border-bottom: 2px solid var(--akzent); transform: rotate(-45deg);
}

/* Zwei stilisierte A4-Blätter: Lebenslauf hinten, Anschreiben vorne */
.start-bild { position: relative; height: 310px; }
.blatt {
  position: absolute; width: 190px; aspect-ratio: 210 / 297; background: #fff; border-radius: 6px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 24px 54px -14px rgba(31,85,99,.32);
}
.blatt i, .blatt b, .blatt em { display: block; height: 5px; border-radius: 3px; background: #e7e2d9; margin: 0 0 7px; }
.blatt i.kurz { width: 55%; }
.blatt b { height: 9px; width: 62%; background: var(--akzent); opacity: .85; margin: 4px 0 12px; }
.blatt em { width: 42%; height: 6px; background: #b8d2d7; margin: 14px 0 9px; }
.blatt-lebenslauf { left: 0; top: 8px; rotate: -7deg; }
.bl-leiste { position: absolute; inset: 0 auto 0 0; width: 35%; padding: 18px 10px; background: var(--akzent); }
.bl-leiste i { background: rgba(255,255,255,.35); }
.bl-foto { display: block; width: 46px; height: 46px; margin: 0 auto 16px; border-radius: 50%; border: 3px solid rgba(255,255,255,.75); background: linear-gradient(160deg, #e9d9c6, #b99b7d); }
.bl-inhalt { margin-left: 35%; padding: 20px 14px; }
.blatt-anschreiben { left: 118px; top: 52px; rotate: 5deg; padding: 20px 18px; }
.ba-empf { width: 46%; margin: 14px 0 18px; }
.ba-unterschrift { width: 84px; margin-top: 8px; fill: none; stroke: var(--akzent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.start-frage {
  font-family: "Source Serif 4", Georgia, serif; font-weight: 600; font-size: clamp(1.4rem, 2.5vw, 1.95rem);
  line-height: 1.2; letter-spacing: -0.016em; margin: clamp(28px, 4vw, 44px) 0 16px;
}
.start-wahl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.art-karte {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px; text-align: left; cursor: pointer;
  padding: 22px 22px 18px; border-radius: 18px; border: 1px solid rgba(29,35,39,.09);
  background: rgba(255,253,249,.84); -webkit-backdrop-filter: blur(16px) saturate(160%); backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 10px 26px -14px rgba(31,85,99,.28);
  transition: transform .45s var(--feder), box-shadow .45s var(--feder), border-color .2s ease;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
@media (hover: hover) {
  .art-karte:hover {
    transform: translateY(-3px); border-color: color-mix(in srgb, var(--farbe) 35%, transparent);
    box-shadow: 0 2px 4px rgba(0,0,0,.05), 0 22px 44px -18px color-mix(in srgb, var(--farbe) 45%, transparent);
  }
  .art-karte:hover .art-los svg { transform: translateX(4px); }
}
/* Rückmeldung sofort beim Drücken, nicht erst beim Loslassen */
.art-karte:active { transform: translateY(-1px) scale(.985); transition-duration: .1s; transition-timing-function: ease-out; }
.art-karte:focus-visible { outline: 3px solid var(--farbe); outline-offset: 3px; }
.art-symbol { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 14px; background: var(--farbe-hell); color: var(--farbe); }
.art-symbol svg { width: 27px; height: 27px; }
.art-symbol svg, .art-los svg, .art-chip svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.art-karte strong { font-size: 19px; line-height: 1.28; font-weight: 600; letter-spacing: -0.01em; color: var(--tinte); margin-top: 4px; }
.art-text { font-size: 15px; line-height: 1.5; color: #4c5458; flex: 1; }
.art-los { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 15px; font-weight: 600; color: var(--farbe); }
.art-los svg { width: 18px; height: 18px; stroke-width: 2; transition: transform .45s var(--feder); }

.start-weiter { margin: 22px 0 0; text-align: center; font-size: 15px; color: #4c5458; }
.start-weiter button { border: 0; background: none; padding: 4px 2px; font-weight: 600; color: var(--akzent); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.start-fuss { margin: 28px 0 0; text-align: center; font-size: 13px; color: var(--grau); }

/* Einblenden beim Öffnen der Startseite: nacheinander, nur Lage und Deckkraft */
@keyframes auftauchen { from { opacity: 0; translate: 0 16px; } }
.start-text, .start-frage { animation: auftauchen .7s var(--feder) both; }
.blatt-lebenslauf { animation: auftauchen .8s var(--feder) .08s both; }
.blatt-anschreiben { animation: auftauchen .8s var(--feder) .16s both; }
.art-karte { animation: auftauchen .7s var(--feder) both; }
.art-karte:nth-child(1) { animation-delay: .12s; }
.art-karte:nth-child(2) { animation-delay: .19s; }
.art-karte:nth-child(3) { animation-delay: .26s; }

/* Kopfzeile im Generator: Bewerbungsart und Weg zurück zur Startseite */
button.marke-zeichen { border: 0; padding: 0; cursor: pointer; transition: transform .1s ease-out; }
button.marke-zeichen:active { transform: scale(.92); }
.art-chip {
  display: inline-flex; align-items: center; gap: 3px; margin-left: 4px; padding: 4px 7px 4px 12px; cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--farbe) 22%, transparent); border-radius: 999px;
  background: var(--farbe-hell); color: var(--farbe); font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: transform .1s ease-out, background-color .2s ease;
}
.art-chip:hover { background: color-mix(in srgb, var(--farbe-hell) 70%, var(--farbe) 12%); }
.art-chip:active { transform: scale(.96); }
.art-chip svg { width: 16px; height: 16px; stroke-width: 2; }

/* Generator blendet nach der Auswahl kurz ein (die Startseite hat ihr eigenes Einblenden) */
@keyframes einblenden { from { opacity: 0; translate: 0 8px; } }
html[data-ansicht="app"] .kopf, html[data-ansicht="app"] .arbeitsflaeche { animation: einblenden .35s cubic-bezier(.22, 1, .36, 1) backwards; }

@media (max-width: 880px) {
  .start-held { grid-template-columns: 1fr; gap: 8px; }
  .start-bild { height: 250px; order: -1; margin-bottom: 8px; }
  .blatt { width: 148px; }
  .blatt-lebenslauf { left: calc(50% - 150px); }
  .blatt-anschreiben { left: calc(50% - 30px); top: 34px; }
  .start-wahl { grid-template-columns: 1fr; }
  .art-karte { display: grid; grid-template-columns: auto 1fr; column-gap: 16px; row-gap: 4px; align-items: start; }
  .art-symbol { grid-row: span 3; }
  .art-karte strong { margin-top: 2px; }
}
@media (max-width: 520px) {
  .start-innen { padding: 28px 16px 32px; }
  /* Auf dem Handy zählen die drei Knöpfe: das Bild weicht, damit sie früher sichtbar sind */
  .start-bild { display: none; }
  .start-merkmale { gap: 6px; margin-top: 18px; }
  .start-merkmale li { font-size: 13px; padding: 5px 11px 5px 27px; }
  .start-merkmale li::before { left: 11px; }
  .start-unterzeile { font-size: 16px; }
  .art-karte { padding: 18px 16px 16px; border-radius: 16px; column-gap: 14px; }
  .art-symbol { width: 44px; height: 44px; border-radius: 12px; }
  .art-karte strong { font-size: 18px; }
  .marke .modus { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  @keyframes auftauchen { from { opacity: 0; } }
  .art-karte, .art-karte:hover, .art-karte:active { transform: none; }
  .art-karte:hover .art-los svg { transform: none; }
  @keyframes einblenden { from { opacity: 0; } }
}
@media (prefers-reduced-transparency: reduce) {
  .art-karte { background: #fffdf9; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .art-karte { background: #fff; border-color: var(--tinte); }
  .art-text, .start-unterzeile { color: var(--tinte); }
}

/* ---------- Anschreiben: selbst schreiben und prüfen ---------- */
.schreib-wahl { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 14px; }
.schreib-wahl .knopf, .pruefung .knopf { transition: transform .1s ease-out, background-color .15s ease; }
.schreib-wahl .knopf:active, .pruefung .knopf:active { transform: scale(.97); }
.pruefung { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--linie); }
.pruef-ergebnis { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; animation: einblenden .3s cubic-bezier(.22, 1, .36, 1) backwards; }
.pruef-ok { margin: 0; padding: 10px 12px; border-radius: var(--radius); background: #e6f1ea; color: #1e5a36; font-size: 14px; }
.pruef-fazit { margin: 0; font-size: 14px; }
.pruef-kopf { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 14px; }
.pruef-kopf .zahl { min-width: 22px; padding: 1px 7px; border-radius: 999px; background: var(--akzent-hell); color: var(--akzent); font-size: 12px; font-weight: 600; text-align: center; }
.pruef-kopf .knopf { margin-left: auto; }
.pruef-liste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pruef-liste li {
  display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center;
  padding: 9px 10px; border: 1px solid var(--linie); border-radius: var(--radius); background: #fff; font-size: 13.5px;
  transition: opacity .25s ease, background-color .25s ease;
}
.pruef-liste li > .knopf { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
.pruef-liste li > :not(.knopf) { grid-column: 1; }
.pruef-liste li.erledigt { opacity: .55; background: #f7f5f1; }
.pruef-stelle { justify-self: start; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; font-size: 14px; line-height: 1.4; }
.pruef-stelle:hover { text-decoration: underline; text-decoration-color: var(--linie); text-underline-offset: 3px; }
.pruef-liste del { color: #9a2c1c; text-decoration-thickness: 1.5px; }
.pruef-liste ins { color: #1e5a36; text-decoration: none; font-weight: 600; }
.pruef-art { font-size: 11.5px; font-weight: 600; letter-spacing: .02em; color: var(--grau); }
.pruef-art.warn { color: var(--warn); }
.pruef-text, .pruef-vorschlag { color: #3b4246; line-height: 1.45; }
@media (max-width: 520px) {
  .pruef-liste li { grid-template-columns: 1fr; }
  .pruef-liste li > .knopf { grid-column: 1; grid-row: auto; justify-self: start; margin-top: 4px; }
}

/* ---------- Eigenes Layout hochladen ---------- */
.eigen-bereich { margin-top: 14px; }
.eigen-bereich .ablage small { color: var(--grau); line-height: 1.45; }
.ablage.beschaeftigt { opacity: .55; pointer-events: none; }
.eigen-panel[hidden] { display: none; }
.eigen-panel { margin-top: 10px; padding: 12px; border: 1px solid var(--linie); border-radius: var(--radius); background: #fbf8f3; animation: einblenden .3s cubic-bezier(.22, 1, .36, 1) backwards; }
.eigen-vergleich { display: grid; grid-template-columns: 130px 1fr; gap: 14px; align-items: start; }
.eigen-vergleich figure { margin: 0; }
.eigen-vergleich img { display: block; width: 100%; border: 1px solid var(--linie); border-radius: 4px; background: #fff; }
.eigen-vergleich figcaption { font-size: 11.5px; color: var(--grau); text-align: center; margin-top: 4px; }
.eigen-info { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.eigen-info .hinweis { margin: 0; }
.eigen-hinweise { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--warn); line-height: 1.45; }
.layout-karte.eigen strong::before { content: "Eigenes · "; color: var(--akzent); }
@media (max-width: 520px) { .eigen-vergleich { grid-template-columns: 1fr; } .eigen-vergleich figure { max-width: 160px; } }

/* Namensprüfung an hochgeladenen Zeugnissen */
.dok-name { font-size: 12px; line-height: 1.4; color: var(--grau); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.dok-name.ok { color: #1e5a36; }
.dok-name.warn { color: var(--warn); }
.dok-name .knopf { padding: 2px 8px; font-size: 12px; }

/* Website des Unternehmens: Logo und Hausfarben */
.web-zeile { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.web-zeile .hinweis { margin: 0; flex: 1; min-width: 200px; }
.farb-wahl[hidden] { display: none; }
.farb-wahl-innen { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border: 1px solid var(--linie); border-radius: var(--radius); background: #fff; }
.fw-logo { flex: none; width: 96px; height: 52px; display: flex; align-items: center; justify-content: center; border-radius: 6px; padding: 4px; }
.fw-logo img { max-width: 100%; max-height: 100%; }
.fw-mitte { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fw-felder { display: flex; gap: 8px; }
.fw-feld { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--linie); cursor: pointer; padding: 0; transition: transform .1s ease-out, box-shadow .15s ease; }
.fw-feld:active { transform: scale(.92); }
.fw-feld.aktiv { box-shadow: 0 0 0 2px var(--tinte); }
.fw-weg { align-self: flex-start; border: 0; background: none; padding: 0; font-size: 12px; color: var(--grau); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }

/* Lücken im Lebenslauf */
.reiter-marke[hidden] { display: none; }
.reiter-marke { display: inline-block; min-width: 18px; margin-left: 6px; padding: 0 5px; border-radius: 999px; background: var(--warn); color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; vertical-align: 1px; }
.luecken[hidden] { display: none; }
.luecken { margin: 4px 0 14px; padding: 12px; border: 1px solid #e6cdb9; border-radius: var(--radius); background: #fcf4ec; font-size: 14px; animation: einblenden .3s cubic-bezier(.22, 1, .36, 1) backwards; }
.luecken strong { color: var(--warn); }
.luecken-liste { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.luecken-liste li { display: flex; align-items: center; justify-content: space-between; gap: 6px 10px; flex-wrap: wrap; padding: 7px 9px; border-radius: 6px; background: #fff; font-size: 13.5px; line-height: 1.4; }
.luecken-liste li.warn { color: var(--warn); }
.luecken .hinweis { margin: 8px 0 0; }
#kontakt-status .knopf { margin-left: 4px; padding: 2px 8px; font-size: 12px; }

/* Vorschläge zur Staatsangehörigkeit */
label.mit-vorschlag { position: relative; }
.vorschlaege[hidden] { display: none; }
.vorschlaege {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 30; margin: 4px 0 0; padding: 4px; list-style: none;
  background: #fff; border: 1px solid var(--linie); border-radius: 10px; box-shadow: 0 10px 28px rgba(31, 40, 45, .14), 0 2px 6px rgba(31, 40, 45, .08);
  transform-origin: top center; animation: vorschlag-auf .22s cubic-bezier(.22, 1.2, .36, 1);
}
.vorschlaege li { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 7px 9px; border-radius: 6px; cursor: pointer; font-size: 14px; color: var(--tinte); transition: background-color .12s ease, transform .12s ease; }
.vorschlaege li span { color: var(--grau); font-size: 12.5px; text-align: right; }
.vorschlaege li:hover, .vorschlaege li[aria-selected="true"] { background: var(--akzent-hell); }
.vorschlaege li:active { transform: scale(.98); }
@keyframes vorschlag-auf { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .vorschlaege { animation: none; } .vorschlaege li { transition: none; } }

/* Bewerbungsart in der Kopfzeile wechseln */
.art-auswahl { position: relative; }
.art-chip[aria-expanded="true"] svg { transform: rotate(180deg); }
.art-chip svg { transition: transform .2s cubic-bezier(.22, 1, .36, 1); }
.art-menue[hidden] { display: none; }
.art-menue {
  position: absolute; top: calc(100% + 6px); left: 4px; z-index: 40; display: flex; flex-direction: column; gap: 2px; min-width: 220px; padding: 4px;
  background: #fff; border: 1px solid var(--linie); border-radius: 12px; box-shadow: 0 12px 32px rgba(31, 40, 45, .16), 0 2px 6px rgba(31, 40, 45, .08);
  transform-origin: top left; animation: menue-auf .22s cubic-bezier(.22, 1.2, .36, 1);
}
.art-menue button {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--tinte);
  font: inherit; font-size: 14px; text-align: left; cursor: pointer; transition: background-color .12s ease, transform .1s ease-out;
}
.art-menue button:hover, .art-menue button:focus-visible { background: var(--akzent-hell); outline: none; }
.art-menue button:active { transform: scale(.98); }
.art-menue button[aria-checked="true"] { font-weight: 600; }
.art-menue button[aria-checked="true"]::after { content: "✓"; color: var(--akzent); }
@keyframes menue-auf { from { opacity: 0; transform: translateY(-4px) scale(.97); } }

/* Foto in der Vorschau verschieben */
.seiten-rahmen .foto-bg { cursor: grab; touch-action: none; user-select: none; }
.seiten-rahmen .foto-bg:hover { outline: 3px solid var(--akzent); outline-offset: -3px; }
.seiten-rahmen .foto-bg.zieht { cursor: grabbing; }
.foto-griff[hidden] { display: none; }
.foto-griff {
  position: fixed; z-index: 30; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; max-width: min(460px, calc(100vw - 16px)); padding: 7px 10px;
  background: #fff; border: 1px solid var(--linie); border-radius: 12px; box-shadow: 0 10px 28px rgba(31, 40, 45, .16), 0 2px 6px rgba(31, 40, 45, .08); font-size: 12.5px; color: var(--grau);
  animation: menue-auf .18s cubic-bezier(.22, 1, .36, 1);
}
.foto-griff label { display: flex; flex-direction: row; align-items: center; gap: 6px; font-size: 12.5px; }
.foto-griff input { width: 100px; }
@media (prefers-reduced-motion: reduce) { .art-menue, .foto-griff { animation: none; } .art-chip svg { transition: none; } }
@media print { .foto-griff { display: none !important; } }
