:root {
  --bg: #07070c;
  --surface: rgb(255 255 255 / .028);
  --surface-solid: #100f1a;
  --border: rgb(255 255 255 / .08);
  --line: rgb(255 255 255 / .1);
  --text: #ecebf3;
  --soft: #d6d4e2;
  --muted: #9b99ad;
  --violet: #8b5cf6;
  --green: #10b981;
  --c1: #b79cff;
  --c2: #93a4ff;
  --c3: #62d6c6;
  --c4: #6fe3a1;
  --c5: #e8a6d9;
  --orange: #fb923c;
  --ok: #4ade80;
  --progress: 0%;
  --display: "Sora", system-ui, sans-serif;
  --body: "Figtree", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; position: relative; overflow-x: hidden;
  background: var(--bg); color: var(--text);
  font: 400 1rem/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
}
/* Hintergrundlichter */
body::before, body::after {
  content: ""; position: fixed; z-index: 0; pointer-events: none; border-radius: 50%;
  filter: blur(110px);
}
body::before { width: 720px; height: 520px; left: -180px; top: -260px; background: var(--violet); opacity: .32; }
body::after  { width: 640px; height: 480px; right: -200px; bottom: -280px; background: var(--green); opacity: .2; }

a { color: inherit; }
a:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 6px; }

.page { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 72px 24px 48px; }
.page.narrow { max-width: 960px; padding-top: 40px; }

/* Kopf */
.top { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 40px; }
h1 {
  font: 600 clamp(2rem, 4.2vw, 3rem)/1.08 var(--display);
  letter-spacing: -0.025em; margin: 0; color: #fff; max-width: 18ch;
}
h2 { font: 600 1.3rem/1.2 var(--display); letter-spacing: -0.01em; margin: 0; color: var(--text); }
.lead { margin: 14px 0 0; max-width: 60ch; font-size: 1.05rem; color: var(--muted); }
.lead strong { color: var(--soft); font-weight: 500; }
.lead code { font: .92em ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--soft); padding: 1px 6px; border-radius: 6px; background: rgb(255 255 255 / .06); }
.updated {
  margin: 0; padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--muted); font-size: .88rem; white-space: nowrap;
}

.icon {
  flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 25%, transparent);
}
.icon svg { width: 22px; height: 22px; }

.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 18px 0 0; }
.status {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: .82rem; font-weight: 500; color: color-mix(in srgb, var(--c) 70%, white);
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.when { color: var(--muted); font-size: .88rem; }

.bar { display: block; height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 6px; background: var(--c); min-width: 0; }

/* ---------- Formulare, Login, Sitzung ---------- */
[hidden] { display: none !important; }
.btn {
  font: 600 .92rem/1 var(--body); padding: 11px 18px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.btn:hover:not(:disabled) { border-color: rgb(255 255 255 / .25); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: #fff; color: #0c0b14; border-color: #fff; }
.btn.ghost { background: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

input[type="text"], input[type="password"], input[type="number"], select {
  font: 400 .95rem/1.3 var(--body); color: var(--text);
  background: rgb(255 255 255 / .04); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px;
}
input:hover, select:hover { border-color: rgb(255 255 255 / .18); }
select option { background: #15141f; }
label { color: var(--muted); font-size: .85rem; }

/* Anmeldung */
.login { max-width: 420px; margin: 12vh auto 0; }
.login-back { margin-bottom: 28px; }
.login h1 { font-size: 2rem; }
.login-form { margin-top: 28px; display: grid; gap: 8px; }
.login-form input { width: 100%; }
.login-form .btn { margin-top: 8px; justify-self: start; }
.form-error { min-height: 1.4em; margin: 0; color: var(--orange); font-size: .9rem; }
.form-hint { margin: -2px 0 6px; color: var(--muted); font-size: .82rem; }
.form-ok { min-height: 1.4em; margin: 0; color: var(--ok); font-size: .9rem; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.login-form .form-actions .btn { margin-top: 0; }

.session { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin: -40px 0 24px; }
.session .btn { padding: 8px 14px; font-size: .85rem; }
.session a.btn { text-decoration: none; }
.page.narrow .session { margin-top: 0; }

/* ---------- Übersicht ---------- */
.track { position: relative; margin: 80px 0 0; height: 90px; }
.rail {
  position: absolute; left: 0; right: 0; bottom: 22px; height: 3px;
  background: var(--line); border-radius: 3px;
}
.rail::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: var(--progress); border-radius: 3px;
  background: linear-gradient(90deg, var(--violet), var(--c1));
  animation: fill 1.2s cubic-bezier(.2,.7,.2,1) .2s both;
}
@keyframes fill { from { width: 0; } }

.here {
  position: absolute; left: var(--progress); bottom: 30px; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  animation: pop .4s ease-out 1.3s both;
}
.here span {
  background: #fff; color: #0c0b14; font: 600 .78rem/1 var(--body);
  padding: 7px 12px; border-radius: 999px; white-space: nowrap;
}
.here::after { content: ""; width: 1px; height: 18px; background: linear-gradient(#fff, transparent); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 6px); } }

.node {
  position: absolute; bottom: 14px; width: 19px; height: 19px; transform: translateX(-50%);
  border-radius: 50%; background: var(--bg); border: 2px solid var(--c);
  box-shadow: 0 0 0 5px var(--bg);
}
.goal {
  position: absolute; right: 0; bottom: 34px; text-align: right;
  font-size: .85rem; color: var(--muted); line-height: 1.3;
}
.goal strong { display: block; color: var(--c4); font-weight: 600; }
.goal-pin {
  position: absolute; right: -1px; bottom: 15px; width: 17px; height: 17px; border-radius: 4px;
  background: var(--c4); box-shadow: 0 0 0 5px var(--bg);
}

.phases {
  list-style: none; margin: 20px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; align-items: stretch;
}
.phase {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 26px 22px 20px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--c) 35%, transparent);
  transition: border-color .2s, background-color .2s;
}
.phase:hover { border-color: color-mix(in srgb, var(--c) 45%, transparent); }
.phase.current {
  background: var(--surface-solid);
  border-color: color-mix(in srgb, var(--c) 55%, transparent);
  box-shadow: 0 30px 60px -28px rgb(0 0 0 / .8);
}
.phase:focus-within { outline: 2px solid #fff; outline-offset: 3px; }

.phase-head { display: flex; align-items: center; gap: 14px; }
.phase-head h2 { color: var(--c); }
.phase-name { margin: 2px 0 0; color: var(--text); font-weight: 500; }
/* ganze Karte klickbar */
.card-link { text-decoration: none; }
.card-link::after { content: ""; position: absolute; inset: 0; border-radius: 18px; }
.card-link:focus-visible { outline: none; }

.topics {
  list-style: none; margin: 16px 0 0; padding: 16px 0 0; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 7px; align-content: flex-start; flex: 1;
}
.topics li {
  padding: 4px 10px; border-radius: 8px; font-size: .86rem; line-height: 1.4; color: var(--soft);
  background: color-mix(in srgb, var(--c) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 18%, transparent);
}
.topics li.optional { color: var(--muted); background: none; border-style: dashed; }
.topics li.active { border-color: color-mix(in srgb, var(--c) 55%, transparent); }
/* über 50 %: orange, abgeschlossen: grün */
.topics li.high { border: 1px solid var(--orange); background: rgb(251 146 60 / .12); color: #fff; }
.topics li.done { border: 1px solid var(--ok); background: rgb(74 222 128 / .12); color: #fff; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.error { padding: 14px 18px; border-radius: 12px; border: 1px solid var(--orange); color: var(--soft); background: rgb(251 146 60 / .1); }

/* segmentierte Fortschrittsleiste */
.segs { display: flex; gap: 3px; height: 6px; }
.segs i { flex: 1; border-radius: 3px; background: var(--line); }
.segs i.on { background: var(--c); }
.topic-row.high .segs i.on, .topic-row.high .bar i { background: var(--orange); }
.topic-row.done .segs i.on, .topic-row.done .bar i { background: var(--ok); }

.progress { margin-top: 18px; }
.progress-row { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.progress-row b { color: var(--soft); font-weight: 600; font-variant-numeric: tabular-nums; }

.milestone {
  margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--border);
  font-size: .9rem; color: var(--soft); line-height: 1.45;
  display: flex; gap: 10px; align-items: baseline; text-wrap: pretty;
}
.milestone::before {
  content: ""; flex: none; width: 9px; height: 9px; border-radius: 2px; transform: rotate(45deg) translateY(-1px);
  background: var(--c);
}
.more {
  margin-top: 16px; font-size: .86rem; font-weight: 600; color: color-mix(in srgb, var(--c) 70%, white);
  display: inline-flex; align-items: center; gap: 6px;
}
.more::after {
  content: ""; width: 7px; height: 7px; border-top: 2px solid currentColor; border-right: 2px solid currentColor;
  transform: rotate(45deg); transition: transform .2s;
}
.phase:hover .more::after { transform: translateX(3px) rotate(45deg); }

.ongoing {
  --c: var(--c5);
  margin-top: 20px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 18px 24px; border-radius: 18px;
  border: 1px dashed rgb(255 255 255 / .14); background: var(--surface);
}
.ongoing .icon { font: 600 1.15rem/1 var(--body); }
.ongoing h2 { font-size: 1.1rem; }
.ongoing .text { flex: 1; min-width: 200px; }
.ongoing .when { margin: 2px 0 0; }
.ongoing .topics { border: 0; padding: 0; margin: 0; flex: initial; }

.effort { margin-top: 56px; padding: 26px 24px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); }
.effort-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px 20px; }
.effort h2 { font-size: 1.15rem; }
.effort .total { color: var(--muted); font-size: .9rem; margin: 0; }
.stack { display: flex; height: 12px; border-radius: 6px; overflow: hidden; margin: 18px 0 16px; gap: 3px; }
.stack i { background: var(--c); }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: .9rem; color: var(--soft); }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend li::before { content: ""; width: 10px; height: 10px; border-radius: 3px; background: var(--c); }
.legend b { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }

footer {
  margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: .88rem;
}
footer p { margin: 0; }

/* ---------- Phasenseite ---------- */
.steps { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.back {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  color: var(--soft); font-size: .92rem; font-weight: 500;
}
.back::before {
  content: ""; width: 7px; height: 7px; border-bottom: 2px solid currentColor; border-left: 2px solid currentColor;
  transform: rotate(45deg);
}
.back:hover { color: #fff; }
.steps ol { list-style: none; margin: 0; padding: 4px; display: flex; gap: 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.steps ol a {
  display: block; padding: 6px 12px; border-radius: 8px; font-size: .86rem; text-decoration: none; color: var(--muted);
}
.steps ol a:hover { color: var(--text); }
.steps ol a[aria-current] { background: color-mix(in srgb, var(--c) 16%, transparent); color: #fff; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 45%, transparent); }

.phase-hero { margin-top: 56px; }
.phase-title { display: flex; align-items: center; gap: 18px; }
.phase-title .icon { width: 56px; height: 56px; border-radius: 16px; }
.phase-title .icon svg { width: 28px; height: 28px; }
.kicker { margin: 0 0 4px; color: color-mix(in srgb, var(--c) 70%, white); font-weight: 600; font-size: .95rem; }

.summary {
  margin-top: 40px; display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 20px;
}
.summary > * { padding: 22px 24px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); }
.big .num { font: 600 3rem/1 var(--display); letter-spacing: -0.03em; color: #fff; }
.big .num small { font-size: 1.4rem; color: var(--muted); }
.big .label { display: block; margin: 6px 0 16px; color: var(--muted); font-size: .9rem; }
.counts { margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-content: center; }
.counts div { text-align: center; }
.counts dt { color: var(--muted); font-size: .82rem; }
.counts dd { margin: 4px 0 0; font: 600 1.8rem/1 var(--display); font-variant-numeric: tabular-nums; }
.goal-box span { color: var(--muted); font-size: .82rem; }
.goal-box p { margin: 6px 0 0; font-weight: 500; color: var(--soft); line-height: 1.4; }

.list { margin-top: 48px; }
.list h2 { font-size: 1.15rem; margin-bottom: 14px; }
.list .opt-head { margin-top: 36px; color: var(--muted); }
.topic-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); overflow: hidden; }
.topic-list.optional { border-style: dashed; }
.topic-row {
  display: grid; grid-template-columns: minmax(0, 1.4fr) 100px minmax(80px, 1fr) 76px; align-items: center; gap: 16px;
  padding: 13px 20px; border-top: 1px solid var(--border);
}
.topic-row:first-child { border-top: 0; }
.topic-name { color: var(--text); font-weight: 500; }
.topic-name small { display: block; color: var(--muted); font-weight: 400; font-size: .85rem; }
.topic-row.open .topic-name { color: var(--soft); }
.pill { justify-self: start; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; border: 1px solid var(--border); color: var(--muted); }
.pill.active { color: color-mix(in srgb, var(--c) 70%, white); border-color: color-mix(in srgb, var(--c) 45%, transparent); }
.pill.high { color: var(--orange); border-color: rgb(251 146 60 / .6); }
.pill.done { color: #0c0b14; background: var(--ok); border-color: transparent; }
.pct { text-align: right; color: var(--muted); font-size: .88rem; font-variant-numeric: tabular-nums; }

.pager { margin-top: 48px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.pager a {
  display: block; padding: 18px 22px; border-radius: 16px; border: 1px solid var(--border); background: var(--surface);
  text-decoration: none; font-weight: 600; color: var(--text);
}
.pager a:hover { border-color: rgb(255 255 255 / .2); }
.pager small { display: block; color: var(--muted); font-weight: 400; font-size: .82rem; margin-bottom: 2px; }
.pager .next { text-align: right; }

/* Tablet */
@media (max-width: 1000px) {
  .phases { grid-template-columns: repeat(2, 1fr); margin-top: 48px; }
  .track { display: none; }
  .summary { grid-template-columns: 1fr 1fr; }
  .summary .big { grid-column: 1 / -1; }
}

/* Handy */
@media (max-width: 640px) {
  .page { padding: 44px 16px 32px; }
  .page.narrow { padding-top: 24px; }
  .phases { grid-template-columns: 1fr; gap: 16px; position: relative; padding-left: 26px; }
  .phases::before { content: ""; position: absolute; left: 6px; top: 10px; bottom: 10px; width: 2px; background: linear-gradient(var(--c1), var(--c4)); opacity: .5; }
  .phase::before {
    content: ""; position: absolute; left: -26px; top: 30px; width: 14px; height: 14px; border-radius: 50%;
    background: var(--bg); border: 2px solid var(--c);
  }
  .phase.current::before { background: var(--c); }
  .ongoing, .effort { padding: 20px 18px; }
  .summary { grid-template-columns: 1fr; }
  .topic-row { grid-template-columns: 1fr auto; gap: 8px 12px; padding: 12px 16px; }
  .topic-row .bar { grid-column: 1 / 2; }
  .phase-hero { margin-top: 36px; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { text-align: left; }
  body::before { width: 420px; height: 360px; }
  body::after { width: 380px; height: 320px; }
}

@media (prefers-reduced-motion: reduce) {
  .rail::after, .here { animation: none; }
  .phase, .more::after { transition: none; }
}
