/* Heute (dashboard), Lernplan (study line) and Üben (practice hub). */

/* ---------- hero */
.today-hero { display: grid; grid-template-columns: minmax(0, 7fr) minmax(300px, 5fr); gap: var(--s-6); align-items: end; margin: 0 0 var(--s-5); }
.today-intro h1 { font-size: var(--fs-display); letter-spacing: -0.03em; line-height: 1.05; margin: 0 0 14px; text-wrap: balance; }
.today-intro .eyebrow .sep { width: 4px; height: 4px; border-radius: 50%; background: var(--line-strong); }
.today-intro .eyebrow .mono { letter-spacing: 0; text-transform: none; color: var(--ink-2); }
.today-intro .lead { margin: 0; font-size: 1rem; line-height: 1.55; }
.today-intro .lead strong { color: var(--ink); }
.today-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }

.today-panel { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; gap: 4px 18px; align-items: center; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-2); }
.today-panel-title { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
.today-panel .ring-wrap { grid-row: 1 / 3; }
.today-panel-body { align-self: end; }
.today-panel-body .sub { margin: 2px 0 8px; }
.next-slot { grid-column: 2; align-self: start; }
.ring-wrap { position: relative; width: 92px; height: 92px; }
.ring { width: 92px; height: 92px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 7; }
.ring-track { stroke: var(--surface-sunken); }
.ring-fill { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 700ms var(--ease-out); }
.ring-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1; }
.ring-num { font-size: 1.7rem; font-weight: 600; letter-spacing: -0.04em; }
.ring-of { font-size: 0.72rem; color: var(--ink-3); margin-top: 3px; }
.next-btn { justify-content: space-between; text-align: left; height: auto; min-height: 56px; padding: 8px 16px; }
.next-btn > span { display: flex; flex-direction: column; line-height: 1.25; }
.next-btn small { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; opacity: 0.7; }
.next-btn .icon { width: 20px; height: 20px; transition: transform var(--t-mid) var(--ease-out); }
.next-btn:hover .icon { transform: translateX(3px); }
@media (max-width: 899px) {
  .today-hero { grid-template-columns: 1fr; gap: var(--s-4); }
}
@media (max-width: 599px) {
  .today-panel { gap: 14px 16px; padding: 16px; border-radius: var(--r-lg); }
  .today-panel .ring-wrap { grid-row: auto; width: 72px; height: 72px; }
  .today-panel .ring { width: 72px; height: 72px; }
  .ring-num { font-size: 1.4rem; }
  .today-panel-body { align-self: center; }
  .next-slot { grid-column: 1 / -1; }
}

/* ---------- study line map */
.linemap-link { display: block; margin: 0 0 var(--s-5); padding: 16px 20px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); color: inherit; text-decoration: none; box-shadow: var(--shadow-1); transition: border-color var(--t-fast), box-shadow var(--t-mid) var(--ease-out); }
.linemap-link:hover { border-color: var(--line-strong); box-shadow: var(--shadow-2); }
.linemap-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.linemap-head .eyebrow { margin: 0; }
.linemap-cta { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-small); font-weight: 560; color: var(--ink-2); }
.linemap-cta .icon { width: 15px; height: 15px; transition: transform var(--t-mid) var(--ease-out); }
.linemap-link:hover .linemap-cta .icon { transform: translateX(3px); }

.linemap { --lm-h: 8px; }
.linemap.full { --lm-h: 10px; padding: 8px 0 0; }
.lm-wrap { position: relative; padding: 30px 0 6px; }
.lm-track { display: flex; gap: 4px; height: var(--lm-h); }
.lm-seg { position: relative; flex-basis: 0; min-width: 6px; border-radius: 999px; background: var(--line-strong); overflow: hidden; }
.lm-fill { position: absolute; inset: 0; background: var(--ink); transform-origin: left center; transform: scaleX(var(--p, 0)); transition: transform 900ms var(--ease-out); }
.lm-overlay { position: absolute; left: 0; right: 0; top: 30px; height: var(--lm-h); pointer-events: none; }
.lm-gate { position: absolute; top: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--surface); border: 2px solid var(--ink); color: var(--ink); }
.lm-gate .icon { width: 12px; height: 12px; stroke-width: 2.4; }
.lm-gate.passed { background: var(--ink); color: var(--surface); }
.lm-here { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 0; height: 0; }
.lm-dot { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px var(--ink); }
.lm-pulse { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); animation: pulse-ring 2.4s var(--ease-out) infinite; }
.lm-label { position: absolute; bottom: 14px; left: 0; transform: translateX(-50%); white-space: nowrap; padding: 2px 8px; border-radius: 6px; background: var(--ink); color: var(--surface); font-family: var(--mono); font-size: 0.7rem; font-weight: 600; }
.lm-here.edge-start .lm-label { transform: translateX(-14px); }
.lm-here.edge-start .lm-label::after { left: 14px; }
.lm-here.edge-end .lm-label { transform: translateX(calc(-100% + 14px)); }
.lm-here.edge-end .lm-label::after { left: calc(100% - 14px); }
.lm-label::after { content: ""; position: absolute; left: 50%; bottom: -4px; width: 8px; height: 8px; background: var(--ink); transform: translateX(-50%) rotate(45deg); border-radius: 1px; }
.lm-legend { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 18px; margin: 22px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); font-size: var(--fs-small); }
.lm-legend li { display: flex; gap: 10px; align-items: baseline; color: var(--ink-2); }
.lm-legend li strong { color: var(--ink); font-weight: 560; }
.lm-legend .muted { white-space: nowrap; }
.lm-legend li.current strong::after { content: " ●"; color: var(--accent-strong); }
.lm-key, .phase-key { display: inline-grid; place-items: center; min-width: 26px; height: 22px; padding: 0 5px; border-radius: 5px; background: var(--ink); color: var(--surface); font-size: 0.7rem; font-weight: 650; }
.linemap-card { padding-top: 14px; }

/* ---------- today's route */
.route-card { padding: 22px 24px 10px; }
.route-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 8px; }
.route-head h2 { margin: 0 0 2px; }
.route-head .sub { margin: 0; }
.route { position: relative; list-style: none; margin: 8px 0 0; padding: 0; }
.route::before { content: ""; position: absolute; left: 12px; top: 26px; bottom: 26px; width: 3px; border-radius: 3px; background: var(--line); }
.task.station { position: relative; display: grid; grid-template-columns: 27px minmax(0, 1fr); gap: 16px; padding: 16px 12px 16px 0; margin: 0 -12px 0 0; border-radius: 14px; transition: background-color var(--t-mid) var(--ease-out); }
.task.station + .task.station { border-top: 1px solid transparent; }
.station-dot { position: relative; z-index: 1; display: grid; place-items: start center; padding-top: 1px; }
.station-dot input[type="checkbox"] { appearance: none; -webkit-appearance: none; width: 27px; height: 27px; margin: 0; border-radius: 50%; background: var(--surface); border: 3px solid var(--lc); cursor: pointer;
  transition: background-color var(--t-mid) var(--ease-out), transform var(--t-fast) var(--ease-press), box-shadow var(--t-fast); }
.station-dot input[type="checkbox"]:hover { box-shadow: 0 0 0 4px color-mix(in srgb, var(--lc) 18%, transparent); }
.station-dot input[type="checkbox"]:active { transform: scale(0.92); }
.station-dot input[type="checkbox"]:checked { background: var(--lc) center / 15px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.station-dot input[type="checkbox"]:focus-visible { box-shadow: var(--focus-ring); border-radius: 50%; }
.task-body { min-width: 0; }
.task-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.task-min { font-size: var(--fs-caption); color: var(--ink-3); }
.task-text { display: block; color: var(--ink); line-height: 1.55; cursor: pointer; max-width: 72ch; }
.task-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.task.next { background: var(--accent-soft); }
.task.next .station-dot input[type="checkbox"] { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 45%, transparent); }
.task.done .task-text { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-strong); }
.task.done .line-badge { opacity: 0.55; }
.task.done .task-links { display: none; }
@media (max-width: 767px) {
  .route-card { padding: 18px 14px 6px; }
  .task.station { gap: 12px; }
}

/* ---------- gate checkpoint */
.card.gate { border: 1.5px solid var(--l-pruefung); }
.card.gate.passed { border-color: var(--good); }
.gate-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.gate-head h2 { margin: 0; flex: 1; min-width: 200px; }
.gate-criteria { color: var(--ink-2); max-width: 72ch; }
.gate-check { margin: 12px 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-sunken); }
.gate-check .gate-check { background: var(--surface); border: 1px solid var(--line); }
.gate-check-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }
.gate-check-head .sub { margin: 0; }
.gate-check-icon { display: grid; place-items: center; color: var(--ink-3); }
.gate-check.ok > .gate-check-head .gate-check-icon { color: var(--good); }
.gate-check > .sub { margin: 0 0 10px; }
.gate-actions { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.gate-actions .sub { flex-basis: 100%; margin: 0; }
.complete-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: var(--s-5) 0 0; }

/* ---------- Lernplan */
.phase-block { margin: 0 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.phase-block.current { border-color: var(--line-strong); }
.phase-block > summary { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(120px, 200px) 18px; align-items: center; gap: 14px; padding: 16px 20px; cursor: pointer; list-style: none; transition: background-color var(--t-fast); }
.phase-block > summary::-webkit-details-marker { display: none; }
.phase-block > summary:hover { background: var(--surface-sunken); }
.phase-block > summary::after { content: ""; width: 16px; height: 16px; background: var(--ink-3); transition: transform var(--t-mid) var(--ease-out);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat; }
.phase-block[open] > summary::after { transform: rotate(180deg); }
.phase-block.current .phase-key { background: var(--accent); color: var(--accent-ink); }
.phase-name { display: flex; flex-direction: column; line-height: 1.3; }
.phase-name .muted { font-size: var(--fs-caption); }
.phase-progress { display: flex; align-items: center; gap: 10px; font-size: var(--fs-caption); color: var(--ink-2); }
.phase-progress .progress { flex: 1; margin: 0; }
.phase-body { padding: 4px 20px 16px; border-top: 1px solid var(--line); }
.phase-body > .sub { margin: 12px 0; max-width: 72ch; }
.day-list { list-style: none; margin: 0; padding: 0; }
.day-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 64px 118px 52px; align-items: center; gap: 10px; min-height: 48px; padding: 6px 8px; border-radius: 10px; }
.day-row:hover { background: var(--surface-sunken); }
.day-row + .day-row { box-shadow: 0 -1px 0 var(--line); }
.day-no { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line-strong); font-size: 0.78rem; font-weight: 600; color: var(--ink-2); background: var(--surface); }
.day-row.done .day-no { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.day-row.current { background: var(--accent-soft); }
.day-row.current .day-no { background: var(--accent); border-color: var(--ink); color: var(--accent-ink); }
.day-title { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.day-min { font-size: var(--fs-caption); color: var(--ink-3); text-align: right; }
.day-go { text-align: right; }
.gate-row { display: flex; align-items: center; gap: 12px; margin: 6px 0; padding: 12px 14px; border-radius: 12px; border: 1.5px dashed var(--l-pruefung); background: var(--surface); font-size: var(--fs-small); }
.gate-mark { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 8px; background: var(--l-pruefung); color: #fff; }
.gate-mark .icon { width: 15px; height: 15px; }
.gate-text { flex: 1; color: var(--ink-2); }
.gate-text strong { color: var(--ink); }
@media (max-width: 767px) {
  .phase-block > summary { grid-template-columns: auto minmax(0, 1fr) 18px; padding: 14px; }
  .phase-progress { grid-column: 2 / 3; }
  .phase-body { padding: 4px 10px 12px; }
  .day-row { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .day-min { display: none; }
  .day-status { grid-column: 2; }
  .day-go { grid-row: 1; grid-column: 3; }
}

/* ---------- Üben hub */
.hub { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s-4); margin-bottom: var(--s-4); }
.hub-tile { position: relative; display: flex; flex-direction: column; grid-column: span 6; padding: 22px 24px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); color: inherit; text-decoration: none; box-shadow: var(--shadow-1); overflow: hidden;
  transition: transform var(--t-mid) var(--ease-out), box-shadow var(--t-mid) var(--ease-out), border-color var(--t-fast); }
.hub-tile::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--lc); }
.hub-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--line-strong); }
.hub-tile:active { transform: translateY(0); }
.hub-tile.span-7 { grid-column: span 7; }
.hub-tile.span-5 { grid-column: span 5; }
.hub-tile.tall { min-height: 230px; }
.hub-tile-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.hub-arrow { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-sunken); color: var(--ink-2); transition: background-color var(--t-mid), color var(--t-mid), transform var(--t-mid) var(--ease-out); }
.hub-arrow .icon { width: 17px; height: 17px; }
.hub-tile:hover .hub-arrow { background: var(--ink); color: var(--surface); transform: translateX(2px); }
.hub-tile h2 { display: flex; flex-direction: column; font-size: 1.35rem; letter-spacing: -0.02em; margin: 0 0 8px; }
.hub-en { font-size: var(--fs-caption); font-weight: 500; letter-spacing: 0; color: var(--ink-3); margin-top: 2px; }
.hub-desc { color: var(--ink-2); font-size: 0.93rem; max-width: 52ch; margin: 0 0 16px; }
.hub-facts { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 22px; margin: auto 0 0; padding: 14px 0 0; border-top: 1px solid var(--line); }
.hub-facts li { display: flex; align-items: baseline; gap: 6px; font-size: var(--fs-small); color: var(--ink-3); }
.hub-facts .mono { font-size: 1.15rem; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; }
.hub-strip { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); color: var(--ink-2); text-decoration: none; font-size: 0.93rem; transition: border-color var(--t-fast), background-color var(--t-fast); }
.hub-strip:hover { border-color: var(--line-strong); background: var(--surface-sunken); }
.hub-strip > span:nth-child(2) { flex: 1; }
.hub-strip strong { color: var(--ink); }
@media (max-width: 899px) { .hub-tile, .hub-tile.span-7, .hub-tile.span-5 { grid-column: span 12; } .hub-tile.tall { min-height: 0; } }
