/* DentaPlan 2.1 – Planen (VORAAA-73, flag plan_v21): ported from the approved mockup
 * web/design/v2.1/v21.css (VORAAA-69). Tokens/components only; no inline styles (CSP). */

.p21 { padding-bottom: 140px; }

/* ---- compact Fall header: one line of facts, one progress line, everything else in "⋯" ---- */
.fhead { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--sp-3) var(--sp-5); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.fhead h1 { margin: 2px 0 4px; font-size: var(--fs-2xl); letter-spacing: var(--tracking-tight); }
.facts { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.fact { display: inline-flex; align-items: center; gap: 6px; min-height: var(--touch); padding: 0 var(--sp-3); border: 1px solid var(--line); background: var(--card); border-radius: var(--r-md); color: var(--ink-2); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.fact .ico { width: 16px; height: 16px; }
.saved { display: inline-flex; gap: 4px; align-items: center; font-size: var(--fs-sm); color: var(--ok-ink); }
.saved .ico { width: 16px; height: 16px; }
.fhead-side { display: flex; align-items: center; gap: var(--sp-2); }
.stages { list-style: none; margin: 0; padding: 4px; display: flex; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-pill); }
.stages li { display: flex; align-items: center; gap: 6px; padding: 6px 12px 6px 6px; border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: var(--fw-semi); color: var(--ink-3); white-space: nowrap; }
.stages li i { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--neutral-50); flex: none; }
.stages li i .ico { width: 13px; height: 13px; }
.stages li small { display: block; font-size: 11px; font-weight: var(--fw-regular); line-height: 1.1; }
.stages li span { line-height: 1.15; }
.stages li.done { color: var(--ink-2); }
.stages li.done i { background: var(--green-50); color: var(--green); }
.stages li.cur { background: var(--accent-50); color: var(--accent-text); }
.stages li.cur i { background: var(--primary-fill); }
.stages li.skip { text-decoration: line-through; text-decoration-color: var(--ink-4); }

/* ---- the one surface ---- */
.plan { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--sp-4); align-items: start; }
.entry-h { display: flex; align-items: baseline; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-3); }
.entry-h h2 { margin: 0; font-size: var(--fs-xl); }
.src-chip { font-size: var(--fs-xs); font-weight: var(--fw-semi); padding: 2px 8px; border-radius: var(--r-pill); background: var(--blue-50); color: var(--info-ink); }
.entry { position: relative; }
.pvs-banner { display: grid; grid-template-columns: auto 1fr auto; gap: var(--sp-3); align-items: center; padding: var(--sp-3) var(--sp-4); border-radius: var(--r-lg); background: var(--blue-50); color: var(--info-ink); margin-bottom: var(--sp-3); }
.pvs-banner b { display: block; color: var(--ink); }
.pvs-banner span { font-size: var(--fs-sm); }
.palette { display: flex; gap: 6px; margin-top: var(--sp-3); overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.pchip { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: var(--touch); padding: 0 12px 0 8px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--card); color: var(--ink); cursor: pointer; font: inherit; font-size: var(--fs-sm); }
.pchip b { font-family: var(--font-mono); min-width: 26px; padding: 2px 6px; border-radius: var(--r-xs); text-align: center; background: var(--st-intact-50); color: var(--st-intact); }
.pchip.st-renew b { background: var(--st-renew-50); color: var(--st-renew); }
.pchip.st-remove b { background: var(--st-remove-50); color: var(--st-remove); }
.pchip.st-defect b { background: var(--st-defect-50); color: var(--st-defect); }
.pchip.st-missing b { background: var(--st-missing-50); color: var(--ink-2); }
.pchip span { color: var(--ink-2); max-width: 11em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pchip[aria-pressed="true"] { border-color: var(--accent); box-shadow: var(--ring); background: var(--accent-50); }
.pchip.more { padding: 0 14px; color: var(--accent-text); font-weight: var(--fw-semi); }
.arm-hint { font-size: var(--fs-xs); color: var(--ink-3); margin: var(--sp-2) 0 0; }
.arm-hint b { font-family: var(--font-mono); color: var(--accent-text); }
.chart21 { position: relative; margin-top: var(--sp-3); overflow-x: auto; }
.entry { min-width: 0; }
.chart-box { position: relative; }
.tpop { position: absolute; z-index: var(--z-pop); top: 8px; left: 50%; transform: translateX(-50%); width: min(420px, calc(100% - 16px)); background: var(--raised); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: var(--sp-3); }
.tpop-h { display: flex; align-items: center; gap: var(--sp-2); }
.tpop-h .tiny { flex: 1; }
.tpop-codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: var(--sp-2); }
.tpop-codes .pchip { width: 100%; }
.tpop-f { display: flex; justify-content: space-between; margin-top: var(--sp-2); }
.fchips { list-style: none; padding: 0; margin: var(--sp-3) 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 2px 2px 10px; min-height: 40px; border-radius: var(--r-pill); background: var(--sunk); border: 1px solid var(--line); font-size: var(--fs-sm); }
.fchip .tn { font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.fchip .lbl { color: var(--ink-2); max-width: 14em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fchip.amb { background: var(--red-50); border-color: transparent; color: var(--error-ink); padding-right: 6px; flex-wrap: wrap; border-radius: var(--r-lg); }
.fchip .cands { display: inline-flex; gap: 4px; }
.x21 { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); display: grid; place-items: center; cursor: pointer; }
.x21:hover { background: var(--red-50); color: var(--red); }
.x21 .ico { width: 16px; height: 16px; }

/* ---- therapy column ---- */
.therapy { display: grid; gap: var(--sp-3); }
.therapy .entry-h { margin-bottom: 0; }
.tx-empty { padding: var(--sp-6); border: 1.5px dashed var(--line-2); border-radius: var(--radius); color: var(--ink-2); display: grid; gap: 4px; text-align: center; }
.txcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--sp-4); }
.txcard header { display: flex; justify-content: space-between; gap: var(--sp-3); align-items: flex-start; margin-bottom: var(--sp-3); }
.txcard h3 { margin: 0; font-size: var(--fs-lg); }
.txcard .teeth { display: flex; gap: 4px; flex: none; }
.txcard .tno { font-size: var(--fs-xs); font-weight: var(--fw-bold); padding: 2px 6px; border-radius: var(--r-xs); background: var(--neutral-50); color: var(--ink-2); }
.txlist { display: grid; gap: 6px; }
.txc { border: 1.5px solid var(--line); border-radius: var(--r-lg); background: var(--card); }
.txc.on { border-color: var(--accent); background: var(--accent-50); }
.txc.offered { border-style: dashed; border-color: var(--opt-g); }
.txc-main { width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: var(--sp-3); align-items: center; padding: 10px var(--sp-3); min-height: 56px; border: 0; background: transparent; text-align: left; cursor: pointer; font: inherit; color: var(--ink); border-radius: var(--r-lg); }
.txc-main .rd { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--field-border); flex: none; }
.txc.on .rd { border: 6px solid var(--primary-fill); }
.txc-t b { display: block; }
.txc-t small { display: block; font-size: var(--fs-xs); color: var(--ink-2); }
.txc-a { display: grid; justify-items: end; gap: 2px; }
.txc-a .own { font-size: var(--fs-sm); font-weight: var(--fw-semi); font-variant-numeric: tabular-nums; white-space: nowrap; }
.offer { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 8px 44px; min-height: 32px; padding: 0 10px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--accent-text); font: inherit; font-size: var(--fs-xs); font-weight: var(--fw-semi); cursor: pointer; position: relative; }
.offer::after { content: ""; position: absolute; inset: -6px 0; } /* 44 px hit area */
.offer .ico { width: 14px; height: 14px; }
.offer[aria-pressed="true"] { background: var(--blue-50); color: var(--info-ink); }
.mat { position: relative; display: flex; align-items: center; gap: var(--sp-2); padding: 0 var(--sp-3) var(--sp-3) 44px; }
.mat-b { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border: 1px solid var(--field-border); border-radius: var(--r-md); background: var(--field-bg); color: var(--ink); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.mat-b .ico { width: 16px; height: 16px; }
.mat-b .pr { font-size: 11px; font-weight: var(--fw-semi); color: var(--accent-text); }
.lb { position: absolute; z-index: var(--z-pop); top: 100%; left: 44px; list-style: none; margin: 0; padding: 4px; min-width: 240px; background: var(--raised); border: 1px solid var(--line-2); border-radius: var(--r-md); box-shadow: var(--shadow-lg); }
.lb li { padding: 10px 12px; border-radius: var(--r-sm); cursor: pointer; font-size: var(--fs-sm); min-height: 40px; }
.lb li:hover, .lb li[aria-selected="true"] { background: var(--accent-50); color: var(--accent-text); }
.why-def { margin: var(--sp-2) 0 0; font-size: var(--fs-xs); color: var(--ink-3); }

/* ---- the one Fall bar (replaces actionbar + nextbar + override row + cfg-bar) ---- */
.flowbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-actionbar); padding: var(--sp-3) var(--gutter) calc(var(--sp-3) + env(safe-area-inset-bottom)); background: var(--glass); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.flowbar .inner { max-width: var(--content-max); margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.flowbar .info { min-width: 0; display: grid; }
.flowbar .info b { font-size: 16px; font-variant-numeric: tabular-nums; }
.flowbar .info span { font-size: var(--fs-sm); color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.flowbar .acts { display: flex; gap: var(--sp-2); flex: none; }
.entry-h .grow { flex: 1; }
.entry-h > .btn { align-self: center; }
.why-def.none { color: var(--warn-ink); font-weight: var(--fw-semi); }
.txcard .alert { margin: var(--sp-2) 0 0; }
.offer[disabled] { color: var(--ink-3); cursor: not-allowed; }
.txc-main[disabled] { cursor: default; }
.txc-a .tag { justify-self: end; }
.p21-checks .checks { margin-top: var(--sp-2); }
.therapy .kf-codes { margin-top: 0; }
.therapy .estimate-note { margin: 0; }
.p21 .qe-wrap { margin-bottom: 0; }
.p21 .chart-box .chart-wrap { margin-top: var(--sp-3); }
.chart21 [data-tooth].pop { animation: p21pop .25s ease-out; }
@keyframes p21pop { from { transform: scale(1.12); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .chart21 [data-tooth].pop { animation: none; } }
body.kb-open .flowbar { display: none; }

/* ---- responsive ---- */
@media (max-width: 1080px) {
  .plan { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .fhead-side { width: 100%; }
  .stages { flex: 1; overflow-x: auto; }
  .stages li { padding-right: 8px; }
  .stages li:not(.cur) span { display: none; }   /* phone: only the current stage keeps its label */
}
@media (max-width: 600px) {
  .p21 { padding-bottom: 180px; }
  .fhead h1 { font-size: 22px; }
  .p21 .card.entry { padding: var(--sp-4); }
  .entry-h .tiny { display: none; }
  .p21 .qe-hint { display: none; }
  .txcard { padding: var(--sp-3); }
  .txc-main { grid-template-columns: auto 1fr; }
  .txc-a { grid-column: 2; justify-items: start; grid-auto-flow: column; justify-content: start; gap: var(--sp-2); }
  .mat { padding-left: var(--sp-3); flex-wrap: wrap; }
  .lb { left: var(--sp-3); }
  .offer { margin-left: var(--sp-3); }
  .flowbar .inner { flex-direction: column; align-items: stretch; gap: var(--sp-2); }
  .flowbar .acts { flex-direction: column-reverse; }
  .flowbar .acts .btn { width: 100%; }
  /* the stacked flow bar is taller than the toast offset: toasts go to the top so they never cover "Zur Unterschrift" (N6) */
  body:has(.flowbar) .toasts { bottom: auto; top: calc(var(--sp-3) + env(safe-area-inset-top)); }
  body:has(.flowbar) .toast-item { animation-name: toastDown; }
}
.sheet .billing { justify-items: start; margin-top: var(--sp-2); }
.sheet .billing .note, .sheet .billing .bl-tags { justify-content: flex-start; }
.fact:disabled { cursor: default; }
@media (max-width: 600px) { .p21 .arm-hint { display: none; } .p21 .crumb { font-size: var(--fs-xs); } }
