/* Startseite (index.html): Depot-Kopf, Fortschritt, „Als Nächstes“, Kern-Aufteilung. Nur Tokens. */
/* Rücksetzung nicht in Dialogen: sie läge sonst über den Abständen der UI-Basis (@layer) */
*:not(dialog, dialog *) { margin: 0; padding: 0; }
* { box-sizing: border-box; }
body { font-family: var(--font-body); background: var(--page-bg); min-height: 100vh; padding: 20px; transition: background 0.3s; }
.container { width: 100%; max-width: 1100px; margin: 0 auto; }
@media (max-width: 640px) { body { padding: 12px; } }

.btn { background: var(--btn-primary-bg); color: var(--btn-primary-fg); border: none; border-radius: 8px; padding: 10px 18px;
       cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; display: inline-block;
       box-shadow: inset 0 0 0 1px var(--btn-primary-border); line-height: 1.4; }
.btn:hover { filter: brightness(1.08); }
.btn:focus-visible, .progress-seg:focus-visible, .progress-link:focus-visible { outline: 3px solid var(--on-page-strong, var(--accent)); outline-offset: 2px; }

/* Kopfzeile Depot */
.depot-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.depot-head .head-title { font-size: 13px; color: var(--text-secondary); font-weight: 600; }
.depot-head .head-value { font-size: 28px; font-weight: 700; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.depot-head .head-pnl { display: inline-flex; align-items: baseline; gap: 8px; padding: 6px 12px; border-radius: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.depot-head .head-pnl.positive { background: var(--positive-bg); color: var(--positive-text); }
.depot-head .head-pnl.negative { background: var(--negative-bg); color: var(--negative-text); }
.depot-head .head-links { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.depot-head .head-links a { font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; padding: 6px 10px; border-radius: 8px;
                            background: var(--accent-soft); }
.depot-head .head-links a:hover { text-decoration: underline; }

/* Fortschritt „Dein Depot im Griff“ */
.progress-headline { font-size: 14px; color: var(--text-secondary); margin: 2px 0 10px; line-height: 1.5; }
.progress-bar { display: flex; gap: 3px; height: 34px; }
.progress-seg { flex: 1 1 0; min-width: 34px; border: 0; border-radius: 8px; font: inherit; font-size: 13px; font-weight: 700;
                background: var(--surface-2, var(--card-bg)); color: var(--text-primary); cursor: pointer; font-variant-numeric: tabular-nums;
                box-shadow: inset 0 -7px 0 var(--seg), inset 0 0 0 1px var(--border-color); padding-bottom: 7px; }
span.progress-seg { display: flex; align-items: center; justify-content: center; cursor: default; }
.seg-3 { --seg: var(--positive); }
.seg-2 { --seg: var(--accent); }
.seg-1 { --seg: var(--warning-text); }
.seg-0 { --seg: var(--text-muted); }
button.progress-seg:hover { filter: brightness(1.12); }
.progress-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 10px; font-size: 13px; }
.progress-link { background: none; border: 0; padding: 2px 0; font: inherit; color: var(--accent); font-weight: 600; cursor: pointer; text-align: left; }
.progress-link:hover { text-decoration: underline; }
.progress-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: baseline; background: var(--seg); }
.progress-legend span.static { color: var(--text-secondary); }

/* Als Nächstes */
.next-title { color: var(--on-page-strong); font-size: 18px; margin: 24px 0 4px; }
.next-sub { color: var(--on-page); font-size: 13px; margin-bottom: 12px; }
.next-list { display: grid; gap: 12px; list-style: none; }
.next-card { background: var(--card-bg); border-radius: var(--card-radius); box-shadow: var(--card-shadow); padding: 14px 18px;
             border-left: 6px solid var(--border-color); display: grid; gap: 6px; }
.next-card.k-TASK { border-left-color: var(--accent); }
.next-card.k-INSTRUCTION { border-left-color: var(--negative); }
.next-card.k-DECISION { border-left-color: var(--warning-text); border-left-style: dashed; }
.next-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 12px; }
.kind-tag { font-weight: 700; padding: 2px 9px; border-radius: 999px; border: 1px solid currentColor; background: var(--card-bg); }
.k-TASK .kind-tag { color: var(--accent); }
.k-INSTRUCTION .kind-tag { color: var(--negative-text); }
.k-DECISION .kind-tag { color: var(--warning-text); border-style: dashed; }
.next-role { color: var(--text-secondary); }
.next-role b { color: var(--text-primary); }
.next-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; }
.next-name { font-size: 16px; color: var(--text-primary); }
.next-value { font-size: 14px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.next-sentence { font-size: 14px; color: var(--text-primary); line-height: 1.5; }
.next-why { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.next-why b { color: var(--text-primary); }
.next-action { margin-top: 4px; }
.next-more { margin-top: 12px; font-size: 14px; }
.next-more a { color: var(--on-page-strong); font-weight: 600; }
.due-line { margin-top: 10px; font-size: 13px; color: var(--on-page); }
.due-line a { color: var(--on-page-strong); font-weight: 600; white-space: nowrap; }
.next-done { text-align: center; padding: 22px 16px; }
.next-done h3 { font-size: 17px; color: var(--text-primary); margin-bottom: 4px; }
.next-done p { font-size: 13.5px; color: var(--text-secondary); }

/* Kern-Aufteilung (eingeklappt, solange nichts umzuschichten ist) */
.core-details { margin-top: 24px; }
.core-details > summary { cursor: pointer; color: var(--on-page-strong); font-size: 16px; font-weight: 700; padding: 6px 0; }
.core-details > summary .hint { font-size: 12.5px; font-weight: 400; color: var(--on-page); margin-left: 8px; }
.core-details[open] > summary { margin-bottom: 4px; }
.core-band-card h2 a, .split-card h2 a { font-size: 12.5px; font-weight: 400; margin-left: auto; }
.split-card h2 { margin: 0 0 4px; }
.split-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--text-secondary); margin: 6px 0 10px; }
.split-legend b { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.split-bar { position: relative; height: 18px; border-radius: 999px; overflow: hidden; background: var(--text-muted); }
.split-bar .core { position: absolute; inset: 0 auto 0 0; background: var(--accent); }
.split-bar .band { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(45deg, color-mix(in srgb, var(--card-bg) 40%, transparent) 0 4px, transparent 4px 8px); }
.split-bar .target { position: absolute; top: -2px; bottom: -2px; width: 3px; margin-left: -1px; background: var(--text-primary); }
.split-note { font-size: 12.5px; margin-top: 8px; }
.split-note.warn { color: var(--negative-text); font-weight: 600; }
.core-mail { margin: 10px 0; }
.core-mail span { margin-left: 8px; font-size: 13px; }

/* Dein Plan (Kurzzeile) */
.plan-line { margin-top: 12px; }
.plan-line-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.plan-line-head h2 { font-size: 16px; }
.plan-line-head a { font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; }
.plan-line-head a:hover { text-decoration: underline; }
.plan-hint { color: var(--text-secondary); font-size: 14px; margin-top: 4px; }
.plan-hint:empty { display: none; }
.plan-figures { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 10px; }
.plan-fig { display: grid; gap: 2px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2, var(--card-bg)); border-left: 4px solid var(--border-color); }
.plan-fig[data-state="OK"] { border-left-color: var(--positive); }
.plan-fig[data-state="UNDER"], .plan-fig[data-state="OVER"] { border-left-color: var(--warning-text); }
.plan-fig-label { font-size: 12px; color: var(--text-secondary); font-weight: 600; }
.plan-fig b { font-size: 18px; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.plan-fig-note { font-size: 12px; color: var(--text-secondary); }

/* KI-Einschätzung (Kurzzeile, G10a) */
.ai-line { margin-top: 12px; border-left: 4px solid var(--border-color); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.ai-line[data-tone="attention"] { border-left-color: var(--warning-text); }
.ai-line[data-tone="calm"] { border-left-color: var(--positive); }
.ai-text { flex: 1 1 260px; font-size: 14px; color: var(--text-primary); line-height: 1.45; }
.ai-text b { font-weight: 700; }
.ai-note { flex-basis: 100%; font-size: 12.5px; color: var(--text-secondary); }
.ai-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.ai-settings { font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: none; }
.ai-settings:hover { text-decoration: underline; }
