/* Stil wie die Patienten-App (Gesundheits-App trifft Banking-App), dichter für den Arbeitsplatz:
   links der Eingang als Kartenliste, rechts der Fall mit Navy-Kopf und weißen Arbeitskarten. */
:root {
  --bg: #f3f5f8; --card: #ffffff; --line: #e4e8ee; --ink: #121f36; --muted: #5d6a80;
  --navy: #121f36; --navy-2: #1d3157; --on-navy-muted: rgba(255, 255, 255, 0.68);
  --teal: #0e8f7e; --teal-ink: #ffffff; --mint: #e3f5f0; --mint-ink: #0b5f54; --ring: #5fdcc0;
  --a: #1e9e78; --b: #d9a521; --c: #e0772f; --d: #d64545;
  --warn-bg: #fdecea; --warn-ink: #8f2a22;
  --shadow: 0 1px 2px rgba(18, 31, 54, 0.05), 0 6px 20px rgba(18, 31, 54, 0.06);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 18px; --r-s: 12px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0a1120; --card: #121c30; --line: #223150; --ink: #eef2f7; --muted: #9fadc4;
  --navy: #16264a; --navy-2: #213866;
  --teal: #2bb39d; --teal-ink: #06221d; --mint: #11302c; --mint-ink: #8fe5d2; --ring: #6ee6cb;
  --a: #3dbb93; --b: #e5b744; --c: #ee8d4b; --d: #ef6b6b;
  --warn-bg: #3a1f1d; --warn-ink: #f6b4ab; --shadow: 0 1px 2px rgba(0, 0, 0, 0.3); color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #0a1120; --card: #121c30; --line: #223150; --ink: #eef2f7; --muted: #9fadc4;
  --navy: #16264a; --navy-2: #213866;
  --teal: #2bb39d; --teal-ink: #06221d; --mint: #11302c; --mint-ink: #8fe5d2; --ring: #6ee6cb;
  --a: #3dbb93; --b: #e5b744; --c: #ee8d4b; --d: #ef6b6b;
  --warn-bg: #3a1f1d; --warn-ink: #f6b4ab; --shadow: 0 1px 2px rgba(0, 0, 0, 0.3); color-scheme: dark }

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 var(--font);
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
.wrap { max-width: 1240px; margin: 0 auto; padding-block: 16px 56px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1, h2, h3 { text-wrap: balance; margin: 0; line-height: 1.2; letter-spacing: -0.015em; }
h1 { font-size: 26px; font-weight: 800; } h2 { font-size: 18px; font-weight: 700; } h3 { font-size: 15px; font-weight: 700; }
p { margin: 0; }
.eyebrow, .label { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.muted { color: var(--muted); } .small { font-size: 13.5px; } .note { font-size: 12.5px; color: var(--muted); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.between { justify-content: space-between; }
.num { font-variant-numeric: tabular-nums; }

/* Kopfzeile */
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -0.01em; }
.brand span { font-weight: 500; color: var(--muted); }
.brand svg { width: 30px; height: 30px; }
.proto { font-size: 12px; font-weight: 600; color: var(--mint-ink); background: var(--mint); padding: 4px 10px; border-radius: 999px; }

/* Bedienelemente */
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.btn { border: 0; border-radius: 999px; padding: 12px 20px; min-height: 44px; font: 700 14.5px/1 var(--font); background: var(--teal); color: var(--teal-ink);
  display: inline-flex; align-items: center; gap: 8px; transition: filter .12s, transform .12s; }
.btn:hover { filter: brightness(1.06); } .btn:active { transform: scale(0.98); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--teal); font-weight: 600; font-size: 13.5px; }
input[type=search], select, textarea { border: 1.5px solid var(--line); background: var(--card); border-radius: var(--r-s); }
input[type=search] { width: 100%; padding: 11px 14px; text-transform: uppercase; font-weight: 600; letter-spacing: .03em; }
input[type=search]::placeholder { text-transform: none; font-weight: 400; letter-spacing: 0; }
select { padding: 7px 10px; }
textarea { width: 100%; min-height: 130px; resize: vertical; padding: 12px 14px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); outline: none; }
input[type=range] { width: 100%; accent-color: var(--teal); }


/* Eingang */
.inbox { display: flex; flex-direction: column; gap: 8px; }
.case { text-align: left; background: var(--card); border: 0; border-radius: var(--r-s); box-shadow: var(--shadow); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 6px; transition: box-shadow .12s; }
.case:hover { box-shadow: var(--shadow), inset 0 0 0 1.5px var(--line); }
.case[aria-current="true"] { box-shadow: inset 0 0 0 2px var(--teal); background: var(--mint); }
.case .id { font-weight: 800; font-size: 15.5px; letter-spacing: .02em; }
.status { font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 999px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.status.new { background: var(--teal); color: var(--teal-ink); }
.status.done { background: var(--mint); color: var(--mint-ink); }
.status.gate { background: var(--warn-bg); color: var(--warn-ink); }
.on-navy .status.done { background: rgba(95, 220, 192, .16); color: var(--ring); }

/* Pills: Punkt + Text, damit jede Farbe lesbar bleibt */
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px;
  background: var(--bg); white-space: nowrap; }
.pill i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.pill.open { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--muted); }

/* Fallkopf (Navy) */
.on-navy { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; }
.on-navy .eyebrow, .on-navy .note, .on-navy .label { color: var(--on-navy-muted); }
.head { border-radius: 24px; padding: 22px; display: flex; flex-direction: column; gap: 18px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.steps div { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; padding: 10px 12px; border-radius: var(--r-s);
  background: rgba(255, 255, 255, .07); color: var(--on-navy-muted); }
.steps b { width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 12px;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25); }
.steps div.on { background: rgba(95, 220, 192, .14); color: #fff; }
.steps div.on b { box-shadow: inset 0 0 0 2.5px var(--ring); color: var(--ring); }
.steps div.done { color: #fff; }
.steps div.done b { background: var(--ring); color: var(--navy); box-shadow: none; }
@media (max-width: 620px) { .steps { grid-template-columns: 1fr; } }

/* Arbeitskarten */
.panel { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.panel.tinted { background: var(--card); }
.big { font-size: 42px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.big small { font-size: 13px; color: var(--muted); font-weight: 600; letter-spacing: 0; margin-left: 6px; }
.compare { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.compare > * { min-width: 0; }
.compare > div { background: var(--bg); border-radius: var(--r-s); padding: 14px 16px; display: grid; gap: 6px; }
.compare > div.hl { background: var(--mint); }
.compare > div.hl .eyebrow, .compare > div.hl .big, .compare > div.hl .big small { color: var(--mint-ink); }
.delta { font-size: 14px; font-weight: 800; padding: 8px 12px; border-radius: 999px; background: var(--navy); color: #fff; white-space: nowrap; }
@media (max-width: 560px) { .compare { grid-template-columns: 1fr; } .delta { justify-self: start; } }

.answers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font-size: 13.5px; }
.answers > div { background: var(--bg); border-radius: 10px; padding: 9px 12px; min-width: 0; }
.answers .muted { display: block; font-size: 12px; font-weight: 600; }
@media (max-width: 560px) { .answers { grid-template-columns: 1fr; } }
.riskline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.riskline span.k { font-size: 12px; font-weight: 700; color: var(--muted); margin-left: 4px; }

.drop { border: 1.5px dashed var(--line); border-radius: var(--r-s); padding: 12px 14px; font-size: 13.5px; color: var(--muted); }
.thinking { font-size: 13.5px; color: var(--mint-ink); background: var(--mint); border-radius: var(--r-s); padding: 10px 14px; }
.error { background: var(--warn-bg); color: var(--warn-ink); border-radius: var(--r-s); padding: 10px 14px; font-size: 13.5px; }
.gatebox { background: var(--warn-bg); color: var(--warn-ink); border-radius: var(--r-s); padding: 12px 14px; }

.dims { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.dims > * { min-width: 0; background: var(--bg); border-radius: var(--r-s); padding: 12px 14px; }
@media (max-width: 680px) { .dims { grid-template-columns: 1fr; } }
.reason { font-size: 12.5px; color: var(--muted); }
.risks { display: flex; flex-direction: column; background: var(--bg); border-radius: var(--r-s); }
.risk-row { display: grid; grid-template-columns: 1fr 150px; gap: 12px; padding: 11px 14px; border-top: 1px solid var(--line); align-items: center; }
.risk-row:first-child { border-top: 0; }
.risk-row > * { min-width: 0; }
.facts { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.facts li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: baseline; }
.src { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); white-space: nowrap; }

/* Vorschau der Patientenkarte (wie in der Patienten-App) */
.pcard { border-radius: 24px; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.pcard ul { margin: 0; padding-left: 18px; }
.pcard .score-row { display: grid; grid-template-columns: 120px 1fr; gap: 18px; align-items: center; }
.ring { position: relative; width: 120px; height: 120px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .v { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring strong { font-size: 38px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.ring small { font-size: 11px; color: var(--on-navy-muted); margin-top: 3px; }
.pcard .nextbox { background: rgba(95, 220, 192, .12); border-radius: var(--r-s); padding: 14px 16px; display: grid; gap: 4px; }
@media (max-width: 460px) { .pcard .score-row { grid-template-columns: 1fr; justify-items: center; text-align: center; } }

/* Kopf: Ansichten, Person, Standorte */
.top { margin-bottom: 14px; }
.tabs { display: flex; gap: 4px; background: var(--card); padding: 4px; border-radius: 999px; box-shadow: var(--shadow); }
.tab { border: 0; background: none; padding: 9px 16px; border-radius: 999px; font-weight: 700; font-size: 14px; color: var(--muted); }
.tab[aria-current="true"] { background: var(--navy); color: #fff; }
.whoami { display: flex; align-items: center; gap: 8px; }
.whoami select { max-width: 240px; font-weight: 600; }
.places { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.place { border: 0; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.place[aria-pressed="true"] { background: var(--navy); color: #fff; box-shadow: none; }
.demo { font-size: 13px; color: var(--mint-ink); background: var(--mint); border-radius: var(--r-s); padding: 9px 14px; margin-bottom: 16px; }
@media (max-width: 760px) { .tabs { order: 3; width: 100%; } .tab { flex: 1; padding: 9px 8px; } }

.view-head { margin-bottom: 16px; }
.day { font-size: 14px; font-weight: 700; color: var(--muted); margin: 22px 0 10px; text-transform: uppercase; letter-spacing: .05em; }
.empty { font-size: 14px; color: var(--muted); padding: 14px 0; }

/* Arbeitsliste */
.list { display: flex; flex-direction: column; gap: 8px; }
.item { display: grid; grid-template-columns: 76px minmax(160px, 1.3fr) 130px minmax(140px, 1fr) minmax(150px, 1.2fr); gap: 16px; align-items: center;
  text-align: left; border: 0; background: var(--card); border-radius: var(--r-s); box-shadow: var(--shadow); padding: 14px 18px; }
.item:hover { box-shadow: var(--shadow), inset 0 0 0 1.5px var(--teal); }
.item > span { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.item small { font-size: 12.5px; color: var(--muted); }
.when strong { font-size: 18px; font-weight: 800; }
.who strong { font-size: 15.5px; }
.stage { align-self: flex-start; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--bg); }
.bar { display: block; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin-top: 3px; }
.bar i { display: block; height: 100%; background: var(--teal); border-radius: 99px; }
.todo { flex-direction: row !important; align-items: center; gap: 8px !important; }
.badge { flex: none; min-width: 24px; height: 24px; border-radius: 999px; background: var(--c); color: #fff; font-size: 12px; font-weight: 800; display: grid; place-items: center; padding: 0 6px; }
.todo small { color: var(--ink) !important; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) { .item { grid-template-columns: 60px 1fr; gap: 6px 14px; } .item .when { grid-row: 1 / span 4; align-self: start; } .item > span:not(.when) { grid-column: 2; } .item .where { flex-direction: row; align-items: center; gap: 8px; } }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.codechip { display: inline-flex; gap: 8px; align-items: center; background: var(--card); box-shadow: var(--shadow); border-radius: var(--r-s); padding: 10px 14px; font-size: 13.5px; }
.codechip small { color: var(--muted); }

/* Trichter */
.board { display: grid; grid-template-columns: repeat(6, minmax(220px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.col-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 44px; }
.col-head h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.count { min-width: 30px; height: 30px; border-radius: 999px; background: var(--navy); color: #fff; font-weight: 800; font-size: 13px; display: grid; place-items: center; padding: 0 8px; }
.group { border-radius: var(--r); padding: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--mint); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--teal) 35%, transparent); }
.group.plain { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); }
.group-head { display: flex; justify-content: space-between; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 2px 4px; }
.bcard { text-align: left; border: 0; background: var(--card); border-radius: var(--r-s); box-shadow: var(--shadow); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.bcard:hover { box-shadow: var(--shadow), inset 0 0 0 1.5px var(--teal); }
.bcard small { font-size: 12px; }

/* Akte */
.back { margin-bottom: 12px; }
.akte .head h1 { font-size: 28px; }
.hstat { display: grid; gap: 2px; background: rgba(255, 255, 255, .08); border-radius: var(--r-s); padding: 8px 14px; min-width: 78px; }
.hstat small { font-size: 11.5px; color: var(--on-navy-muted); }
.hstat strong { font-size: 20px; font-weight: 800; line-height: 1.1; }
.hstat.hot { background: var(--c); }
.hstat.hot small { color: rgba(255, 255, 255, .85); }
.stepper { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.stepper div { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; padding: 8px 10px; border-radius: var(--r-s); background: rgba(255, 255, 255, .07); color: var(--on-navy-muted); min-width: 0; }
.stepper span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stepper b { width: 22px; height: 22px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 11px; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .25); }
.stepper div.on { background: rgba(95, 220, 192, .16); color: #fff; }
.stepper div.on b { box-shadow: inset 0 0 0 2.5px var(--ring); color: var(--ring); }
.stepper div.done { color: #fff; }
.stepper div.done b { background: var(--ring); color: #121f36; box-shadow: none; }
@media (max-width: 760px) { .stepper { grid-template-columns: repeat(3, 1fr); } }
.hbar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.hbar i { display: block; height: 100%; background: var(--ring); }
.akte-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; align-items: start; margin-top: 16px; }
@media (max-width: 960px) { .akte-grid { grid-template-columns: minmax(0, 1fr); } }
.akte-grid > * { min-width: 0; }

.phase { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
.phase.current { box-shadow: var(--shadow), inset 0 0 0 2px var(--teal); }
.phase summary, .summary-like { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center; padding: 16px 18px; cursor: pointer; list-style: none; }
.summary-like { cursor: default; grid-template-columns: 30px 1fr; }
.phase summary::-webkit-details-marker { display: none; }
.pnum { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800; background: var(--bg); color: var(--muted); }
.phase.finished .pnum { background: var(--teal); color: var(--teal-ink); }
.phase.current .pnum { background: var(--mint); color: var(--teal); box-shadow: inset 0 0 0 2px var(--teal); }
.ptitle { display: grid; gap: 1px; min-width: 0; }
.ptitle small { font-size: 12.5px; color: var(--muted); }
.pcount { display: flex; gap: 8px; align-items: center; font-weight: 700; font-size: 13px; color: var(--muted); }
.pbody { padding: 0 18px 18px 60px; display: grid; gap: 14px; }
@media (max-width: 560px) { .pbody { padding-left: 18px; } }
.tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.task { display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start; padding: 8px 10px; border-radius: 10px; }
.task > span { display: grid; gap: 1px; }
.task small { font-size: 12px; color: var(--muted); }
.task.is-mine { background: color-mix(in srgb, var(--c) 10%, transparent); }
.task.is-mine small { color: var(--c); font-weight: 700; }
.task.is-done .ttext { color: var(--muted); }
.tick { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line); background: var(--card); display: grid; place-items: center; padding: 0; color: var(--teal-ink); margin-top: 1px; }
.tick:hover { border-color: var(--teal); }
.tick[aria-pressed="true"], .tick.auto:not(:empty) { background: var(--teal); border-color: var(--teal); }
.tick.auto { border-style: dashed; }
.sub { background: var(--bg); border-radius: var(--r-s); padding: 14px; display: grid; gap: 12px; }
.sub .answers > div { background: var(--card); }
.panel.flat { box-shadow: none; }
.routes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.routeopt { display: flex; gap: 10px; align-items: center; background: var(--card); border-radius: var(--r-s); padding: 10px 12px; cursor: pointer; box-shadow: inset 0 0 0 1.5px var(--line); }
.routeopt:has(input:checked) { box-shadow: inset 0 0 0 2px var(--teal); background: var(--mint); }
.routeopt input { accent-color: var(--teal); }
.routeopt span { display: grid; } .routeopt small { font-size: 12px; color: var(--muted); }
@media (max-width: 560px) { .routes { grid-template-columns: 1fr; } }
.abs { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; counter-reset: a; }
.abs li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; background: var(--card); border-radius: 10px; padding: 8px 12px; }
.abs li > span { display: grid; } .abs small { font-size: 12px; color: var(--muted); }
@media (max-width: 560px) { .abs li { grid-template-columns: 1fr; } }
.track { list-style: none; margin: 0; padding: 0 18px 18px 60px; display: grid; gap: 0; }
.track li { position: relative; display: grid; grid-template-columns: 18px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; }
.track li::before { content: ""; position: absolute; left: 8px; top: 0; bottom: 0; width: 2px; background: var(--line); }
.track li:first-child::before { top: 50%; } .track li:last-child::before { bottom: 50%; }
.track .dot { position: relative; width: 18px; height: 18px; border-radius: 50%; background: var(--card); box-shadow: inset 0 0 0 2px var(--line); }
.track li.done .dot { background: var(--teal); box-shadow: none; }
.track li.on .dot { box-shadow: inset 0 0 0 5px var(--teal); }
.track li.on strong { color: var(--teal); }
.track li > span:nth-child(2) { display: grid; } .track small { font-size: 12px; color: var(--muted); }
.track li.is-mine { background: color-mix(in srgb, var(--c) 10%, transparent); border-radius: 10px; }
@media (max-width: 560px) { .track { padding-left: 18px; } .track li { grid-template-columns: 18px 1fr; } .track select { grid-column: 2; } }
.terms { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 13.5px; }
.terms li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
.terms li > span:last-child { display: grid; } .terms small { font-size: 12px; color: var(--muted); }
.terms li.past { opacity: .55; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--mint); color: var(--mint-ink); display: grid; place-items: center; font-size: 12px; font-weight: 800; }

/* Neue Daten zum Fall */
.capture textarea { min-height: 110px; }
.grow { flex: 1; }
.filebtn { position: relative; overflow: hidden; cursor: pointer; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.btn.rec { background: var(--d); color: #fff; box-shadow: none; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs img { width: 76px; height: 76px; object-fit: cover; border-radius: 10px; display: block; background: var(--bg); }
.thumb { position: relative; }
.thumb button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; background: var(--navy); color: #fff; text-decoration: none; font-size: 14px; line-height: 22px; padding: 0; }
.entries { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; max-height: 520px; overflow: auto; }
.entries li { display: grid; gap: 6px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.entries li:last-child { border-bottom: 0; }
.entries p { font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.entries small { font-size: 11.5px; color: var(--muted); }
.entries .thumbs img { width: 60px; height: 60px; }
.entries .row.between { align-items: baseline; }
.entdel { color: var(--muted); font-size: 12px; flex: none; }
.entdel:hover { color: var(--d); }
/* Bezeichnung der Unterlage (NP-Bogen, Röntgen …) statt Fließtext */
.doclabel { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; background: var(--mint); color: var(--mint-ink); }

/* Vorschläge des Agenten */
.agent { box-shadow: var(--shadow), inset 0 0 0 1.5px color-mix(in srgb, var(--teal) 40%, transparent); }
.agent h3 { margin-top: 4px; }
.warn { color: var(--c); }
.summary { font-size: 14.5px; background: var(--mint); color: var(--mint-ink); border-radius: var(--r-s); padding: 12px 14px; }
.sugg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 680px) { .sugg-grid { grid-template-columns: 1fr; } }
.sugg { background: var(--bg); border-radius: var(--r-s); padding: 14px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.mini { display: grid; grid-template-columns: 60px 1fr; gap: 2px 10px; align-items: center; font-size: 13px; }
.mini small { grid-column: 2; font-size: 12px; color: var(--muted); }
.riskline2 { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; align-items: center; font-size: 13.5px; }
.riskline2 > small { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.sugg-list, .steps-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.sugg-list li, .steps-list li { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.sugg-list li > span, .steps-list li > span:first-child { display: grid; gap: 2px; min-width: 0; }
.sugg-list small, .steps-list small { font-size: 12px; color: var(--muted); }
.steps-list { counter-reset: s; }
.steps-list li { counter-increment: s; grid-template-columns: 26px 1fr auto; }
.steps-list li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font-size: 12px; font-weight: 800; color: var(--muted); }
.steps-list li.is-mine { background: color-mix(in srgb, var(--c) 12%, transparent); }
.steps-list .chips { gap: 4px; justify-content: flex-end; }
@media (max-width: 560px) { .steps-list li { grid-template-columns: 26px 1fr; } .steps-list .chips { grid-column: 2; justify-content: flex-start; } }
.small-btn { min-height: 34px; padding: 8px 14px; font-size: 13px; }
.routes-sugg { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.routecard { background: var(--bg); border-radius: var(--r-s); padding: 12px 14px; display: grid; gap: 6px; align-content: start; }
.routecard .linkbtn { justify-self: start; }
.plain { margin: 0; padding-left: 18px; font-size: 14px; display: grid; gap: 4px; }
.facts-d summary { cursor: pointer; font-weight: 700; font-size: 14px; padding: 4px 0; }
.review { box-shadow: inset 0 0 0 2px var(--teal); }
.review .compare > div { background: var(--card); }
.pbody > *, .task > span, .sub > * { min-width: 0; }
.ttext, .task small { overflow-wrap: anywhere; }
select { max-width: 100%; min-width: 0; }

/* Empfehlungen */
.empf { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.seg { display: inline-flex; background: var(--bg); border-radius: 999px; padding: 3px; flex-wrap: wrap; }
.seg button { border: 0; background: none; padding: 7px 12px; border-radius: 999px; font-weight: 700; font-size: 13px; color: var(--muted); }
.seg button span { font-weight: 600; opacity: .7; margin-left: 2px; }
.seg button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.chipbtn { border: 0; background: var(--bg); padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.chipbtn[aria-pressed="true"] { background: var(--navy); color: #fff; }
.emp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.emp { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: 12px; align-items: start; background: var(--bg); border-radius: var(--r-s); padding: 12px 14px;
  border-left: 4px solid var(--line); }
.emp.art-befund { border-left-color: var(--b); }
.emp.art-schritt { border-left-color: var(--teal); }
.emp.art-therapie { border-left-color: #6a5acd; }
.emp.art-aufgabe { border-left-color: var(--a); }
.emp.is-mine { background: color-mix(in srgb, var(--c) 10%, var(--bg)); }
.emp-art { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding-top: 2px; }
.emp-art b { display: inline-block; background: var(--c); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: 10.5px; margin-top: 4px; text-transform: none; letter-spacing: 0; }
.emp-body { display: grid; gap: 4px; min-width: 0; }
.emp-body small { font-size: 12.5px; color: var(--muted); }
.emp-body .chips { gap: 4px; }
.emp-actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
/* Zuordnung einer offenen Empfehlung: „Gehört zu“ und „Wer macht's“ */
.emp-edit { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-top: 2px; }
.emp-field { display: grid; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); }
.emp-field select { padding: 6px 8px; font-size: 12.5px; }
.updown { display: flex; gap: 4px; justify-content: flex-end; }
.iconbtn { border: 0; width: 32px; height: 30px; border-radius: 8px; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line); font-weight: 800; color: var(--ink); }
.iconbtn:disabled { opacity: .35; cursor: default; }
@media (max-width: 640px) {
  .emp { grid-template-columns: minmax(0, 1fr); }
  .emp-actions { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .updown { margin-left: auto; }
}

/* Patientenreise: Navigation füllt sich Schritt für Schritt, Zukunft nur angedeutet */
.journey { display: flex; flex-wrap: wrap; gap: 6px; }
.jstep { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; padding: 7px 11px 7px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, .08); color: #fff; }
.jstep b { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--ring); color: #121f36; flex: none; }
.jstep b svg { width: 12px; height: 12px; }
.jstep.on { background: rgba(95, 220, 192, .18); box-shadow: inset 0 0 0 1.5px var(--ring); }
.jstep.on b { background: transparent; box-shadow: inset 0 0 0 5px var(--ring); }
.jstep.future { background: transparent; color: var(--on-navy-muted); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .18); border: 0; opacity: .75; }
.jstep.future b { background: transparent; box-shadow: inset 0 0 0 1.5px dashed rgba(255, 255, 255, .3); border: 1.5px dashed rgba(255, 255, 255, .35); }
button.jstep { font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
button.jstep:hover { filter: brightness(1.12); }
button.jstep.on { cursor: default; }
button.jstep:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }

/* Blöcke */
.block.work { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow), inset 0 0 0 2px var(--teal); padding: 20px; display: grid; gap: 16px; min-width: 0; }
.block.work.editing { box-shadow: var(--shadow), inset 0 0 0 2px var(--b); }
.block-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.block-head h2 { font-size: 22px; margin: 2px 0; }
.tasks.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 2px 10px; }
.block.compact { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }
.block.compact summary { display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: center; padding: 14px 18px; cursor: pointer; list-style: none; }
.block.compact summary::-webkit-details-marker { display: none; }
.block.compact .pnum { background: var(--teal); color: var(--teal-ink); }
.block.compact.is-current .pnum { background: var(--mint); box-shadow: inset 0 0 0 2px var(--teal); }
.block.compact .pbody { padding: 0 18px 16px 60px; }
@media (max-width: 560px) { .block.compact .pbody { padding-left: 18px; } }
.next-hint { font-size: 13.5px; color: var(--muted); border: 1.5px dashed var(--line); border-radius: var(--r-s); padding: 12px 14px; }
.agent.sub { background: var(--bg); box-shadow: none; }
.agent.sub .sugg, .agent.sub .emp { background: var(--card); }
.close-box { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 16px; }
.close-box > div:first-child { flex: 1 1 260px; }
details.sub > summary { cursor: pointer; list-style: none; }
details.sub > summary::-webkit-details-marker { display: none; }

/* Foto direkt am Aufgaben-Punkt (Dokumente, Röntgen) */
.task.has-foto { grid-template-columns: 26px 1fr auto; }
.task .fotobtn { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 7px 12px; font: 700 13px/1 var(--font); background: var(--teal); color: var(--teal-ink); align-self: center; }
.task .fotobtn svg { width: 16px; height: 16px; }
.task.is-done .fotobtn { background: transparent; color: var(--teal); box-shadow: inset 0 0 0 1.5px var(--line); }
.task .fotobtn:has(input:disabled) { opacity: .5; }
@media (max-width: 560px) { .task .fotobtn .fl { display: none; } }

/* Dental Health Score: kleiner Ring im Kopf (neben Name/Status); große Karte nur auf Desktop rechts */
.mring { position: relative; width: 52px; height: 52px; display: inline-grid; place-items: center; flex: none; }
.mring svg { width: 100%; height: 100%; }
.mring b { position: absolute; font-size: 17px; font-weight: 800; color: #fff; letter-spacing: -0.02em; }
@media (max-width: 960px) { .pcard.desktop-dhs { display: none; } }

/* Admin: Anthropic-Schlüssel */
.keypanel { margin-bottom: 14px; box-shadow: var(--shadow), inset 0 0 0 1.5px color-mix(in srgb, var(--teal) 40%, transparent); }
.keypanel input[type=password] { width: 100%; padding: 11px 14px; border: 1.5px solid var(--line); background: var(--card); border-radius: var(--r-s); font: inherit; letter-spacing: .02em; }
.keypanel input[type=password]:focus { border-color: var(--teal); outline: none; }
.keypanel input[type=text] { width: 100%; padding: 11px 14px; border: 1.5px solid var(--line); background: var(--card); border-radius: var(--r-s); font: inherit; }
.keypanel input[type=text]:focus { border-color: var(--teal); outline: none; }
.keypanel select { max-width: 100%; }

/* Patient-Suche oben (ersetzt die Standort-Leiste) */
input[type=search].patsearch { max-width: 420px; text-transform: none; font-weight: 500; letter-spacing: 0; }
.searchresults:not(:empty) { margin-bottom: 16px; }
.searchbox { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 10px; display: grid; gap: 6px; }
.searchbox > .label { padding: 4px 6px; }
.sresult { display: flex; justify-content: space-between; gap: 12px; align-items: center; text-align: left; border: 0; background: var(--bg); border-radius: var(--r-s); padding: 11px 14px; }
.sresult:hover { box-shadow: inset 0 0 0 1.5px var(--teal); }
.sresult .who { display: grid; gap: 2px; min-width: 0; }
.sresult small { font-size: 12px; color: var(--muted); }
.sresult .swhere { display: flex; gap: 8px; align-items: center; flex: none; }

/* Befundplanung: Diagnosen + Therapieplan in 4 Dringlichkeitsstufen */
.bp { display: grid; gap: 16px; }
.bp-sec { display: grid; gap: 8px; }
.bp-diag { gap: 7px; }
.bp-chip { border: 1.5px solid var(--line); background: var(--card); color: var(--ink); border-radius: 999px; padding: 7px 12px; font-weight: 600; font-size: 13px; display: inline-flex; gap: 7px; align-items: center; cursor: pointer; }
.bp-chip small { color: var(--muted); font-weight: 500; }
.bp-chip.on { background: var(--mint); border-color: var(--teal); color: var(--mint-ink); }
.bp-chip.on small { color: var(--mint-ink); }
.bp-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 860px) { .bp-cols { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .bp-cols { grid-template-columns: 1fr; } }
.bp-col { background: var(--bg); border-radius: var(--r-s); padding: 10px; display: grid; gap: 8px; min-width: 0; align-content: start; }
.bp-col h4 { margin: 0; font-size: 12.5px; display: flex; align-items: center; gap: 7px; }
.bp-dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.bp-dot.MN, .bp-stufeh .bp-dot.MN { background: #1e9e78; }
.bp-dot.ME { background: #d9a521; }
.bp-dot.MM { background: #e0772f; }
.bp-dot.MX { background: #d64545; }
.bp-stufeh { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13.5px; margin: 0 0 2px; }
.bp-card { background: var(--card); border: 1.5px solid var(--line); border-left: 4px solid var(--line); border-radius: var(--r-s); padding: 11px 13px; display: grid; gap: 9px; }
.bp-card.s-MN { border-left-color: #1e9e78; }
.bp-card.s-ME { border-left-color: #d9a521; }
.bp-card.s-MM { border-left-color: #e0772f; }
.bp-card.s-MX { border-left-color: #d64545; }
.bp-card.off { opacity: .5; }
.bp-card strong { font-size: 14px; }
.bp-diff { display: block; margin-top: 3px; font-size: 11.5px; color: #e0772f; font-weight: 600; }
.bp-info { display: block; margin-top: 3px; font-size: 11.5px; color: var(--muted); font-weight: 400; } /* Begründung der KI */
.bp-meta { display: flex; gap: 9px; flex-wrap: wrap; align-items: center; }
.bp-field { display: grid; gap: 2px; font-size: 11px; font-weight: 600; color: var(--muted); }
.bp-field select { padding: 6px 8px; font-size: 12.5px; }
.bp-price { font-weight: 700; margin-left: auto; }
.bp-sw { position: relative; width: 42px; height: 24px; flex: none; }
.bp-sw input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.bp-sw i { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: .15s; }
.bp-sw i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .15s; }
.bp-sw input:checked + i { background: var(--teal); }
.bp-sw input:checked + i::after { transform: translateX(18px); }
.bp-sum { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--bg); border-radius: var(--r-s); padding: 12px 14px; }
.bp-fall { background: var(--bg); border-radius: var(--r-s); padding: 14px; display: grid; gap: 8px; }
.bp-fall .plain { margin: 2px 0; }
.bp-fall .plain li { padding: 6px 0; border-bottom: 1px solid var(--line); }

/* Preisfeld je Therapie (Befundplanung) */
.bp-preis { margin-left: auto; }
.bp-preis input { width: 84px; padding: 6px 8px; font-size: 12.5px; }

/* Heil- und Kostenkommunikation: wer stellt den Antrag */
.deleg { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.deleg li { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line); border-radius: var(--r-s); padding: 8px 11px; background: var(--card); }
.deleg li > span:first-child { display: grid; gap: 2px; min-width: 0; flex: 1; }
.deleg strong { font-size: 13.5px; }
.deleg .pill { justify-self: start; } /* sonst zieht das Raster die Stufen-Plakette breit */
.deleg small { color: var(--muted); font-size: 11.5px; }
.deleg .dpreis { font-weight: 700; font-size: 13px; white-space: nowrap; flex: none; }
.deleg select { padding: 6px 8px; font-size: 12.5px; flex: none; }
@media (max-width: 560px) {
  .deleg li { flex-wrap: wrap; }
  .deleg select { width: 100%; }
}
