/* ==========================================================================
   Kompass v3: Navigation, Dashboard, Klassenraum-Pfad, Comic-Coach
   ========================================================================== */

/* ---------- Seitenkopf & Zurück ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head .h1 { margin-top: 6px; }
.back { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px 0 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text-2); font-weight: 700; font-size: 14px; transition: background-color 160ms ease, color 160ms ease; }
.back:hover { color: var(--text); background: var(--surface-2); }
.back svg { width: 18px; height: 18px; }
.appbar { display: none; }

/* ---------- Untere Leiste (mobil) ---------- */
@media (max-width: 860px) {
  .tabbar {
    left: 0; right: 0; bottom: 0; height: calc(66px + env(safe-area-inset-bottom)); border-radius: 22px 22px 0 0; padding: 0 6px env(safe-area-inset-bottom);
    grid-template-columns: repeat(5, 1fr); align-items: center; border: 0; border-top: 1px solid var(--line-2);
    background: color-mix(in srgb, var(--surface-solid) 92%, transparent); box-shadow: 0 -12px 40px -20px rgba(0, 0, 0, 0.8);
  }
  .tabbar a { height: 58px; border-radius: 14px; }
  .tabbar a.on { background: var(--grad-soft); }
  .tab-coach { position: relative; flex-direction: column; justify-content: flex-end !important; padding-bottom: 6px; }
  .tab-coach img { position: absolute; top: -26px; left: 50%; translate: -50% 0; width: 58px; height: 58px; border-radius: 50%; border: 3px solid var(--bg); box-shadow: 0 0 0 2px var(--primary), 0 10px 30px -8px rgba(91, 124, 255, 0.8); transition: transform 200ms var(--ease-out); }
  .tab-coach:active img { transform: scale(0.94); }
  .tab-coach.on { background: none !important; }
  .tab-coach.on span { color: var(--text); }
  .main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .appbar { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; margin: -6px 0 14px; }
  .appbar a { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--text-2); }
  .appbar a svg { width: 20px; height: 20px; }
  .appbar b { text-align: center; font-size: 15px; }
  .appbar + .topbar, .appbar + .page-head { margin-top: 0; }
  .demo-bar { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .toast-host { bottom: calc(96px + env(safe-area-inset-bottom)); }
}

/* ---------- Dashboard ---------- */
.dash-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.coach-hero { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; color: var(--text); }
.ch-face { width: 96px; height: 96px; border-radius: 50%; flex: none; box-shadow: 0 0 0 3px rgba(91, 124, 255, 0.5), 0 18px 40px -14px rgba(91, 124, 255, 0.8); }
.ch-bubble { position: relative; flex: 1; padding: 18px 20px; border-radius: 22px; border-top-left-radius: 6px; background: #f4f6ff; color: #111735; box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.7); margin-top: 18px; transition: transform 200ms var(--ease-out); }
.ch-bubble::before { content: ''; position: absolute; left: -12px; top: 0; border-width: 0 14px 16px 0; border-style: solid; border-color: transparent #f4f6ff transparent transparent; }
.ch-bubble p { margin: 0 0 10px; font-size: 16.5px; line-height: 1.5; font-weight: 500; }
.ch-cta { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 14px; color: #3d55d8; }
.ch-cta svg { width: 16px; height: 16px; }
@media (hover: hover) { .coach-hero:hover .ch-bubble { transform: translateY(-2px); } }
.coach-hero:active .ch-bubble { transform: scale(0.99); }

.journey { display: flex; align-items: center; gap: 0; padding: 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 18px; }
.jr { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; color: var(--text-2); padding: 6px 4px; border-radius: 14px; min-width: 0; }
.jr b { font-size: 14px; color: var(--text); }
.jr span:last-child { font-size: 12px; color: var(--muted); }
.jr-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; margin-bottom: 2px; }
.jr-dot svg { width: 14px; height: 14px; color: #fff; }
.jr.done .jr-dot { background: var(--grad); border-color: transparent; }
.jr.now { background: var(--grad-soft); }
.jr.now .jr-dot { border-color: var(--cyan); box-shadow: 0 0 0 5px rgba(56, 217, 230, 0.18); animation: pulse 2.4s var(--ease-out) infinite; }
.jr-line { flex: 0 0 18px; height: 2px; background: var(--line-2); border-radius: 2px; }

.dash2 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.dash2 .dash-tasks { grid-column: span 2; grid-row: span 2; }
.calm-cta.big { min-height: 100%; }
.mi-mono { width: 56px; height: 56px; border-radius: 18px; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 24px; color: #1b0f0a; background: linear-gradient(135deg, var(--dawn-2), var(--dawn)); box-shadow: 0 12px 30px -12px rgba(255, 154, 92, 0.7); }
.mi-mono.sm { width: 46px; height: 46px; font-size: 19px; border-radius: 14px; }
.mentor-intro { display: flex; align-items: center; gap: 18px; margin-bottom: 8px; }

/* ---------- Klassenraum-Pfad ---------- */
.dots-progress { display: flex; align-items: center; gap: 6px; }
.dots-progress i { width: 26px; height: 6px; border-radius: 6px; background: var(--surface-2); }
.dots-progress i.on { background: linear-gradient(90deg, var(--cyan), var(--primary)); }
.dots-progress i.now { background: var(--dawn); }
.dots-progress span { font-weight: 800; margin-left: 6px; }
.intro-card { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; border-color: rgba(255, 154, 92, 0.35); }
.intro-card > svg { width: 20px; height: 20px; color: var(--muted); }
.path-v { position: relative; display: flex; flex-direction: column; gap: 14px; padding-left: 8px; }
.path-v::before { content: ''; position: absolute; left: 30px; top: 30px; bottom: 30px; width: 3px; border-radius: 3px; background: linear-gradient(180deg, var(--primary), var(--line-2) 60%); }
.pv-row { position: relative; display: grid; grid-template-columns: 48px 1fr; gap: 16px; align-items: center; color: var(--text); }
.pv-node { position: relative; z-index: 1; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 17px; background: var(--surface-solid); border: 2px solid var(--line-2); color: var(--muted); }
.pv-node svg { width: 18px; height: 18px; }
.pv-row.done .pv-node { background: var(--grad); border-color: transparent; color: #fff; }
.pv-row.cur .pv-node { border-color: var(--dawn); color: var(--dawn); box-shadow: 0 0 0 6px rgba(255, 154, 92, 0.15); }
.pv-row.now.cur .pv-node { background: linear-gradient(135deg, var(--dawn-2), var(--dawn)); color: #1b0f0a; }
.pv-card { display: grid; grid-template-columns: 110px 1fr; border-radius: 20px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); transition: border-color 200ms ease, transform 200ms var(--ease-out); }
.pv-row.cur .pv-card { grid-template-columns: 180px 1fr; border-color: rgba(255, 154, 92, 0.4); background: linear-gradient(135deg, rgba(255, 154, 92, 0.08), var(--surface)); }
.pv-row.locked .pv-card { opacity: 0.6; }
@media (hover: hover) { .pv-row:hover .pv-card { border-color: var(--line-2); transform: translateX(3px); } }
.pv-img { position: relative; min-height: 100%; }
.pv-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pv-body { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; min-width: 0; }
.pv-body b { font-size: 17px; letter-spacing: -0.01em; }
.countdown.sm { font-size: 22px; margin-top: 6px; }
.after-card { display: flex; align-items: center; gap: 14px; margin-top: 18px; }

/* ---------- Kurstag ---------- */
.daybar { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.daybar span { display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: 0.06em; }
.daybar i { height: 5px; border-radius: 5px; background: var(--surface-2); }
.daybar .done { color: var(--cyan); } .daybar .done i { background: var(--cyan); }
.daybar .cur { color: var(--text); } .daybar .cur i { background: var(--grad); }
.ready-card { position: relative; border-radius: 26px; overflow: hidden; min-height: 460px; display: flex; align-items: flex-end; isolation: isolate; border: 1px solid var(--line); }
.ready-card > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.ready-card::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, rgba(6, 10, 21, 0.96) 25%, rgba(6, 10, 21, 0.35)); }
.ready-in { padding: clamp(22px, 4vw, 44px); color: #eef2ff; max-width: 680px; }
.ready-in .lead { color: #c5cdea; }
.living-hero { padding: clamp(22px, 4vw, 36px); border-radius: 24px; background: radial-gradient(500px 200px at 0% 0%, rgba(255, 154, 92, 0.2), transparent 70%), linear-gradient(135deg, rgba(79, 124, 255, 0.2), rgba(165, 92, 255, 0.1)); border: 1px solid var(--line-2); }
.note-row { display: grid; grid-template-columns: 48px 1fr; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface); font-size: 14px; }
.lockinfo { display: flex; align-items: center; gap: 12px; }
.coach-teaser { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 24px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line); }
.coach-teaser img { width: 120px; height: 120px; border-radius: 50%; }

/* ---------- Comic-Coach (Chat) ---------- */
body[data-section='coach'] .main { padding: 0; max-width: none; }
.cc { position: relative; display: flex; flex-direction: column; height: 100dvh; overflow: hidden; isolation: isolate;
  background: radial-gradient(700px 400px at 0% 0%, rgba(91, 124, 255, 0.18), transparent 70%), radial-gradient(600px 400px at 100% 100%, rgba(165, 92, 255, 0.12), transparent 70%); }
.cc-sky { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.cc.night { background: radial-gradient(600px 400px at 20% 0%, rgba(30, 40, 90, 0.6), transparent 70%), #03050c; }
.cc.night .cc-sky { background-image: radial-gradient(1.5px 1.5px at 20% 30%, #fff8, transparent), radial-gradient(1px 1px at 70% 20%, #fff6, transparent), radial-gradient(1.5px 1.5px at 85% 60%, #fff5, transparent), radial-gradient(1px 1px at 40% 80%, #fff5, transparent), radial-gradient(1px 1px at 55% 45%, #fff4, transparent); }
.cc-head { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px clamp(14px, 3vw, 28px) 10px; z-index: 2; }
.cc-back { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--text-2); flex: none; }
.cc-back svg { width: 20px; height: 20px; }
.cc-coach { position: relative; flex: none; }
.cc-coach img { width: 104px; height: 104px; border-radius: 50%; display: block; box-shadow: 0 0 0 3px rgba(91, 124, 255, 0.55), 0 20px 50px -16px rgba(91, 124, 255, 0.9); transition: transform 300ms var(--ease-out); }
.cc-coach img.talking { animation: talk 900ms ease-in-out infinite; }
@keyframes talk { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-2px) rotate(-1.5deg); } 60% { transform: translateY(1px) rotate(1deg); } }
.cc-live { position: absolute; right: 6px; bottom: 6px; width: 16px; height: 16px; border-radius: 50%; background: var(--ok); border: 3px solid var(--bg); }
.cc.night .cc-live { background: #7a8cff; }
.cc-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cc-meta b { font-size: 18px; }
.cc-meta span { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.cc-meta span svg { width: 15px; height: 15px; }
.cc-night { width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); cursor: pointer; display: grid; place-items: center; }
.cc-night svg { width: 20px; height: 20px; }
.cc-night.on { background: #1d2550; color: #c9d3ff; border-color: #3a4690; }
.cc-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.cc-col { max-width: 820px; margin: 0 auto; padding: 8px clamp(14px, 3vw, 28px) 24px; display: flex; flex-direction: column; gap: 14px; }
.cc-ai { position: relative; align-self: flex-start; max-width: min(620px, 90%); margin-left: 34px; }
.speech { position: relative; background: #f4f6ff; color: #111735; padding: 14px 18px; border-radius: 22px; border-top-left-radius: 6px; font-size: 16px; line-height: 1.58; box-shadow: 0 14px 34px -18px rgba(0, 0, 0, 0.7); overflow-wrap: anywhere; }
.speech::before { content: ''; position: absolute; left: -14px; top: 0; border-width: 0 16px 18px 0; border-style: solid; border-color: transparent #f4f6ff transparent transparent; }
.speech p { margin: 0 0 0.6em; } .speech p:last-child { margin: 0; }
.speech ul { margin: 0.2em 0 0.6em; padding-left: 1.2em; }
.speech b { color: #0a0f2a; }
.speech .typing i { background: #6a73a0; }
.speech .list-card { background: #fff; border-color: #dfe3f7; color: #111735; }
.speech .btn.sm { background: #111735; color: #fff; box-shadow: none; }
.cc.night .speech { background: #1b2146; color: #dfe4ff; }
.cc.night .speech::before { border-color: transparent #1b2146 transparent transparent; }
.cc.night .speech b { color: #fff; }
.cc-acts { display: flex; gap: 2px; margin: 4px 0 0 6px; opacity: 0.55; }
.cc-acts button { width: 30px; height: 30px; border: 0; background: none; color: var(--muted); border-radius: 8px; display: grid; place-items: center; cursor: pointer; }
.cc-acts button svg { width: 16px; height: 16px; }
.cc-acts button.on { color: var(--cyan); }
.cc-me { display: flex; justify-content: flex-end; }
.cc-me > div { max-width: min(560px, 82%); padding: 11px 16px; border-radius: 20px; border-bottom-right-radius: 6px; background: var(--grad); color: #fff; font-size: 16px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: 0 12px 28px -16px rgba(91, 124, 255, 0.9); }
.pop { animation: popIn 320ms var(--ease-out) both; }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(0.97); } }
.cc-ai.pop { transform-origin: 0 0; }
.cc-dock { display: flex; align-items: flex-end; gap: 10px; padding: 10px clamp(12px, 3vw, 28px) calc(12px + env(safe-area-inset-bottom)); max-width: 860px; width: 100%; margin: 0 auto; }
.cc-input { flex: 1; min-width: 0; border-radius: 26px; background: var(--surface-solid); border: 1px solid var(--line-2); padding: 6px 16px; transition: border-color 160ms ease, box-shadow 160ms ease; }
.cc-input:focus-within { border-color: rgba(91, 124, 255, 0.6); box-shadow: 0 0 0 4px rgba(91, 124, 255, 0.14); }
.cc-input textarea { width: 100%; border: 0; outline: none; background: none; resize: none; font-size: 16px; line-height: 1.5; padding: 8px 0; max-height: 160px; color: var(--text); }
.cc-mic, .cc-send { width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; flex: none; background: var(--grad); color: #fff; box-shadow: var(--glow); transition: transform 150ms var(--ease-out); }
.cc-mic:active, .cc-send:active { transform: scale(0.92); }
.cc-mic svg, .cc-send svg { width: 22px; height: 22px; }
.cc-mic.on { background: #ff4d6a; animation: micPulse 1.4s ease-out infinite; }
.cc-mic.hide, .cc-send.hide { display: none; }
.cc-private { text-align: center; font-size: 11.5px; color: #8e98c9; padding: 0 0 calc(8px + env(safe-area-inset-bottom)); }
.cx-err { color: #c62d44 !important; }
@media (max-width: 860px) {
  body[data-section='coach'] .tabbar { display: none; }
  .cc-coach img { width: 84px; height: 84px; }
  .cc-ai { margin-left: 18px; }
  .speech { font-size: 15.5px; }
}

/* ---------- Mobile Feinschliff ---------- */
@media (max-width: 1080px) {
  .dash2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash2 .dash-tasks { grid-column: span 2; grid-row: auto; }
}
@media (max-width: 860px) {
  .dash2 { grid-template-columns: minmax(0, 1fr); }
  .dash2 .dash-tasks { grid-column: auto; }
  .coach-hero { gap: 12px; }
  .ch-face { width: 72px; height: 72px; }
  .ch-bubble { padding: 14px 16px; margin-top: 12px; }
  .ch-bubble p { font-size: 15.5px; }
  .journey { padding: 10px 8px; }
  .jr b { font-size: 13px; } .jr span:last-child { font-size: 11px; }
  .jr-line { flex-basis: 8px; }
  .pv-card, .pv-row.cur .pv-card { grid-template-columns: 84px 1fr; }
  .pv-body { padding: 12px 14px; }
  .pv-body b { font-size: 15.5px; }
  .path-v::before { left: 29px; }
  .ready-card { min-height: 420px; }
  .daybar span { font-size: 9.5px; letter-spacing: 0.02em; }
  .mentor-intro { flex-direction: column; align-items: flex-start; }
  .kpis { width: 100%; }
}
