/* Aufgaben-Portal - eigenes Stylesheet.
   Nachgebaut nach dem Aufgaben-Feld im Manager (Farben, Schrift, Karten, Knoepfe); nichts wird zur Laufzeit
   von dort geladen. Keine fremden Schriften, keine Bibliotheken. */
:root {
  --brand: #111827; --brand-strong: #000000; --brand-contrast: #ffffff;
  --green: #047857; --green-hell: #10b981; --green-soft: #dcf5e8;
  --red: #c2251f; --red-soft: #fde5e3;
  --orange: #9a4507; --orange-hell: #f59e0b; --orange-soft: #fdf1dd;
  --blue: #1d4ed8; --blue-hell: #3b82f6; --blue-soft: #e6eefd;
  --violett: #7c3aed; --violett-soft: #ede6fd;
  --tuerkis: #0d9488; --tuerkis-soft: #d8f2ef;
  --grey: #5f6b7a; --grey-soft: #f1f5f9;
  --bg: #f5f7fb; --surface: #ffffff; --surface-2: #f8fafc; --surface-3: #f1f5f9;
  --border: #e5e7eb; --border-strong: #cbd5e1;
  --text: #111827; --text-muted: #5f6b7a;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --radius: 18px; --radius-sm: 11px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; line-height: 1.5; overflow-x: hidden; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { letter-spacing: -.01em; }

/* Kopfleiste */
.kopfleiste { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 10px clamp(16px, 3vw, 28px); background: rgba(255, 255, 255, .92); border-bottom: 1px solid var(--border); backdrop-filter: blur(6px); }
.kopfleiste__marke { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); font-size: 16px; }
.kopfleiste__marke:hover { text-decoration: none; }
.punkt { width: 10px; height: 10px; border-radius: 50%; background: var(--blue-hell); box-shadow: 0 0 0 4px var(--blue-soft); }
.kopfleiste__ab { margin-left: auto; }
.filter { display: inline-flex; gap: 4px; padding: 3px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border); }
.filter__knopf { padding: 5px 14px; border-radius: 999px; color: var(--text-muted); font-size: 13.5px; font-weight: 600; }
.filter__knopf:hover { text-decoration: none; color: var(--text); }
.filter__knopf.ist-aktiv { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* Knoepfe */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 15px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font-size: .875rem; font-weight: 560; font-family: inherit; cursor: pointer; transition: background .13s, border-color .13s, transform .06s; }
.btn:hover:not(:disabled) { background: var(--surface-3); text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn--primary { background: var(--brand); border-color: var(--brand); color: var(--brand-contrast); box-shadow: var(--shadow-sm); }
.btn--primary:hover:not(:disabled) { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn--ghost { border-color: transparent; background: transparent; }
.btn--sm { padding: 5px 11px; font-size: .8rem; }
.btn--block { width: 100%; }
.btn--option { white-space: normal; text-align: left; justify-content: flex-start; max-width: 100%; }
:focus-visible { outline: 3px solid var(--blue-hell); outline-offset: 2px; }

/* Seite */
.aufg { max-width: 1120px; margin: 0 auto; display: grid; gap: 22px; padding: 22px clamp(16px, 3vw, 28px) 60px; }
.aufg-leise { color: var(--text-muted); font-size: 14px; margin: 4px 0 0; }
.aufg-kopf { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px; }
.aufg-kopf h1 { margin: 0; font-size: clamp(1.5rem, 2.4vw, 1.9rem); letter-spacing: -.02em; }
.aufg-zahlen { display: grid; grid-template-columns: repeat(4, minmax(92px, auto)); gap: 10px; }
.aufg-zahl { display: grid; gap: 2px; padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); min-width: 0; }
.aufg-zahl strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.aufg-zahl span { font-size: 12px; color: var(--text-muted); }

/* Abschnitte */
.aufg-abschnitt { display: grid; gap: 12px; min-width: 0; }
.aufg-abschnitt__kopf { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.aufg-abschnitt__kopf h2 { margin: 0; font-size: 1.1rem; }
.aufg-abschnitt__kopf .aufg-leise { margin: 0; font-size: 13px; }
.zwischen { margin: 8px 0 0; font-size: .95rem; color: var(--text-muted); }
.aufg-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }

/* Grosse Karte (Gerade dabei, Wartet auf dich) */
.aufgabe--jetzt { background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--blue-hell); border-radius: 18px; display: flex; flex-direction: column; gap: 12px; padding: clamp(16px, 3vw, 26px); box-shadow: 0 10px 30px rgba(17, 24, 39, .07); min-width: 0; }
.aufgabe--philipp { border-top-color: var(--orange-hell); }
.aufgabe--philipp.ist-beantwortet { border-top-color: var(--green-hell); background: var(--surface-2); }
.aufgabe__kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.aufgabe__marke { background: var(--blue); color: #fff; border-radius: 999px; padding: 3px 12px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.aufgabe__marke--orange { background: var(--orange); }
.aufgabe__meta { color: var(--text-muted); font-size: 13px; }
.aufgabe__titel { margin: 0; font-size: clamp(1.1rem, 2vw, 1.35rem); line-height: 1.3; overflow-wrap: anywhere; }
.aufgabe__warum, .aufgabe__frage { margin: 0; max-width: 72ch; line-height: 1.6; overflow-wrap: anywhere; }
.aufgabe__frage { font-weight: 600; }
.aufgabe__zwischentitel { font-weight: 600; font-size: 14px; }
.aufgabe__vorbereitet { background: var(--green-soft); border-radius: 12px; padding: 12px 16px; display: flex; flex-direction: column; gap: 6px; }
.aufgabe__vorbereitet .aufgabe__zwischentitel { color: var(--green); }
.aufgabe__vorbereitet ul { margin: 0; padding-left: 20px; line-height: 1.5; }
.aufgabe__schritte { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; line-height: 1.5; overflow-wrap: anywhere; }
.aufgabe__optionen { display: flex; flex-direction: column; gap: 8px; }
.aufgabe__antwort { display: flex; flex-direction: column; gap: 8px; }
.aufgabe__freitext { width: 100%; max-width: 640px; border-radius: 10px; border: 1px solid var(--border-strong); padding: 8px 10px; font: inherit; resize: vertical; }
.aufgabe__knoepfe { display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--border); padding-top: 12px; }

/* Marken */
.marke { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.marke--blau { background: var(--blue-soft); color: var(--blue); }
.marke--violett { background: var(--violett-soft); color: var(--violett); }
.marke--orange { background: var(--orange-soft); color: var(--orange); }
.marke--gruen { background: var(--green-soft); color: var(--green); }
.marke--tuerkis { background: var(--tuerkis-soft); color: var(--tuerkis); }
.marke--grau { background: var(--grey-soft); color: var(--grey); }
.aufg-dauer { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-muted); }

/* Kachelraster */
.aufg-raster { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 14px; }
.aufg-kachel { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); transition: box-shadow .15s ease, border-color .15s ease; min-width: 0; }
.aufg-kachel:hover { border-color: var(--border-strong); box-shadow: 0 8px 22px rgba(17, 24, 39, .08); }
.aufg-kachel__kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.aufg-kachel__titel { margin: 0; font-size: 15px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.aufg-kachel__text { margin: 0; font-size: 13.5px; color: var(--text); overflow-wrap: anywhere; }
.aufg-kachel__fuss { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; border-top: 1px solid var(--border); margin-top: auto; }

/* Erledigt: aufklappbar, ruhig und grau - nie durchgestrichen */
.aufg-erledigt-block { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 4px 18px; }
.aufg-erledigt-block summary { cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 0; list-style: none; }
.aufg-erledigt-block summary::-webkit-details-marker { display: none; }
.aufg-erledigt-block summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(-45deg); transition: transform .15s ease; }
.aufg-erledigt-block[open] summary::before { transform: rotate(45deg); }
.aufg-erledigt-block__titel { font-weight: 650; }
.aufg-zaehler { min-width: 24px; height: 22px; padding: 0 8px; border-radius: 99px; background: var(--green-soft); color: var(--green); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.aufg-zaehler--grau { background: var(--grey-soft); color: var(--grey); }
.aufg-erledigt-liste { list-style: none; margin: 0 0 8px; padding: 0; }
.aufg-erledigt { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.aufg-erledigt__haken { width: 22px; height: 22px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; font-size: 12px; font-weight: 700; }
.aufg-erledigt__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.aufg-erledigt__titel { color: var(--text-muted); font-weight: 500; overflow-wrap: anywhere; }
.aufg-erledigt__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12.5px; color: var(--text-muted); overflow-wrap: anywhere; }
.aufg-antwort { background: var(--grey-soft); border-radius: 6px; padding: 1px 8px; color: var(--text); overflow-wrap: anywhere; }

/* Lehren */
.lehren { list-style: none; margin: 0; padding: 4px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.lehren li { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; padding: 10px 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.lehren li:first-child { border-top: none; }
.lehren li .aufg-dauer { grid-column: 2; }
.lehren__n { font-weight: 700; color: var(--violett); font-variant-numeric: tabular-nums; }

/* Meldungen und Leerstellen */
.meldung { margin: 0; padding: 10px 14px; border-radius: 12px; font-size: 14px; }
.meldung--ok { background: var(--green-soft); color: var(--green); }
.meldung--fehler { background: var(--red-soft); color: var(--red); }
.meldung--hinweis { background: var(--orange-soft); color: var(--orange); }
.leer { margin: 0; padding: 14px 18px; border: 1px dashed var(--border-strong); border-radius: 14px; color: var(--text-muted); background: var(--surface-2); }
div.leer h1 { margin-top: 0; font-size: 1.3rem; color: var(--text); }

/* Anmeldung */
.anmeldung { min-height: 80vh; display: grid; place-items: center; }
.anmeldung__karte { width: 100%; max-width: 400px; background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--blue-hell); border-radius: var(--radius); padding: 26px; box-shadow: 0 10px 30px rgba(17, 24, 39, .07); display: grid; gap: 12px; }
.anmeldung__karte h1 { margin: 6px 0 0; font-size: 1.4rem; }
.formular { display: grid; gap: 12px; }
.formular label { display: grid; gap: 4px; font-size: 13.5px; font-weight: 600; }
.formular input { font: inherit; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); width: 100%; }

/* Konto: eigene, am Inhalt orientierte Karte (keine 400px-Anmeldekarte - Knoepfe duerfen nie ueberstehen) */
.konto { width: 100%; max-width: 720px; margin: 0 auto; display: grid; gap: 16px; min-width: 0; }
.konto__kopf h1 { margin: 0; font-size: clamp(1.5rem, 2.4vw, 1.9rem); letter-spacing: -.02em; }
.konto__abschnitt { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; display: grid; gap: 8px; min-width: 0; }
.konto__abschnitt h2 { margin: 0; font-size: 1.05rem; font-weight: 650; }
.konto__abschnitt h3 { margin: 0; font-size: .95rem; font-weight: 650; }
.konto__abschnitt .aufg-leise { margin: 0; }
.konto__abschnitt .meldung { margin: 2px 0; }
.konto__abschnitt p { margin: 0; }
/* Formulare in der Kontoseite: Knopf in normaler Breite links, Felder hoechstens 320px */
.konto__abschnitt .formular { margin-top: 6px; justify-items: start; gap: 10px; }
.konto__abschnitt .formular label { width: 100%; max-width: 320px; }
.konto__abschnitt .btn { justify-self: start; width: auto; }
.konto__abschnitt .btn:disabled { opacity: .5; cursor: not-allowed; }
.konto__unterteil { display: grid; gap: 8px; margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--border); min-width: 0; }
.konto__abschnitt .formular label.haekchen { display: flex; align-items: flex-start; gap: 8px; width: auto; max-width: 100%; font-weight: 500; cursor: pointer; }
.haekchen input { width: 16px; height: 16px; margin: 3px 0 0; padding: 0; flex: 0 0 auto; accent-color: var(--brand); }
.sicherungen { list-style: none; margin: 0; padding: 0 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.sicherungen__zeile { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 13.5px; }
.sicherungen__zeile:first-child { border-top: none; }
.sicherungen__datum { font-weight: 600; font-variant-numeric: tabular-nums; }
.sicherungen__groesse { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.sicherungen__zeile .marke { margin-left: auto; }
.leer--klein { padding: 10px 14px; font-size: 13.5px; }
.konto__einladung { display: flex; gap: 8px; min-width: 0; }
.konto__einladung input { flex: 1 1 auto; min-width: 0; width: auto; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface-2); color: var(--text); }
.konto__einladung .btn { flex: 0 0 auto; }
@media (max-width: 480px) {
  .konto__abschnitt { padding: 16px; }
  .konto__abschnitt .formular label { max-width: 100%; }
  .konto__abschnitt .formular .btn { justify-self: stretch; width: 100%; }
  .konto__einladung { flex-direction: column; }
  .sicherungen__zeile .marke { margin-left: 0; }
}

/* ============ Karten "Jetzt machen", Tagesabschluss, Wochenplan (wie "Mein Tag" im Manager) ============ */
.aufg-kachel--philipp { border-top: 3px solid var(--orange-hell); }
.aufgabe--gross { scroll-margin-top: 70px; }
.aufgabe__zu { margin-left: auto; }
.aufg-zahlen--zwei { grid-template-columns: repeat(2, minmax(110px, auto)); }
.tagwahl { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.tagwahl .filter__knopf { flex: 0 0 auto; background: var(--surface-3); border: 1px solid var(--border); }
.tag-uhr { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.tag-karte { border-top: 3px solid var(--green-hell, var(--border-strong)); }
.tag-karte .aufg-kachel__fuss { flex-wrap: wrap; min-width: 0; }
.tag-zeit { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.woche { display: grid; gap: 12px; }
.woche-tag { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 12px 18px; display: grid; gap: 8px; min-width: 0; }
.woche-tag.ist-heute { border-color: var(--blue-hell); border-left: 5px solid var(--blue-hell); background: var(--surface); box-shadow: 0 8px 22px rgba(17, 24, 39, .08); }
.woche-tag__kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.woche-tag__kopf h2 { margin: 0; font-size: 1rem; }
.woche-liste { list-style: none; margin: 0; padding: 0; }
.woche-eintrag { display: grid; grid-template-columns: 52px 1fr auto; align-items: start; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); overflow-wrap: anywhere; }
.woche-eintrag__zeit { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.woche-eintrag--erledigt .woche-eintrag__text, .woche-eintrag--verschoben .woche-eintrag__text { color: var(--text-muted); }
@media (max-width: 480px) {
  .woche-eintrag { grid-template-columns: 44px 1fr; }
  .woche-eintrag .marke { grid-column: 2; justify-self: start; }
}

@media (max-width: 760px) {
  .aufg-zahlen { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .kopfleiste__ab { margin-left: 0; }
  .filter { order: 3; width: 100%; justify-content: space-between; }
  .filter__knopf { flex: 1; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { .btn, .aufg-kachel, .aufg-erledigt-block summary::before { transition: none; } }
