/* =========================================================================
   DesignDich – Design System
   Marken-Assets aus /Branding: Inknut-Antiqua-Schrift, Logo, Phasen-Icons,
   warme Aquarell-Palette. Pro Phase eine eigene Akzentfarbe.
   ========================================================================= */

/* ---- Markenschrift: Inknut Antiqua (OFL, aus dem Branding-Ordner) ------ */
@font-face { font-family: "Inknut Antiqua"; font-weight: 300; font-display: swap;
  src: url("../assets/fonts/InknutAntiqua-Light.ttf") format("truetype"); }
@font-face { font-family: "Inknut Antiqua"; font-weight: 400; font-display: swap;
  src: url("../assets/fonts/InknutAntiqua-Regular.ttf") format("truetype"); }
@font-face { font-family: "Inknut Antiqua"; font-weight: 500; font-display: swap;
  src: url("../assets/fonts/InknutAntiqua-Medium.ttf") format("truetype"); }
@font-face { font-family: "Inknut Antiqua"; font-weight: 600; font-display: swap;
  src: url("../assets/fonts/InknutAntiqua-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "Inknut Antiqua"; font-weight: 700; font-display: swap;
  src: url("../assets/fonts/InknutAntiqua-Bold.ttf") format("truetype"); }
@font-face { font-family: "Inknut Antiqua"; font-weight: 800; font-display: swap;
  src: url("../assets/fonts/InknutAntiqua-ExtraBold.ttf") format("truetype"); }
@font-face { font-family: "Inknut Antiqua"; font-weight: 900; font-display: swap;
  src: url("../assets/fonts/InknutAntiqua-Black.ttf") format("truetype"); }

:root {
  --ink: #0f0f0f;          /* Marken-Schwarz (aus Logo & Icons) */
  --ink-soft: #54545c;
  --ink-faint: #8a8a93;
  --line: #ece4da;
  --line-soft: #f4ede4;
  --bg: #fdf6ee;           /* warmes Aquarell-Cremeweiss */
  --surface: #ffffff;
  --brand: #f06f5e;        /* Korall-Ton des Logos */
  --brand-dark: #d9594a;
  --peach: #fbd6b8;        /* Aquarell-Pfirsich */
  --rose: #f4a8aa;         /* Aquarell-Rosa */
  --accent: #0f0f0f;
  --ok: #2fa36b;
  --warn: #e8a13a;

  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --shadow: 0 1px 2px rgba(27, 27, 31, .04), 0 8px 28px rgba(27, 27, 31, .06);
  --shadow-lg: 0 18px 50px rgba(27, 27, 31, .12);
  /* Markenschrift Inknut Antiqua für Titel/Logo, klare Sans für Lesetext */
  --font-display: "Inknut Antiqua", Georgia, "Times New Roman", serif;
  --font: "Helvetica Neue", Helvetica, "Inter", system-ui, -apple-system, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  font-size: 16px;
}

h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 700; letter-spacing: 0; line-height: 1.2; }
h1 { font-size: 1.75rem; }
p { margin: 0; }
a { color: inherit; }
button { font-family: inherit; }

.muted { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.center { text-align: center; }

/* ---------- Buttons -------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem; justify-content: center;
  border: none; cursor: pointer; font-weight: 600; font-size: .95rem;
  padding: .72rem 1.2rem; border-radius: 999px; transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
  background: var(--ink); color: #fff;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.brand { background: var(--brand); }
.btn.brand:hover { background: var(--brand-dark); }
.btn.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn.ghost:hover { background: #fff; border-color: var(--ink); }
.btn.light { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.btn.sm { padding: .5rem .85rem; font-size: .85rem; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.linkbtn { background: none; border: none; color: var(--ink-soft); cursor: pointer; font-size: .85rem; padding: .25rem; text-decoration: underline; }
.linkbtn:hover { color: var(--brand); }

/* ---- Marken-Icons (einfarbig umfärbbar via CSS-Maske) --------------- */
.svgicon { display: inline-block; flex-shrink: 0;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  -webkit-mask-size: contain; mask-size: contain;
  background-color: currentColor; }

/* ---- Logo / Wortmarke ----------------------------------------------- */
.wordmark { height: 26px; width: auto; display: block; cursor: pointer; }
.logo-full { width: 160px; height: auto; display: block; margin: 0 auto; }
.logo-hero { width: 180px; height: auto; }

/* ---------- Inputs --------------------------------------------------- */
label.field { display: block; margin-bottom: 1rem; }
label.field > span { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-soft); margin-bottom: .35rem; }
input[type=text], input[type=password], input[type=date], input[type=email], textarea, select {
  width: 100%; padding: .75rem .9rem; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 1rem; background: #fff; color: var(--ink); transition: border-color .15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--ink); }
textarea { resize: vertical; min-height: 92px; }

/* ---------- Cards ---------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.pad { padding: 1.5rem; }

/* ---------- Tags / Pills --------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: .4rem; font-size: .75rem; font-weight: 600;
  padding: .25rem .65rem; border-radius: 999px; background: var(--line-soft); color: var(--ink-soft); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill.done { background: rgba(47,163,107,.12); color: var(--ok); }
.pill.in_progress { background: rgba(232,161,58,.15); color: #b9802a; }
.pill.not_started { background: var(--line-soft); color: var(--ink-faint); }

/* =========================================================================
   Layout-Shell
   ========================================================================= */
.app { min-height: 100%; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30; background: rgba(250,247,242,.85);
  backdrop-filter: saturate(140%) blur(10px); border-bottom: 1px solid var(--line);
}
.topbar-inner { max-width: 1160px; margin: 0 auto; padding: .85rem 1.25rem;
  display: flex; align-items: center; gap: 1rem; }
.brandmark { display: flex; align-items: center; gap: .6rem; cursor: pointer; font-weight: 800; letter-spacing: -.03em; font-size: 1.15rem; }
.brandmark .logo { width: 30px; height: 30px; border-radius: 9px; background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 1.05rem; transform: rotate(-6deg); }
.brandmark b { color: var(--brand); }
.spacer { flex: 1; }
.who { display: flex; align-items: center; gap: .6rem; font-size: .9rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: .9rem; }
.role-tag { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  padding: .15rem .5rem; border-radius: 6px; background: var(--line-soft); color: var(--ink-soft); }

.main { max-width: 1160px; width: 100%; margin: 0 auto; padding: 2rem 1.25rem 4rem; flex: 1; }

/* =========================================================================
   Auth / Landing
   ========================================================================= */
.landing { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }
.landing-hero { background: #fbd6b8; color: #3a2010; padding: 3.5rem; display: flex; flex-direction: column;
  position: relative; overflow: hidden; align-self: start; min-height: 100vh; }
.landing-hero h1 { font-size: 2.7rem; max-width: 12ch; color: #3a2010; }
.phasechips { display: flex; flex-wrap: wrap; gap: .5rem; position: relative; }
.phasechips span { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; padding: .35rem .7rem; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.15); }

/* Preisübersicht auf der Login-Seite */
.pricing-block { margin-top: auto; padding-top: 2rem; }
.pricing-title { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #7a4e28; margin-bottom: .75rem; }
.pricing-tiers { display: flex; gap: .75rem; }
.pricing-tier { flex: 1; padding: 1rem 1.1rem; border-radius: var(--radius-sm); cursor: pointer;
  background: #c1272d; transition: background .15s, transform .08s, box-shadow .15s;
  box-shadow: 0 4px 18px rgba(193,39,45,.25); }
.pricing-tier:hover { background: #a8222a; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(193,39,45,.35); }
.pricing-divider { display: none; }
.pt-name { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: rgba(255,255,255,.65); margin-bottom: .25rem; }
.pt-price { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; color: #fff; line-height: 1.15; }
.pt-unit { font-family: var(--font); font-size: .68rem; font-weight: 500; color: rgba(255,255,255,.75); }
.pt-desc { font-size: .76rem; color: rgba(255,255,255,.85); margin-top: .35rem; line-height: 1.45; }
.pt-limit { font-size: .71rem; color: rgba(255,255,255,.55); margin-top: .25rem; }
.pt-contact { font-size: .71rem; color: rgba(255,255,255,.55); margin-top: .25rem; }
.pt-cta { display: inline-block; margin-top: .6rem; font-size: .8rem; font-weight: 700;
  color: #fff; border-bottom: 1.5px solid rgba(255,255,255,.5); padding-bottom: 1px; }
.landing-form { display: grid; place-items: center; padding: 2rem; }
.auth-card { width: 100%; max-width: 380px; }
.seg { display: flex; background: var(--line-soft); border-radius: 999px; padding: .25rem; margin-bottom: 1.4rem; }
.seg button { flex: 1; border: none; background: none; padding: .55rem; border-radius: 999px; font-weight: 600; cursor: pointer; color: var(--ink-soft); white-space: nowrap; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.seg button:disabled { opacity: .4; cursor: not-allowed; }
.demo-hint { font-size: .8rem; color: var(--ink-faint); margin-top: 1rem; text-align: center; line-height: 1.6; }
.role-pick { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; margin-bottom: 1rem; }
.role-pick .opt { border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: .8rem; cursor: pointer; text-align: center; transition: .15s; }
.role-pick .opt.on { border-color: var(--ink); background: #fff; box-shadow: var(--shadow); }
.role-pick .opt .ic { font-size: 1.4rem; }
.role-pick .opt .lb { font-weight: 600; font-size: .9rem; margin-top: .2rem; }

.errbox { background: rgba(255,90,77,.1); color: var(--brand-dark); padding: .7rem .9rem; border-radius: var(--radius-sm); font-size: .88rem; margin-bottom: 1rem; }

/* =========================================================================
   Student – Roadmap
   ========================================================================= */
.student-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.75rem; flex-wrap: wrap; }

.page-head { display: flex; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.page-head .grow { flex: 1; min-width: 240px; }
.eyebrow { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); }

.howcard { display: flex; gap: 1rem; align-items: center; }
.howcard .q { flex: 1; }
.howcard .q .lab { font-size: .78rem; font-weight: 700; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em; }
.howcard .q .val { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; line-height: 1.35; margin-top: .15rem; }
.howcard .q .val.empty { color: var(--ink-faint); font-weight: 500; font-size: 1.05rem; }

.progress-wrap { margin: 1.25rem 0 2rem; }
.progress-bar { height: 10px; background: var(--line-soft); border-radius: 999px; overflow: hidden; }
.progress-bar > i { display: block; height: 100%; background: var(--brand); border-radius: 999px; transition: width .4s ease; }
.progress-meta { display: flex; justify-content: space-between; font-size: .82rem; color: var(--ink-soft); margin-top: .5rem; }

.roadmap { display: grid; gap: 1rem; }
.phase-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 1.1rem; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.3rem; cursor: pointer; transition: transform .1s, box-shadow .15s, border-color .15s; position: relative;
}
.phase-row:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.phase-row .num { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  font-size: 1.4rem; color: #fff; position: relative; }
.phase-row .num small { position: absolute; bottom: -6px; right: -6px; background: #fff; color: var(--ink);
  width: 20px; height: 20px; border-radius: 50%; font-size: .68rem; font-weight: 800; display: grid; place-items: center; box-shadow: var(--shadow); }
.phase-row .body .nm { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.phase-row .body .tl { color: var(--ink-soft); font-size: .9rem; }
.phase-row .chev { color: var(--ink-faint); font-size: 1.3rem; }
.phase-row.done { border-color: rgba(47,163,107,.4); }

.connector { width: 2px; height: 14px; background: var(--line); margin-left: 36px; }

/* =========================================================================
   Student – Phasen-Detail
   ========================================================================= */
.phase-hero { border-radius: var(--radius-lg); padding: 2rem; color: #fff; position: relative; overflow: hidden; margin-bottom: 1.5rem; }
.phase-hero .ic { font-size: 2.6rem; }
.phase-hero h1 { font-size: 2rem; margin-top: .4rem; }
.phase-hero .tl { opacity: .9; font-weight: 600; margin-top: .2rem; }
.phase-hero .intro { margin-top: 1rem; max-width: 62ch; opacity: .95; line-height: 1.6; }
.phase-hero .ring { position: absolute; right: -50px; top: -50px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.12); }

.grid2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1.25rem; align-items: start; }
.section-title { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); margin-bottom: .75rem; }

.steps li { margin-bottom: .6rem; padding-left: .4rem; }

/* Arbeitsblatt-Download-Liste */
.ws-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .65rem; }
.ws-dl { display: flex; align-items: center; gap: .8rem; text-decoration: none; color: inherit;
  border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: .7rem .85rem;
  background: #fff; transition: border-color .15s, transform .08s, box-shadow .15s; }
.ws-dl:hover { border-color: var(--ink); transform: translateY(-1px); box-shadow: var(--shadow); }
.ws-dl-badge { flex-shrink: 0; font-size: .62rem; font-weight: 800; letter-spacing: .03em; color: #fff;
  background: var(--brand); padding: .35rem .4rem; border-radius: 7px; }
.ws-dl-txt { flex: 1; min-width: 0; line-height: 1.25; }
.ws-dl-txt b { display: block; font-size: .95rem; }
.ws-dl-desc { font-size: .8rem; color: var(--ink-faint); }
.ws-dl-arrow { color: var(--ink-faint); font-size: 1.05rem; flex-shrink: 0; }
.ws-dl:hover .ws-dl-arrow { color: var(--brand); }
.ws-dl-locked { cursor: default; opacity: .65; }
.ws-dl-locked:hover { transform: none; box-shadow: none; border-color: var(--line); }
.ws-dl-badge-demo { background: var(--ink-faint) !important; }

/* Lizenz-Banner */
.license-banner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: .75rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem; font-size: .9rem; font-weight: 500; }
.license-banner.demo { background: rgba(232,161,58,.15); border: 1px solid rgba(232,161,58,.4); color: #8a5e00; }
.license-banner.expired { background: rgba(240,95,78,.12); border: 1px solid rgba(240,95,78,.4); color: #a33020; }
.license-banner.licensed { background: rgba(47,163,107,.1); border: 1px solid rgba(47,163,107,.35); color: #1e7a4f; }
.license-banner .btn { background: var(--ink); color: #fff; }
.ws-card { display: flex; flex-direction: column; gap: .5rem; }
.ws-audio { display: flex; align-items: center; gap: .5rem; padding: 0 .2rem; }
.ws-audio-ic { font-size: 1rem; }
.ws-audio audio { flex: 1; height: 34px; }

/* Ausklappbarer Abschnitt (z. B. Coaches) */
.collapse-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; cursor: pointer; }
.collapse-head:hover .acc-chev { color: var(--brand); }

/* Coach-Karten (Tiere) */
.coach-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; margin-top: 1rem; }
.coach-card-intro { display: flex; flex-direction: column; align-items: center; gap: .4rem;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .75rem .6rem; text-align: center; }
.coach-portrait { width: 96px; height: 96px; object-fit: contain; border-radius: 50%;
  background: var(--line-soft); padding: 4px; }
.coach-info { display: flex; flex-direction: column; line-height: 1.2; }
.coach-info b { font-size: 1rem; }
.coach-info .faint { font-size: .78rem; }
.coach-card-intro audio { width: 100%; height: 32px; margin-top: .25rem; }
.coach-section .collapse-head { display: flex; justify-content: space-between; align-items: center; cursor: pointer; }

/* Hörbeiträge / Audio-Liste */
.audio-list { display: grid; gap: .6rem; }
.audio-item { display: flex; align-items: center; gap: .7rem; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: .55rem .7rem; }
.audio-ic { font-size: 1.2rem; flex-shrink: 0; }
.audio-img { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; flex-shrink: 0; background: var(--line-soft); }
.audio-item.has-img { align-items: center; }
.audio-main { flex: 1; min-width: 0; }
.audio-t { font-weight: 600; font-size: .9rem; margin-bottom: .2rem; }
.audio-main audio { width: 100%; height: 36px; }

/* Datei-Chip (PDF/sonstige Datei) */
.filechip { display: inline-flex; align-items: center; gap: .5rem; background: var(--line-soft);
  border-radius: var(--radius-sm); padding: .6rem .8rem; font-size: .9rem; word-break: break-all; }
.filechip .fc-ic { font-size: 1.3rem; }
.thumb-file { background: var(--line-soft); display: grid; place-items: center; font-size: 1.6rem; cursor: pointer; }
.coach-pdf { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem;
  aspect-ratio: 4/3; background: var(--line-soft); text-decoration: none; color: var(--ink-soft); font-weight: 600; font-size: .85rem; }

/* ---- FindDich-Aufgaben-Flow ----------------------------------------- */
.activity-flow { display: grid; gap: 1.1rem; }
.activity { padding: 1.25rem 1.4rem; }
.activity-head { display: flex; align-items: center; gap: .85rem; margin-bottom: 1rem; }
.activity-num { width: 32px; height: 32px; border-radius: 50%; color: #fff; font-weight: 700;
  display: grid; place-items: center; flex-shrink: 0; font-size: .95rem; }
.activity-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 600; }
.activity-main { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.activity-main:empty { display: none; }
.activity-cell { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .85rem; }
.cell-lab { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); margin-bottom: .55rem; }
.activity-cell .ws-dl { background: #fff; }
.activity-up { margin-top: 1rem; padding-top: 1rem; border-top: 1px dashed var(--line); }

/* ---- Kapitel-Band (DesignDich) im Roadmap --------------------------- */
.chapter-band { display: flex; align-items: center; gap: 1rem; padding: .35rem .25rem .35rem 0; margin-top: .25rem; }
.cb-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; }
.cb-body { flex: 1; }
.cb-name { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; }
.cb-tag { color: var(--ink-soft); font-size: .9rem; }
.chapter-intro { padding: 1rem 1.1rem; margin: 0 0 .25rem 1.25rem; border-left: 3px solid var(--line); border-radius: 0 var(--radius) var(--radius) 0; }
.subphases { display: grid; gap: .7rem; margin-left: 1.25rem; padding-left: 1rem; border-left: 2px solid var(--line); }
.phase-row.nested { padding: .85rem 1rem; }
.phase-row.nested .num { width: 40px; height: 40px; border-radius: 12px; }
.phase-row.nested .body .nm { font-size: 1rem; }

/* Aufklappbare Phasen mit Dokumentation (Lehrer-Drawer) */
.phase-acc { padding: 0; overflow: hidden; }
.phase-acc-head { display: flex; align-items: center; gap: .8rem; padding: .7rem 1rem; }
.phase-acc-head.clickable { cursor: pointer; }
.phase-acc-head.clickable:hover { background: #fffdf9; }
.acc-chev { color: var(--ink-faint); font-size: 1.2rem; display: inline-block; transition: transform .15s ease; flex-shrink: 0; }
.acc-chev.open { transform: rotate(90deg); }
.phase-acc-body { display: grid; gap: .6rem; padding: .5rem 1rem 1rem; border-top: 1px solid var(--line-soft); }

/* Klassencode-Chip */
.invite-code { font-size: .8rem; font-weight: 700; font-family: monospace; letter-spacing: .05em;
  background: #fff3e0; color: #8B4513; border: 1px solid #f4c89a; border-radius: 6px;
  padding: .15rem .5rem; cursor: pointer; }
.invite-code:hover { background: #ffe0b2; }

/* Klassen-Verwaltung (Modal) */
.manage-add { display: flex; gap: .5rem; padding-bottom: .9rem; border-bottom: 1px solid var(--line-soft); }
.manage-add input { flex: 1; min-width: 0; }
.manage-list { display: grid; gap: .6rem; }
.manage-row-wrap { display: grid; gap: .3rem; padding-bottom: .6rem; border-bottom: 1px solid var(--line-soft); }
.manage-row-wrap:last-child { border-bottom: none; padding-bottom: 0; }
.manage-teachers { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .82rem; padding-left: .1rem; }
.manage-row { display: flex; align-items: center; gap: .5rem; }
.manage-row input { flex: 1; min-width: 0; }
.manage-count { font-size: .78rem; color: var(--ink-faint); white-space: nowrap; }

/* Kapitel-Zwischentitel im Lehrer-Drawer */
.chapter-mini { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700;
  font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft);
  margin: .9rem 0 .5rem; }
.guide-card { display: flex; gap: .8rem; align-items: flex-start; background: var(--line-soft); border-radius: var(--radius-sm); padding: 1rem; margin-top: 1rem; }
.guide-card .em { font-size: 1.5rem; }

/* Upload-Bereich */
.tool-tabs { display: flex; gap: .4rem; margin-bottom: 1rem; flex-wrap: wrap; }
.tool-tabs button { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: .5rem .9rem;
  font-weight: 600; font-size: .88rem; cursor: pointer; display: inline-flex; gap: .4rem; align-items: center; }
.tool-tabs button.on { border-color: var(--ink); background: var(--ink); color: #fff; }

.dropzone { border: 2px dashed var(--line); border-radius: var(--radius-sm); padding: 1.6rem; text-align: center; cursor: pointer; transition: .15s; background: #fff; }
.dropzone:hover { border-color: var(--ink); background: #fffdfa; }
.dropzone .big { font-size: 1.8rem; }

.recorder { text-align: center; padding: 1rem; }
.rec-time { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; margin: .5rem 0; }
.rec-dot { width: 11px; height: 11px; border-radius: 50%; background: var(--brand); display: inline-block; animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

/* Eintrags-Liste */
.entries { display: grid; gap: .8rem; margin-top: 1rem; }
.entry { display: flex; gap: .8rem; background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .8rem; }
.entry .thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex-shrink: 0; background: var(--line-soft); }
.entry .ebody { flex: 1; min-width: 0; }
.entry .etype { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); }
.entry .etext { white-space: pre-wrap; word-break: break-word; }
.entry audio { width: 100%; margin-top: .3rem; }
.entry time { font-size: .75rem; color: var(--ink-faint); }
.entry .del { align-self: flex-start; }

.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--ink-faint); }
.empty-state .em { font-size: 2rem; }

/* =========================================================================
   Lehrer-Dashboard
   ========================================================================= */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.75rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; box-shadow: var(--shadow); }
.stat .n { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; }
.stat .l { font-size: .82rem; color: var(--ink-soft); }

.toolbar { display: flex; gap: .75rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.toolbar input[type=text] { max-width: 260px; }
.toolbar select { max-width: 160px; }

.student-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.student-table th { text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); padding: .85rem 1rem; border-bottom: 1px solid var(--line); font-weight: 700; }
.student-table td { padding: .85rem 1rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.student-table tr:last-child td { border-bottom: none; }
.student-table tbody tr { cursor: pointer; transition: background .12s; }
.student-table tbody tr:hover { background: #fffdf9; }
.s-name { display: flex; align-items: center; gap: .7rem; }
.s-name .av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: .85rem; flex-shrink: 0; }

/* Phasen-Punkte-Reihe */
.phasedots { display: flex; gap: 5px; }
.phasedots .pd { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-size: .7rem; background: var(--line-soft); color: var(--ink-faint); position: relative; }
.phasedots .pd.done { color: #fff; }
.phasedots .pd.in_progress { box-shadow: inset 0 0 0 2px currentColor; background: #fff; }

.row-actions { display: flex; gap: .15rem; justify-content: flex-end; }
.icon-btn { border: none; background: transparent; cursor: pointer; font-size: 1rem; line-height: 1;
  padding: .35rem .45rem; border-radius: 8px; opacity: .65; transition: background .12s, opacity .12s; }
.icon-btn:hover { background: var(--line-soft); opacity: 1; }

.miniprog { display: flex; align-items: center; gap: .6rem; }
.miniprog .track { width: 80px; height: 7px; border-radius: 999px; background: var(--line-soft); overflow: hidden; }
.miniprog .track > i { display: block; height: 100%; background: var(--ok); }

/* Coaching */
.coach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.coach-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.coach-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: var(--line-soft); display: block; }
.coach-card .cc-body { padding: .85rem 1rem; }
.coach-card .cc-tool { font-weight: 700; }
.coach-card .cc-meta { font-size: .78rem; color: var(--ink-faint); }
.coach-card .cc-notes { font-size: .9rem; color: var(--ink-soft); margin-top: .4rem; white-space: pre-wrap; }

/* =========================================================================
   Modal
   ========================================================================= */
.modal-back { position: fixed; inset: 0; background: rgba(27,27,31,.45); backdrop-filter: blur(2px); z-index: 50; display: grid; place-items: center; padding: 1.25rem; }
.modal { background: var(--surface); border-radius: var(--radius-lg); max-width: 520px; width: 100%; box-shadow: var(--shadow-lg); max-height: 90vh; overflow: auto; }
.modal .mhead { display: flex; align-items: center; justify-content: space-between; padding: 1.3rem 1.5rem 0; }
.modal .mbody { padding: 1.25rem 1.5rem 1.5rem; }
.xbtn { border: none; background: var(--line-soft); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 1.1rem; color: var(--ink-soft); }
.xbtn:hover { background: var(--line); }

/* ---------- Drawer (Lehrer Schülerdetail) ---------------------------- */
.drawer-back { position: fixed; inset: 0; background: rgba(27,27,31,.4); z-index: 50; }
.drawer { position: fixed; top: 0; right: 0; height: 100%; width: min(680px, 96vw); background: var(--bg); z-index: 51; box-shadow: var(--shadow-lg); overflow-y: auto; animation: slidein .2s ease; }
@keyframes slidein { from { transform: translateX(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.drawer-head { position: sticky; top: 0; background: var(--bg); padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 1rem; z-index: 2; }
.drawer-body { padding: 1.5rem; }

/* ---------- Toast ---------------------------------------------------- */
.toast-wrap { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: .5rem; }
.toast { background: var(--ink); color: #fff; padding: .7rem 1.1rem; border-radius: 999px; font-size: .9rem; font-weight: 600; box-shadow: var(--shadow-lg); animation: rise .25s ease; }
.toast.err { background: var(--brand-dark); }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Loader --------------------------------------------------- */
.loader { display: grid; place-items: center; min-height: 60vh; }
.spin { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: rot .8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- Responsive ---------------------------------------------- */
@media (max-width: 860px) {
  .landing { grid-template-columns: 1fr; }
  .landing-hero { display: none; }
  .grid2 { grid-template-columns: 1fr; }
  .activity-main { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .student-table .hide-sm { display: none; }
  h1 { font-size: 1.6rem; }
}
@media (max-width: 540px) {
  .main { padding: 1.25rem 1rem 3rem; }
  .stat-row { grid-template-columns: 1fr 1fr; }
}
