/* Klassenteam – Farben, Schriften und Animationen wie im Design-Entwurf */
:root {
  --indigo: #2B2BB8; --limette: #D7F75B; --tinte: #15153A; --grau: #4A4A70; --grau2: #6A6A8E;
  --grund: #EEEEF8; --feld: #F2F2FA; --zeile: #F6F6FB; --linie: #E4E4F4; --rosa: #FFB4D0;
  --orange: #E2682A; --orange-hell: #FFF1E8; --gruen: #22A06B; --rot: #B42318;
  --kopf: 'Bricolage Grotesque', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--grund); color: var(--tinte); font-family: Manrope, system-ui, sans-serif; -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--indigo); }
.versteckt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--limette); outline-offset: 2px; border-radius: 8px; }

/* ---------- Animationen ---------- */
@keyframes rein { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes balken { from { width: 0; } }
@keyframes plopp { 0% { transform: scale(.4); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes puls { 0%, 100% { box-shadow: 0 0 0 0 rgba(34,160,107,.5); } 50% { box-shadow: 0 0 0 7px rgba(34,160,107,0); } }
@keyframes hoch { from { opacity: 0; transform: translateY(60px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes blende { from { opacity: 0; } }
@keyframes auf { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes schweb { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-10px) rotate(2deg); } }
@keyframes toast { from { opacity: 0; transform: translate(-50%, 20px); } to { opacity: 1; transform: translate(-50%, 0); } }
.rein { animation: rein .55s cubic-bezier(.2,.8,.2,1) both; }
.auf { animation: auf .35s cubic-bezier(.2,.8,.2,1) both; }
.plopp { animation: plopp .35s cubic-bezier(.3,1.6,.5,1); }
.live { animation: puls 1.8s infinite; }
.schweb { animation: schweb 6s ease-in-out infinite; }
.federn { transition: transform .2s cubic-bezier(.3,1.6,.5,1), background .2s, color .2s, border-color .2s, box-shadow .2s; }
.federn:hover { transform: translateY(-2px); }
.federn:active { transform: scale(.94); }
.karte { transition: transform .2s ease, box-shadow .2s ease, opacity .3s; }
@media (hover: hover) { .karte:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(21,21,58,.10); } }
/* Wer am iPad „Bewegung reduzieren“ eingeschaltet hat, bekommt keine Animationen */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Grundgerüst ---------- */
.seite { min-height: 100vh; padding: max(16px, env(safe-area-inset-top)) 16px 24px; display: flex; flex-direction: column; gap: 16px; max-width: 1400px; margin: 0 auto; }
.kopf { background: var(--indigo); color: #fff; border-radius: 24px; padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.kopf-zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.marke { font-family: var(--kopf); font-weight: 800; font-size: 26px; letter-spacing: -.02em; color: #fff; text-decoration: none; }
.marke span { color: var(--limette); }
.reiter { display: flex; gap: 6px; flex-wrap: wrap; margin-left: 8px; }
.reiter a { color: #fff; background: rgba(255,255,255,.12); text-decoration: none; font-weight: 700; font-size: 14px; padding: 10px 16px; border-radius: 999px; }
.reiter a[aria-current="page"] { background: var(--limette); color: var(--tinte); }
.ich { margin-left: auto; display: flex; align-items: center; gap: 10px; background: none; border: 0; color: #fff; cursor: pointer; padding: 4px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--limette); color: var(--tinte); font-weight: 800; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.gruss { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; }
.gruss h1 { margin: 4px 0 0; font-family: var(--kopf); font-weight: 800; font-size: clamp(30px, 4.2vw, 42px); line-height: 1.04; letter-spacing: -.03em; }
.leise { opacity: .8; font-size: 14px; }
.knopf-gross { display: inline-flex; align-items: center; gap: 10px; background: var(--limette); color: var(--tinte); border: 0; font-weight: 800; font-size: 16px; padding: 0 22px; min-height: 56px; border-radius: 16px; cursor: pointer; text-decoration: none; }
.spalten { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.spalten > * { flex: 1 1 400px; min-width: 0; }
.flaeche { background: #fff; border-radius: 24px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.titelzeile { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.titelzeile h2 { margin: 0; font-family: var(--kopf); font-size: 24px; font-weight: 800; }
.schild { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--grau); background: #ECECF6; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.leer { color: var(--grau2); padding: 18px 4px; text-align: center; }

/* ---------- Aufgabenzeile ---------- */
.aufgabe { display: flex; gap: 12px; align-items: flex-start; background: var(--zeile); border-radius: 14px; padding: 12px 14px; }
.aufgabe.dringend { background: var(--orange-hell); }
.aufgabe.fertig { opacity: .55; }
.aufgabe.fertig .a-titel { text-decoration: line-through; }
.haken { width: 26px; height: 26px; min-width: 26px; border-radius: 8px; border: 2px solid #B8B8D6; background: #fff; cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center; transition: background .2s, border-color .2s, transform .15s; }
.dringend .haken { border-color: var(--orange); }
.haken:active { transform: scale(.85); }
.haken[aria-checked="true"] { background: var(--limette); border-color: var(--limette); }
/* großzügigere Tippfläche fürs iPad, ohne das Kästchen größer zu zeichnen */
.haken-wrap { padding: 9px; margin: -9px; }
.a-text { flex: 1; min-width: 0; text-decoration: none; color: var(--tinte); }
.a-titel { display: block; font-weight: 700; line-height: 1.3; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; font-size: 12px; font-weight: 700; }
.tag { background: #ECECF6; color: var(--grau); padding: 3px 9px; border-radius: 999px; }
.tag.frist-alt { background: var(--orange); color: #fff; }
.tag.frist-heute { background: var(--tinte); color: #fff; }
.tag-leise { color: var(--grau2); padding: 3px 0; }

/* ---------- Gemeinsame Listen ---------- */
.liste-karte { display: flex; flex-direction: column; gap: 10px; background: #fff; border-radius: 20px; padding: 16px 18px; text-decoration: none; color: var(--tinte); }
.liste-kopf { display: flex; align-items: center; gap: 10px; }
.punkt { width: 14px; height: 14px; border-radius: 5px; flex: none; }
.liste-name { font-family: var(--kopf); font-size: 19px; font-weight: 800; }
.balken { height: 8px; background: #ECECF6; border-radius: 999px; overflow: hidden; }
.balken span { display: block; height: 8px; border-radius: 999px; animation: balken 1.1s cubic-bezier(.2,.8,.2,1) .3s both; }
.mini { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.mini .m-kasten { width: 16px; height: 16px; min-width: 16px; border-radius: 5px; border: 2px solid #B8B8D6; }
.mini .m-titel { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.knopf-gestrichelt { min-height: 44px; padding: 0 16px; border: 2px dashed #B8B8D6; border-radius: 12px; background: transparent; color: var(--indigo); font-weight: 700; cursor: pointer; }
.live-zeile { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--grau); padding: 0 6px; }
.live-punkt { width: 8px; height: 8px; border-radius: 50%; background: var(--gruen); flex: none; }

/* ---------- Knöpfe & Felder ---------- */
.knopf { min-height: 48px; padding: 0 18px; border: 2px solid var(--linie); border-radius: 14px; background: #fff; font-weight: 700; cursor: pointer; color: var(--tinte); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.knopf.dunkel { background: var(--tinte); color: #fff; border-color: var(--tinte); }
.knopf.limette { background: var(--limette); border-color: var(--limette); }
.knopf.gefahr { border-color: transparent; background: transparent; color: var(--rot); }
.knopf.zurueck { background: rgba(255,255,255,.14); border: 0; color: #fff; min-height: 44px; border-radius: 999px; }
.feld { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 800; color: var(--grau); letter-spacing: .02em; }
.feld input, .feld select, .feld textarea { min-height: 48px; border: 0; border-radius: 12px; background: var(--feld); padding: 0 12px; color: var(--tinte); font-weight: 600; letter-spacing: 0; }
.feld textarea { padding: 12px; min-height: 80px; resize: vertical; font-weight: 500; }
.raster3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { min-height: 44px; padding: 0 14px; border: 2px solid transparent; border-radius: 12px; font-weight: 700; cursor: pointer; background: var(--feld); color: var(--tinte); }
.chip[aria-pressed="true"] { background: var(--tinte); color: #fff; }
.chip.art[aria-pressed="true"] { color: var(--tinte); border-color: var(--tinte); }
.chip.rund { border-radius: 999px; }
.abschnitt { font-size: 13px; font-weight: 800; letter-spacing: .05em; color: var(--grau); }
.meldung { background: #FDECEA; color: var(--rot); border-radius: 12px; padding: 10px 14px; font-weight: 600; }

/* ---------- Modal (Neue Aufgabe) ---------- */
.modal-grund { position: fixed; inset: 0; background: rgba(21,21,58,.72); z-index: 50; overflow-y: auto; padding: max(20px, env(safe-area-inset-top)) 14px 40px; animation: blende .3s ease both; display: flex; justify-content: center; align-items: flex-start; }
.modal { width: 100%; max-width: 860px; background: #fff; border-radius: 28px; overflow: hidden; display: flex; flex-direction: column; animation: hoch .5s cubic-bezier(.2,.9,.25,1.05) both; }
.modal-kopf { background: var(--indigo); color: #fff; padding: 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-kopf h2 { margin: 0; font-family: var(--kopf); font-size: 26px; font-weight: 800; }
.modal-kopf .chip { background: rgba(255,255,255,.14); color: #fff; }
.modal-kopf .chip[aria-pressed="true"] { background: var(--limette); color: var(--tinte); }
.titel-eingabe { min-height: 56px; border: 0; border-radius: 16px; padding: 0 18px; font-family: var(--kopf); font-size: 22px; font-weight: 700; color: var(--tinte); width: 100%; }
.modal-inhalt { padding: 22px 24px; display: flex; flex-direction: column; gap: 20px; }
.schliessen { margin-left: auto; color: #fff; width: 44px; height: 44px; border-radius: 12px; background: rgba(255,255,255,.14); border: 0; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.mehr { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--feld); color: var(--indigo); font-weight: 800; cursor: pointer; }
.mehr svg { transition: transform .3s cubic-bezier(.3,1.4,.5,1); }
.mehr[aria-expanded="true"] svg { transform: rotate(180deg); }
.schritte { background: var(--zeile); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.schritt { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.schritt input[type="text"] { flex: 1; border: 0; background: transparent; min-height: 36px; font-weight: 600; }
.modal-fuss { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; border-top: 2px solid var(--feld); padding-top: 16px; }

/* ---------- Aufgabe-Detail ---------- */
.detail-kopf h1 { margin: 0; font-family: var(--kopf); font-weight: 800; font-size: clamp(28px, 4vw, 40px); line-height: 1.05; letter-spacing: -.03em; }
.fakten { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.fakt { background: rgba(255,255,255,.14); border-radius: 16px; padding: 12px 14px; }
.fakt.hell { background: var(--limette); color: var(--tinte); }
.fakt small { display: block; font-size: 12px; font-weight: 700; opacity: .75; letter-spacing: .04em; }
.fakt strong { font-family: var(--kopf); font-size: 20px; font-weight: 800; }
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 520px; overflow-y: auto; }
.blase { max-width: 86%; border-radius: 18px; padding: 10px 14px; background: var(--feld); align-self: flex-start; }
.blase.meins { align-self: flex-end; background: var(--limette); }
.blase small { display: block; font-size: 12px; font-weight: 700; opacity: .65; }
.blase div { margin-top: 3px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.eingabe-zeile { display: flex; gap: 8px; background: var(--feld); border-radius: 16px; padding: 6px 6px 6px 14px; }
.eingabe-zeile input { flex: 1; border: 0; outline: 0; background: transparent; min-height: 44px; }

/* ---------- Anmelden ---------- */
.login { min-height: 100vh; background: var(--indigo); color: #fff; display: flex; flex-wrap: wrap; gap: 24px; padding: 24px; overflow: hidden; }
.login > section { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column; gap: 22px; padding: 24px 12px; }
.login h1 { margin: auto 0 0; font-family: var(--kopf); font-weight: 800; font-size: clamp(42px, 6vw, 72px); line-height: .95; letter-spacing: -.035em; }
.login h1 span, .login .marke span { color: var(--limette); }
.login form { width: 100%; max-width: 440px; margin: auto; background: #fff; color: var(--tinte); border-radius: 28px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.login form h2 { margin: 0 0 4px; font-family: var(--kopf); font-size: 28px; font-weight: 800; }
.login .feld input { min-height: 52px; }

#toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 100; }
#toast div { background: var(--tinte); color: #fff; padding: 12px 18px; border-radius: 14px; font-weight: 700; box-shadow: 0 8px 24px rgba(0,0,0,.2); animation: toast .3s cubic-bezier(.3,1.4,.5,1) both; }
.ruhig .rein, .ruhig .balken span, .ruhig .plopp { animation: none; }
.plopp-frisch { animation: plopp .35s cubic-bezier(.3,1.6,.5,1); }
