:root {
  /* Farben angelehnt an christian-kaiser.de: Weiß/kühles Grau, Navy für Text und Akzent, Gold nur als Signal */
  --bg: #f3f5f8; --surface: #ffffff; --ink: #0b1730; --ink-2: #3f4859; --muted: #5d6b82; --line: #e1e6ee; --line-2: #c5cedb;
  --accent: #003566; --accent-2: #00427f; --accent-soft: #e6eef8; --gold: #ffc300; --navy-deep: #000814;
  --good: #0ca30c; --warn: #fab219; --serious: #ec835a; --critical: #b3261e;
  --radius: 6px; --shadow: 0 1px 2px rgba(11,23,48,.05), 0 4px 14px rgba(11,23,48,.05);
  --serif: "Iowan Old Style", "Charter", "Bitstream Charter", "Sitka Text", Cambria, Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.45; font-size: 16px; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
h1, h2 { font-family: var(--serif); font-weight: 600; letter-spacing: -.005em; }
h1 { font-size: 1.7rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 650; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.container { max-width: 900px; margin: 0 auto; padding: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.soft { background: var(--accent-soft); border-color: transparent; box-shadow: none; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }
button, .btn { font: inherit; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); padding: 10px 16px; border-radius: 8px; cursor: pointer; }
button:hover, .btn:hover { border-color: var(--accent); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
button.primary:hover { background: var(--accent-2); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.ghost { border-color: transparent; background: transparent; color: var(--accent); }
input[type=text], input[type=email], input[type=password], textarea, select { font: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: #fff; color: var(--ink); }
textarea { min-height: 70px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; border-color: var(--accent); }
label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: .875rem; color: var(--ink-2); margin-bottom: 4px; font-weight: 600; }
.error { color: var(--critical); background: #fdecec; border: 1px solid #f5c2c2; padding: 10px 12px; border-radius: 8px; margin: 8px 0; }
.notice { background: #fff7e0; border: 1px solid #f5dd9a; padding: 10px 12px; border-radius: 8px; margin: 8px 0; }
.tag { display: inline-block; font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tag.gray { background: #eeeeea; color: var(--ink-2); }
/* Options */
.options { display: grid; gap: 8px; }
.opt { border: 1px solid var(--line-2); border-radius: 8px; padding: 12px 14px; cursor: pointer; background: #fff; display: flex; gap: 10px; align-items: flex-start; }
.opt:hover { border-color: var(--accent); }
.opt.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.opt .sub { color: var(--muted); font-size: .875rem; }
.opt input { margin-top: 4px; }
.opt.disabled { opacity: .5; cursor: not-allowed; }
/* Topbar */
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(255,255,255,.95); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.topbar .inner { max-width: 900px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; }
.topbar .title { font-weight: 700; }
.topbar .spacer { flex: 1; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.1rem; }
.timer.over { color: var(--critical); }
.budget { font-weight: 600; }
.pacing { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.pacing > div { height: 100%; background: var(--accent-2); transition: width 1s linear; }
.pacing.behind > div { background: var(--serious); }
.blocks { display: flex; gap: 6px; margin: 12px 0 20px; flex-wrap: wrap; }
.blocks .b { flex: 1; min-width: 120px; padding: 8px 10px; border-radius: 8px; background: #fff; border: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.blocks .b.active { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.blocks .b.done { color: var(--good); }
.blocks .b .n { font-weight: 700; margin-right: 4px; }
/* Guidance */
.guide { border-left: 3px solid var(--accent); padding: 8px 14px; background: #fff; border-radius: 0 8px 8px 0; color: var(--ink-2); font-size: .95rem; margin-bottom: 16px; }
.guide b { color: var(--accent); }
/* Hypothesis card */
.hyp { border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin-bottom: 12px; background: #fff; }
.hyp .head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.hyp .head h3 { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-2); padding: 6px 10px; border-radius: 999px; cursor: pointer; font-size: .875rem; background: #fff; }
.chip.selected { background: var(--accent); color: #fff; border-color: var(--accent); }
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row input[type=range] { flex: 1; }
.range-row .val { min-width: 48px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
/* Data room */
.dr-item { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: #fff; display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.dr-item .t { flex: 1; }
.dr-item .cost { font-weight: 700; white-space: nowrap; }
.dr-item.bought { border-color: var(--good); }
.dr-item.locked { opacity: .55; }
.cardview { border: 1px solid var(--accent); border-radius: 8px; padding: 16px; background: #fff; margin: 10px 0 16px; }
.cardview h3 { color: var(--accent); }
table.data { border-collapse: collapse; width: 100%; margin: 10px 0; font-size: .9rem; }
table.data th, table.data td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.data th { color: var(--ink-2); font-weight: 600; background: #fafaf8; }
.readings { display: grid; gap: 6px; margin-top: 10px; }
.readings .r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .9rem; }
.readings .r .hlabel { flex: 1; min-width: 200px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; padding: 6px 10px; font-size: .85rem; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.on { background: var(--accent); color: #fff; }
/* Footer nav */
.nav { display: flex; gap: 12px; justify-content: space-between; align-items: center; margin-top: 20px; }
.footer { color: var(--muted); font-size: .8rem; text-align: center; padding: 20px; }
/* Modal */
/* d2.4 (S10): Dialog scrollt, wenn er höher als der Bildschirm ist (Handy im Hochformat, eingeblendete Tastatur); top/left/… als Fallback für Safari < 14.1 (T24) */
.modal-bg { position: fixed; top: 0; left: 0; right: 0; bottom: 0; inset: 0; background: rgba(11,11,11,.5); display: flex; justify-content: center; z-index: 50; padding: 16px; overflow: auto; -webkit-overflow-scrolling: touch; }
.modal { background: #fff; border-radius: 12px; padding: 24px; max-width: 560px; width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.3); margin: auto; }
.modal:focus, [tabindex="-1"]:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
/* Profile */
.prof-line { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.prof-line .k { min-width: 190px; color: var(--ink-2); font-weight: 600; font-size: .9rem; }
.path { border-left: 2px solid var(--line-2); margin-left: 8px; padding-left: 16px; }
.path .step { position: relative; margin-bottom: 14px; }
.path .step::before { content: ""; position: absolute; left: -22px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.path .step .k { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.hero { font-size: 2.2rem; font-weight: 700; }
@media print { .topbar, .nav, button { display: none !important; } body { background: #fff; } .card { box-shadow: none; } }

/* Checkliste & Prozess-Strip */
.checklist { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 14px; }
.ck { font-size: .8rem; padding: 3px 10px; border-radius: 999px; background: #eeeeea; color: var(--ink-2); }
.ck.done { background: #e2f3e2; color: #006300; }
.strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 720px) { .strip { grid-template-columns: 1fr 1fr; } }
.strip .st { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.strip .st .n { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.rules { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 720px) { .rules { grid-template-columns: 1fr; } }
.rules .rule { border-left: 3px solid var(--accent); padding: 6px 12px; background: #fafaf8; border-radius: 0 8px 8px 0; }
.rules .rule b { display: block; margin-bottom: 4px; color: var(--accent); }

/* Version d */
.tag.denk { background: #fff1d6; color: #8a5a00; margin-left: 6px; vertical-align: 2px; }
.tag.warn { background: #fdecec; color: var(--critical); }
.counter { text-align: right; margin-top: 2px; }
.counter.bad { color: var(--critical); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pills label { cursor: pointer; }
.pills input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pills span { display: inline-block; border: 1px solid var(--line-2); padding: 6px 12px; border-radius: 999px; font-size: .875rem; background: #fff; }
.pills input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); }
.pills input:focus-visible + span { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.bgq { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.bb-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
@media (max-width: 860px) { .bb-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .bb-grid { grid-template-columns: 1fr; } }
.bb-col { display: flex; flex-direction: column; gap: 8px; }
.bb-cat { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; min-height: 2.2em; }
.bb { text-align: left; font-size: .875rem; line-height: 1.35; padding: 10px 12px; border-radius: 8px; background: #fff; border: 1px solid var(--line-2); position: relative; flex: 1; }
.bb .id { display: block; font-weight: 700; color: var(--muted); font-size: .75rem; margin-bottom: 2px; }
.bb.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.bb.dim { opacity: .55; }
.bb .role { display: block; margin-top: 6px; font-size: .75rem; font-weight: 700; color: var(--accent); }
.hyp.focal { border-left: 4px solid var(--accent); }
.hyp.rival { border-left: 4px solid var(--line-2); }
.hl { padding: 3px 0; font-size: .95rem; }
.dossier-mini { margin: -6px 0 14px; }
.dossier-mini summary { cursor: pointer; color: var(--accent); }
.dossier-mini > div { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-top: 6px; }
.group { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 6px; margin-bottom: 12px; }
.group.need { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.ghead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.ghead h3, .ghead h2 { margin: 0; flex: 1; font-family: inherit; font-size: 1rem; font-weight: 650; letter-spacing: 0; } /* d2.6 (S14): Gruppen als H2 unter der H1, Optik unverändert */
.msgs-read { background: var(--surface-2, #f6f4ef); }
.dr-item .kind { font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin-right: 4px; }
.dr-item.todo { border-color: var(--warn); box-shadow: inset 3px 0 0 var(--warn); }
.msg-read { border-top: 1px solid var(--line); padding: 8px 0; }
.msg-read summary { cursor: pointer; }
.msg-screen { background: #fff; border: 2px solid var(--accent); border-radius: 14px; padding: 22px; box-shadow: var(--shadow); max-width: 760px; margin: 0 auto; }
.msg-head { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; font-size: .8rem; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(28,92,171,.5); } 70% { box-shadow: 0 0 0 10px rgba(28,92,171,0); } 100% { box-shadow: 0 0 0 0 rgba(28,92,171,0); } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } }
.msg-steps { display: flex; gap: 6px; margin: 10px 0 14px; }
.msg-steps span { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line-2); display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; color: var(--muted); }
.msg-steps span.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.msg-steps span.done { background: #e2f3e2; color: #006300; border-color: #bfe3bf; }
.msg-body { background: #fafaf8; border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.msg-body p { margin: 0; }
details.msg-body summary { cursor: pointer; color: var(--accent); }
details.msg-body p { margin-top: 8px; }
.msg-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.msg-opts.scale { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 560px) { .msg-opts, .msg-opts.scale { grid-template-columns: 1fr; } }
.big-opt { padding: 14px 10px; font-weight: 600; }
.big-opt:hover { background: var(--accent-soft); }
.diag { display: grid; grid-template-columns: 120px 1fr; gap: 10px 14px; }
.diag .k { font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding-top: 3px; }
@media (max-width: 560px) { .diag { grid-template-columns: 1fr; } }
ul.facts { margin: 0; padding-left: 18px; font-size: .9rem; }
ul.facts li { margin-bottom: 4px; }
@media (max-width: 560px) {
  .hyp .head { flex-wrap: wrap; }
  .hyp .head h3 { flex-basis: 100%; }
  .topbar .inner { gap: 10px; flex-wrap: wrap; }
  .budget { order: 5; flex-basis: 100%; }
  .dr-item { flex-wrap: wrap; }
  .dr-item .t { flex-basis: 100%; }
}

/* Version d2 */
.time-banner { display: flex; align-items: center; gap: 12px; justify-content: center; padding: 8px 16px; background: #fff7e0; border-top: 1px solid #f5dd9a; font-weight: 600; font-size: .95rem; }
.time-banner.urgent { background: #fdecec; border-top-color: #f5c2c2; color: #8f1d1d; }
.time-banner button { border: 0; background: transparent; font-size: 1.2rem; padding: 0 6px; cursor: pointer; color: inherit; }
.jump { margin: 0 0 10px; color: var(--ink-2); }
.jump a { font-weight: 600; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font: inherit; }
details.group > summary { cursor: pointer; list-style: none; }
details.group > summary::-webkit-details-marker { display: none; }
details.group > summary h3::before, details.group > summary h2::before { content: "▸"; display: inline-block; width: 1em; color: var(--muted); transition: transform .15s; }
details.group[open] > summary h3::before, details.group[open] > summary h2::before { transform: rotate(90deg); }
details.group:not([open]) { padding-bottom: 12px; }
details.group:not([open]) > summary { margin-bottom: 0; }

.about-it { color: var(--ink-2, #3d3d3a); margin-top: 3px; line-height: 1.4; max-width: 62ch; }

/* ---------- Gestaltung wie die Startseite (gilt für alle Seiten) ---------- */
body { background: var(--bg); }
.container { max-width: 960px; padding: 28px 24px 56px; }
h1 { font-size: clamp(1.6rem, 3vw, 2.15rem); font-weight: 500; line-height: 1.15; }
h2 { font-size: 1.3rem; font-weight: 500; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.card { border-radius: 3px; box-shadow: none; padding: 22px 24px; }
.card.soft { background: var(--accent-soft); }
button, .btn { border-radius: 3px; }
button.primary:hover, .btn.primary:hover { background: var(--accent-2); }
input[type=text], input[type=email], input[type=password], input[type=number], textarea, select { border-radius: 3px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); }
.tag { border-radius: 3px; }
.tag.gray, .ck { background: #eef1f5; }
.chip, .pills span { border-radius: 3px; }
.opt, .hyp, .dr-item, .cardview, .seg, .strip .st, .error, .notice { border-radius: 3px; }
.guide, .rules .rule { border-radius: 0; }
.rules .rule { background: var(--surface); }
.dr-item.bought { border-color: #9fc79f; }
table.data th { background: var(--bg); }
.modal-bg { background: rgba(0, 8, 20, .55); }
.modal { border-radius: 4px; box-shadow: 0 24px 60px rgba(0, 8, 20, .35); }
.modal h2 { font-family: var(--serif); }
/* Kopfzeile im Sprint (mit Timer) */
.topbar { background: var(--surface); backdrop-filter: none; }
.topbar .inner { max-width: 960px; padding: 10px 24px; }
.topbar .title { font-family: var(--serif); font-weight: 500; font-size: 1.05rem; }
.topbar a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line-2); }
.topbar a:hover { color: var(--accent); border-color: var(--accent); }
.timer { font-family: var(--serif); font-weight: 500; font-size: 1.4rem; }
.pacing { height: 3px; border-radius: 0; background: var(--line); }
.pacing > div { background: var(--accent); }
/* Schritt-Navigation wie die Journey der Startseite */
.blocks { gap: 14px; }
.blocks .b { background: transparent; border: 0; border-top: 2px solid var(--line-2); border-radius: 0; padding: 8px 0 0; }
.blocks .b.active { border-top-color: var(--accent); color: var(--ink); }
.blocks .b.done { border-top-color: var(--ink-2); color: var(--ink-2); }
.path .step::before { background: var(--accent); }
@media (max-width: 640px) { .container { padding: 20px 16px 44px; } .topbar .inner { padding: 8px 16px; } }

/* ---------- Version d2.1: Mobil (Dossier, Profil, Cheat Sheet) ---------- */
@media (max-width: 640px) {
  /* breite Tabellen (Dossier, Datenkarten) scrollen innerhalb ihrer Karte statt die Seite zu verbreitern */
  table.data { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; contain: inline-size; }
  table.data td, table.data th { min-width: 6.5em; }
  .card, .grid-2 > *, .cardview { min-width: 0; }
  /* Profil: Beschriftung über dem Text statt daneben */
  .prof-line { flex-direction: column; gap: 4px; }
  .prof-line .k { min-width: 0; }
  .readings .r .hlabel { min-width: 0; flex-basis: 100%; }
  .tag { white-space: normal; }
}

/* ---------- Version d2.5: Mobil (S16) ---------- */
@media (max-width: 520px) { .strip { grid-template-columns: 1fr; } } /* Briefing: vier Schritte untereinander statt 472 px breit */
@media (max-width: 640px) {
  /* Touch-Ziele mindestens 44 px hoch */
  .chip { padding: 11px 14px; min-height: 44px; display: inline-flex; align-items: center; }
  .seg button { padding: 12px 12px; min-height: 44px; }
  .linkbtn, .topbar a { display: inline-block; padding: 12px 4px; }
  .range-row { min-height: 44px; }
  .range-row input[type=range] { height: 44px; }
  details.group > summary, .dossier-mini > summary, details.msg-body > summary, .msg-read > summary { min-height: 44px; display: flex; align-items: center; }
  .dr-item button { min-height: 44px; }
  /* Kopfzeile kompakter: eine Zeile Titel · Dossier · Cheat Sheet · Timer, darunter die Budgetzeile; „Abmelden“ gibt es im Profil und nach dem Sprint */
  .topbar .inner:first-child { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; grid-template-areas: "title dossier sheet timer" "budget budget budget budget"; align-items: center; column-gap: 8px; row-gap: 0; padding: 4px 12px; }
  .topbar .title { grid-area: title; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .topbar .title .muted { display: none; }
  .topbar .spacer, .topbar a[href="logout.php"] { display: none; }
  .topbar a[href="dossier.php"] { grid-area: dossier; }
  .topbar a[href="cheatsheet.php"] { grid-area: sheet; }
  .timer { grid-area: timer; font-size: 1rem; }
  .budget { grid-area: budget; order: 0; flex-basis: auto; font-size: .75rem; font-weight: 500; line-height: 1.2; padding-bottom: 2px; }
  .topbar .inner:last-child { padding-top: 0 !important; padding-bottom: 6px !important; }
  .time-banner { font-size: .9rem; padding: 8px 12px; }
}
