/* SwissHuman – Helfer:innen-App (v2)
   Nur Seitenstile. Tokens & Bausteine kommen aus /shared.css (Leitfaden: docs/DESIGN.md).
   Regeln: nur Token-Farben (var(--…)), keine Hex-Werte; hell & dunkel über die Tokens. */

:root {
  --z-detail: 39;
}

/* ---------- Hilfsklassen ---------- */
.skip-link { position: absolute; left: 8px; top: -80px; z-index: 100; padding: 8px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); }
.skip-link:focus { top: 8px; }
.grow { flex: 1 1 auto; }
.min0 { min-width: 0; }
.block { display: block; }
.center { justify-content: center; }
.mt-s { margin-top: 6px; }
.mt-m { margin-top: 12px; }
.mb-m { margin-bottom: 12px; }
.with-icon { display: inline-flex; align-items: center; gap: 6px; }
.with-icon .icon { color: var(--text-muted); }
.field-error { margin: 6px 0 0; font-size: var(--fs-sm); font-weight: 550; color: var(--danger); }
.field-error.warn { color: var(--warn); }
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.input-short { max-width: 180px; }
.only-desktop { display: none; }
@media (min-width: 901px) {
  .only-mobile { display: none; }
  .only-desktop { display: inline-flex; }
}
.btn .icon, .chip .icon, .pill .icon { flex: none; }
.btn .icon { margin-left: -2px; }
.icon-btn .icon { margin: 0; }
.stars.rating { display: inline-flex; gap: 1px; vertical-align: -2px; }
.stars.rating .icon { fill: currentColor; }
.due-soon { color: var(--warn); }
.due-over { color: var(--danger); }

/* Initialen per ::before – visuell wie Text, aber nicht kopier- oder vorlesbar */
.avatar[data-initials]::before { content: attr(data-initials); }

/* ---------- Boot & Laden ---------- */
.boot { min-height: 100dvh; display: grid; place-items: center; align-content: center; gap: 18px; }
.boot-logo { border-radius: 11px; }
.loading-block { padding: 4px 0; }

/* ---------- Anmeldung ---------- */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 40px 16px; }
.auth-card { width: min(440px, 100%); display: flex; flex-direction: column; gap: 20px; }
.auth-brand { align-self: flex-start; }
.auth-title { font-size: clamp(26px, 6vw, 32px); line-height: 1.12; letter-spacing: -0.03em; margin: 0 0 8px; }
.auth-lead { margin: 0; color: var(--text-muted); font-size: var(--fs-md); line-height: 1.5; }
.demo .card-header h2 { font-size: var(--fs); }
.demo-list { display: flex; flex-direction: column; }
.demo-row {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 18px; text-align: left; cursor: pointer;
  background: none; border: none; border-top: 1px solid var(--border); color: var(--text);
  transition: background 0.12s;
}
.demo-row:first-child { border-top: none; }
.demo-row:last-child { border-radius: 0 0 var(--radius) var(--radius); }
.demo-row:hover { background: var(--surface-2); }
.demo-row:disabled { cursor: progress; opacity: 0.6; }
.demo-name { font-weight: 600; }

/* ---------- Onboarding ---------- */
.onboarding-page .topbar .brand-sub { display: inline; }
.onboard { max-width: 680px; margin: 0 auto; padding: 28px 16px 64px; }
.onboard .page-header h1 { font-size: var(--fs-xl); }

/* ---------- App-Gerüst ---------- */
body.has-shell .topbar { padding: 0 20px; }
.topbar-brand { display: none; }
.live { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }
.bell { position: relative; }
.bell-count {
  position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 99px; background: var(--accent); color: var(--accent-ink);
  font-size: 10.5px; font-weight: 700; line-height: 16px; text-align: center; box-shadow: 0 0 0 2px var(--surface);
}
.sidebar .brand { flex-wrap: wrap; row-gap: 0; }
.sidebar .brand-sub { flex-basis: 100%; margin-top: -2px; padding-left: 38px; border-left: none; font-size: var(--fs-xs); }
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-icon { position: relative; display: inline-flex; }
.nav-dot {
  position: absolute; top: -5px; right: -11px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 99px; background: var(--surface-3); color: var(--text); font-size: 10.5px; font-weight: 700; line-height: 16px; text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}
.nav-dot.hot { background: var(--accent); color: var(--accent-ink); }
.bottom-nav .nav-item { position: relative; min-height: 50px; }
.bottom-nav .nav-item.active { background: none; }
.side-user {
  display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm);
  color: var(--text); text-decoration: none; transition: background 0.12s;
}
.side-user:hover { background: var(--surface-2); text-decoration: none; }
.side-user-name { display: block; font-weight: 600; font-size: var(--fs-sm); }
.side-user-state { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--text-muted); }
.side-user-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-faint); }
.side-user-state.is-on::before { background: var(--ok); }
.side-user-state.is-off::before { background: var(--warn); }

@media (max-width: 900px) {
  body.has-shell .topbar { padding: 0 12px 0 16px; }
  .topbar-brand { display: inline-flex; }
}
@media (max-width: 420px) {
  .topbar .brand-sub, .live-label { display: none; }
}

/* ---------- Inhalt & Zwei-Spalten-Layout ---------- */
.h-content { max-width: 1320px; }
.view { max-width: 760px; margin: 0 auto; }
.view:focus { outline: none; }
.page-header h1 { font-size: var(--fs-xl); }
.page-header .sub { max-width: 60ch; }
.list { display: flex; flex-direction: column; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* ---------- Auftragsdetail ----------
   < 901 px: Vollbild. Ab 901 px deckt es den Hauptbereich neben der Sidebar ab.
   Im Detail: < 840 px Panelbreite Tabs (Übersicht · KI · Details · Verlauf),
   ab 840 px KI als eigene rechte Spalte; beide Spalten scrollen unabhängig. */
.pane-detail { display: none; container: detail / inline-size; }
.detail-backdrop { display: none !important; }
body.detail-open { overflow: hidden; }
body.detail-open .pane-detail {
  position: fixed; inset: 0; z-index: var(--z-detail);
  display: flex; flex-direction: column; background: var(--bg);
  animation: slidein 0.22s var(--ease);
}
@media (min-width: 901px) {
  body.detail-open .pane-detail { left: var(--sidebar-w); border-left: 1px solid var(--border); }
}
.detail-empty { min-height: 100%; display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 32px; }
.detail-empty .focus { margin: 0; }

.detail-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
.detail-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.dtabs {
  flex: none; display: flex; gap: 2px; padding: 0 10px; overflow-x: auto; scrollbar-width: none;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.dtabs::-webkit-scrollbar { display: none; }
.dtab {
  position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px; margin-bottom: -1px;
  border: none; border-bottom: 2px solid transparent; background: none; color: var(--text-muted);
  font-size: var(--fs); font-weight: 550; white-space: nowrap; cursor: pointer;
}
.dtab:hover { color: var(--text); }
.dtab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.dtab-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.detail-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.d-panel { display: none; flex-direction: column; gap: 12px; max-width: 760px; margin: 0 auto; padding: 14px 14px 28px; }
.pane-detail[data-dtab="overview"] .d-panel[data-panel="overview"],
.pane-detail[data-dtab="details"] .d-panel[data-panel="details"],
.pane-detail[data-dtab="history"] .d-panel[data-panel="history"] { display: flex; }
.detail-side { display: none; flex-direction: column; min-width: 0; min-height: 0; background: var(--surface); }
/* KI-Tab (schmal): Chat füllt die Höhe, Liste & Aktionsleiste weg */
.pane-detail[data-dtab="ai"] .detail-body { grid-template-rows: auto minmax(0, 1fr); }
.pane-detail[data-dtab="ai"] .detail-scroll,
.pane-detail[data-dtab="ai"] .d-bar { display: none; }
.pane-detail[data-dtab="ai"] .detail-side { display: flex; }
@container detail (min-width: 840px) {
  .detail-body { grid-template-columns: minmax(0, 1fr) clamp(340px, 36cqi, 440px); grid-template-rows: minmax(0, 1fr) !important; }
  .detail-side { display: flex !important; border-left: 1px solid var(--border); }
  .dtab[data-tab="ai"] { display: none; }
  .pane-detail[data-dtab="ai"] .detail-scroll { display: block; }
  .pane-detail[data-dtab="ai"] .d-bar:not([hidden]) { display: grid; }
  .pane-detail[data-dtab="ai"] .d-panel[data-panel="overview"] { display: flex; }
  .d-panel { padding: 18px 20px 28px; }
}

/* Aktionsleiste (unten fixiert, im Detail-Hauptbereich) */
.d-bar {
  flex: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.7fr); gap: 4px; align-items: stretch;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
}
.d-bar[hidden] { display: none; }
.d-bar:has(> .bar-btn:only-child) { grid-template-columns: 1fr; }
.bar-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 48px; padding: 4px 2px;
  border: none; border-radius: var(--radius-sm); background: none; color: var(--text-muted);
  font-size: 11.5px; font-weight: 600; cursor: pointer; transition: background 0.12s, color 0.12s;
}
.bar-btn:hover { background: var(--surface-2); color: var(--text); }
.d-bar:has(> .bar-btn:only-child) .bar-btn { flex-direction: row; gap: 8px; font-size: var(--fs-sm); }
.bar-main { display: flex; min-width: 0; }
.bar-main .btn { flex: 1; min-height: 48px; padding: 0 10px; line-height: 1.15; white-space: normal; }
.bar-primary { display: none !important; }
.d-bar.show-primary .bar-primary { display: inline-flex !important; }
.d-bar.show-primary .bar-submit { display: none; }
@container detail (min-width: 840px) {
  .d-bar { padding: 8px 16px; }
  .bar-btn { flex-direction: row; gap: 7px; font-size: var(--fs-sm); }
}

/* ---------- «Jetzt dran» ---------- */
.focus {
  display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding: 14px 16px;
  color: inherit; text-decoration: none; transition: border-color 0.12s, box-shadow 0.12s;
}
.focus:hover { border-color: var(--border-strong); text-decoration: none; }
.focus-main { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.focus-label { color: var(--accent); }
.focus-step { font-size: var(--fs-md); font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.focus-meta { font-size: var(--fs-sm); color: var(--text-muted); }
.focus.compact .focus-step { font-size: var(--fs); }
.focus-arrow { color: var(--text-faint); }

/* ---------- Angebote ---------- */
.offer { position: relative; overflow: hidden; }
.offer-body { display: flex; flex-direction: column; gap: 12px; padding: 16px 18px; }
.offer-head { display: flex; align-items: flex-start; gap: 12px; }
.offer-svc { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: var(--fs-xs); font-weight: 500; color: var(--text-muted); }
.offer-title { margin-top: 2px; font-size: var(--fs-md); font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.offer-pay { flex: none; text-align: right; }
.pay-amount { display: block; font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.pay-label { display: block; font-size: var(--fs-xs); color: var(--text-faint); }
.offer-pay.internal .pay-amount { font-size: var(--fs-sm); font-weight: 650; color: var(--violet); }
.offer-meta { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: var(--fs-sm); }
.offer-meta li { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.offer-meta .icon { color: var(--text-faint); }
.offer-areas { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px; font-weight: 550; }
.offer-areas .arrow { display: inline-flex; color: var(--text-faint); }
.offer-kv { grid-template-columns: minmax(110px, 38%) 1fr; }
.offer-reqs { display: flex; flex-wrap: wrap; gap: 6px; }
.req {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px;
  background: var(--surface-2); border: 1px solid var(--border); font-size: var(--fs-xs); color: var(--text-muted);
}
.req .icon { color: var(--ok); }
.req.req-proof .icon { color: var(--text-muted); }
.playbook summary {
  display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted);
  cursor: pointer; list-style: none;
}
.playbook summary::-webkit-details-marker { display: none; }
.playbook summary:hover { color: var(--text); }
.playbook[open] .chev, .guard[open] .chev, .wa-how[open] .chev { transform: rotate(180deg); }
.chev { transition: transform 0.15s var(--ease); }
.playbook ol { margin: 8px 0 0; padding-left: 22px; font-size: var(--fs-sm); color: var(--text-muted); }
.playbook li { margin-bottom: 3px; }
.offer-foot { align-items: center; justify-content: flex-start; flex-wrap: wrap; }
.countdown { background: var(--surface); }
.countdown.urgent { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.offer.expired { opacity: 0.55; }
.offer-gone {
  position: absolute; inset: 0; display: none; place-items: center; align-content: center; grid-auto-flow: column; gap: 8px;
  background: color-mix(in srgb, var(--surface) 86%, transparent); color: var(--text-muted); font-weight: 650; border-radius: inherit;
}
.offer.gone .offer-gone { display: grid; }
@media (max-width: 480px) {
  .offer-body { padding: 14px 14px; }
  .offer-foot { display: grid; grid-template-columns: 1fr 1.5fr; padding: 12px 14px; }
  .offer-foot .countdown { grid-column: 1 / -1; justify-self: start; }
  .offer-foot .spacer { display: none; }
  .pay-amount { font-size: var(--fs-md); }
}

/* ---------- Pool ---------- */
.pool-sort { display: flex; gap: 6px; margin: 0 0 14px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.pool-sort::-webkit-scrollbar { display: none; }
.pool-sort .chip { flex: none; }
.pool-sort .chip .icon { color: var(--text-muted); }
.pool-sort .chip[aria-pressed="true"] .icon { color: inherit; }
.pool-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: -2px; }
.pill.reco { background: var(--info-soft); color: var(--info); border-color: transparent; }
.pill.reco.urgent { background: var(--danger-soft); color: var(--danger); }
.pool-card.is-recommended { border-color: color-mix(in srgb, var(--info) 35%, var(--border)); }
.offer-meta .effort { font-weight: 600; }
.offer-meta .effort .icon { color: var(--text-muted); }
.effort-note { display: flex; align-items: flex-start; gap: 7px; margin: 8px 0 0; font-size: var(--fs-sm); color: var(--text-muted); }
.effort-note .icon { margin-top: 2px; color: var(--violet); }
.pool-age { white-space: nowrap; }
.pool-card { transition: height 0.3s var(--ease), opacity 0.2s, margin 0.3s var(--ease), transform 0.3s var(--ease); }
.pool-card.leaving { height: 0 !important; opacity: 0; margin-bottom: -12px; transform: scale(0.98); border-width: 0; }
.pool-card.entering { animation: poolin 0.35s var(--ease); }
@keyframes poolin { from { opacity: 0; transform: translateY(-6px); } }
@media (max-width: 480px) {
  .pool-age { display: none; }
}

/* ---------- Meine Aufträge ---------- */
.seg-count { margin-left: 4px; font-size: var(--fs-xs); color: var(--text-faint); }
.segmented button { display: inline-flex; align-items: center; gap: 6px; }
.segmented button:disabled { opacity: 0.5; cursor: default; }
.task-list { overflow: hidden; }
.task-row {
  display: flex; gap: 12px; padding: 14px 16px; color: inherit; text-decoration: none;
  border-top: 1px solid var(--border); transition: background 0.12s;
}
.task-row:first-child { border-top: none; }
.task-row:hover { background: var(--surface-2); text-decoration: none; }
.task-main { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.task-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.task-title { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.task-top .badge { flex: none; }
.task-sub { display: flex; align-items: center; gap: 6px; margin-top: -2px; font-size: var(--fs-xs); color: var(--text-muted); }
.task-next { display: flex; align-items: flex-start; gap: 6px; font-size: var(--fs-sm); }
.task-next .icon { margin-top: 2px; color: var(--accent); }
.task-progress { display: flex; align-items: center; gap: 10px; }
.task-progress .progress { display: block; flex: 1; height: 4px; }
.task-progress .progress > span { display: block; }
.task-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: var(--fs-sm); color: var(--text-muted); }
.task-when { display: inline-flex; align-items: center; gap: 5px; }
.task-pay { color: var(--text); font-weight: 650; }
.task-row.is-done .task-title { color: var(--text-muted); }


/* ---------- Detail: Kopf ---------- */
.detail-head {
  position: relative; z-index: 3; flex: none; display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.detail-head > .svc-icon { margin-top: 4px; }
.d-head-main { display: flex; flex-direction: column; gap: 5px; padding-top: 3px; }
.d-title {
  margin: 0; font-size: var(--fs-md); font-weight: 650; line-height: 1.3; letter-spacing: -0.01em; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.d-title:focus { outline: none; }
@container detail (min-width: 600px) { .d-title { font-size: var(--fs-lg); } }
.d-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 6px; font-size: var(--fs-xs); color: var(--text-muted); }
.d-meta .sep { color: var(--text-faint); }
.d-meta .strong { color: var(--text); }
.d-meta .badge { font-size: 11px; line-height: 17px; padding: 0 7px 0 6px; }
/* Schmal: Service-Name steckt schon im Icon – Meta-Zeile bleibt kurz */
@container detail (max-width: 480px) {
  .d-meta .m-svc, .d-meta .m-svc + .sep { display: none; }
}
.menu-wrap { position: relative; flex: none; }
.dmenu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; min-width: 240px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.dmenu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px 10px;
  border: none; border-radius: var(--radius-sm); background: none; color: var(--text); font-size: var(--fs); text-align: left; cursor: pointer;
}
.dmenu-item:hover, .dmenu-item:focus-visible { background: var(--surface-2); }
.dmenu-item .icon { color: var(--text-muted); }
.dmenu-item.danger, .dmenu-item.danger .icon { color: var(--danger); }
.dmenu-sep { height: 1px; margin: 6px 4px; background: var(--border); }

/* Karten-Kopf mit Icon (ergänzt .card-header) */
.head-icon {
  display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border);
}

/* Callouts: Titel + Text */
.callout > div { min-width: 0; }
.callout strong { font-weight: 650; }
.callout .muted { margin-top: 2px; }
.callout .icon { color: var(--text-muted); }
.callout.info > .icon { color: var(--info); }
.callout.warn > .icon { color: var(--warn); }
.callout.ok > .icon { color: var(--ok); }
.callout.danger > .icon { color: var(--danger); }
.callout .stars { color: var(--warn); }
.callout-quote { margin-top: 8px; padding-left: 10px; border-left: 2px solid var(--border-strong); white-space: pre-wrap; overflow-wrap: anywhere; }
.callout > .btn { flex: none; align-self: center; }

/* ---------- Der nächste Schritt ---------- */
.hero { padding: 18px; border-color: color-mix(in srgb, var(--accent) 32%, var(--border)); }
.hero-top { display: flex; align-items: center; gap: 8px; }
.hero .eyebrow { color: var(--accent); }
.hero-step { margin: 8px 0 12px; font-size: 19px; font-weight: 650; line-height: 1.35; letter-spacing: -0.012em; overflow-wrap: anywhere; }
.hero-intro { margin: -4px 0 14px; font-size: var(--fs-sm); color: var(--text-muted); }
.hero .progress { margin-bottom: 16px; }
.hero.pop { animation: heropop 0.45s var(--ease); }
@keyframes heropop { 0% { transform: scale(0.985); } 60% { transform: scale(1.008); } 100% { transform: none; } }


/* Neu von der Kund:in (nur Ungelesenes) */
.new-input { position: relative; align-items: flex-start; padding-right: 40px; }
.ni-head { margin-bottom: 2px; }
.ni-body {
  font-size: var(--fs); color: var(--text); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
.ni-q { margin-top: 4px; font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ni-close { position: absolute; top: 6px; right: 6px; }
.link-btn {
  display: inline-flex; align-items: center; gap: 4px; min-height: 30px; margin-top: 4px; padding: 0;
  border: none; background: none; color: var(--info); font-size: var(--fs-sm); font-weight: 600; cursor: pointer;
}
.link-btn:hover { text-decoration: underline; text-underline-offset: 2px; }
.phase-note { display: flex; align-items: flex-start; gap: 8px; margin: -2px 0 0; padding: 0 4px; font-size: var(--fs-sm); color: var(--text-muted); }
.phase-note .icon { margin-top: 2px; color: var(--info); }
.phase-note.warn .icon { color: var(--warn); }
.phase-note strong { color: var(--text); }

/* Hero: Schritt-Segmente, Knöpfe, alle Schritte aufklappbar */
.step-segs { display: flex; gap: 4px; margin: 0 0 14px; }
.step-segs span { flex: 1; height: 5px; border-radius: 99px; background: var(--surface-3); }
.step-segs span.done { background: var(--ok); }
.step-segs span.current { background: var(--accent); }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.hero-actions .hero-btn { flex: 1 1 180px; }
.hero-help { flex: 0 1 auto; color: var(--text-muted); }
.steps-all { margin-top: 12px; padding-top: 4px; border-top: 1px solid var(--border); }
.steps-all summary {
  display: flex; align-items: center; gap: 7px; min-height: 40px; cursor: pointer; list-style: none;
  font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted);
}
.steps-all summary::-webkit-details-marker { display: none; }
.steps-all summary:hover { color: var(--text); }
.steps-all summary .chev { margin-left: auto; }
.steps-all[open] .chev, .c-context[open] .chev, .day-group[open] .chev { transform: rotate(180deg); }
.steps-all .stepper { padding: 2px 0 0; }

/* ---------- Checkliste als Stepper ---------- */
.stepper { list-style: none; margin: 0; padding: 8px 10px 10px; }
.stepper li { position: relative; }
.stepper li:not(:last-child)::before {
  content: ""; position: absolute; left: 21px; top: 36px; bottom: -6px; width: 2px; border-radius: 2px; background: var(--border);
}
.stepper li.done:not(:last-child)::before { background: color-mix(in srgb, var(--ok) 55%, var(--border)); }
.step { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 8px 8px; border-radius: var(--radius-sm); cursor: pointer; }
.step:hover { background: var(--surface-2); }
.step input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.step input:disabled ~ * { cursor: default; }
.step:has(input:disabled) { cursor: default; }
.step:has(input:disabled):hover { background: none; }
.step-dot {
  position: relative; z-index: 1; display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%;
  background: var(--surface); border: 1.5px solid var(--border-strong); color: var(--text-muted); font-size: var(--fs-xs); font-weight: 650;
  transition: background 0.15s, border-color 0.15s;
}
.step input:focus-visible + .step-dot { box-shadow: var(--ring); }
.stepper li.done .step-dot { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.stepper li.current .step-dot { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.step-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; padding-top: 3px; }
.step-text { overflow-wrap: anywhere; }
.stepper li.done .step-text { color: var(--text-muted); text-decoration: line-through; text-decoration-color: var(--text-faint); }
.stepper li.current .step-text { font-weight: 600; }
.step-meta { font-size: var(--fs-xs); color: var(--text-faint); }
.step-meta.now { color: var(--accent); font-weight: 600; }


/* ---------- Kontakt & Orte (kompakt) ---------- */
.contact-card { overflow: hidden; }
.c-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.c-row + .c-row { border-top: 1px solid var(--border); }
.c-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; background: var(--surface-2); color: var(--text-muted); }
.c-name { font-weight: 550; line-height: 1.3; overflow-wrap: anywhere; }
.c-sub { font-size: var(--fs-xs); color: var(--text-muted); }
.c-context { border-top: 1px solid var(--border); }
.c-context summary {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; cursor: pointer; list-style: none;
  font-size: var(--fs-sm); font-weight: 600;
}
.c-context summary::-webkit-details-marker { display: none; }
.c-context summary > .icon:first-child { color: var(--violet); }
.c-context summary .chev { margin-left: auto; color: var(--text-faint); }
.c-context-body { padding: 0 16px 14px 40px; font-size: var(--fs-sm); color: var(--text-muted); }
.key-card .card-body { padding: 14px 16px; }

/* ---------- Anforderungen & Nachweis ---------- */
.objective { margin: 0 0 10px; }
.req-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.req-list li { display: flex; align-items: flex-start; gap: 8px; }
.req-list .icon { margin-top: 2px; color: var(--ok); }
.evidence {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; padding: 12px 14px;
  border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); font-size: var(--fs-sm);
}
.evidence.missing { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 28%, transparent); }
.evidence-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: var(--radius-sm); background: var(--surface); color: var(--text-muted); border: 1px solid var(--border); }
.evidence.missing .evidence-icon { color: var(--warn); }
.evidence.ok .evidence-icon { color: var(--ok); }
.evidence > .grow { flex: 1 1 180px; }
.evidence-status { margin-top: 1px; color: var(--text-muted); }
.evidence.missing .evidence-status { color: var(--warn); font-weight: 600; }
.evidence.ok .evidence-status { color: var(--ok); }
.att-inline { display: flex; align-items: center; gap: 6px; }

.req-check { list-style: none; margin: 0; padding: 6px 0; }
.req-check li { display: flex; align-items: flex-start; gap: 10px; padding: 7px 18px; font-size: var(--fs-sm); }
.req-check .req-icon { margin-top: 2px; color: var(--text-faint); }
.req-evidence { align-items: center !important; margin-top: 4px; padding-top: 12px !important; border-top: 1px solid var(--border); }
.req-evidence.ok .req-icon { color: var(--ok); }
.req-evidence.open .req-icon { color: var(--warn); }
.req-state { display: block; margin-top: 2px; font-size: var(--fs-xs); color: var(--text-muted); }
.req-evidence.ok .req-state { color: var(--ok); font-weight: 600; }
.req-evidence.open .req-state { color: var(--warn); font-weight: 600; }


/* ---------- Leitplanken, Anhänge ---------- */
.guard summary {
  display: flex; align-items: center; gap: 10px; padding: 12px 18px; cursor: pointer; list-style: none;
}
.guard summary::-webkit-details-marker { display: none; }
.guard-title { font-weight: 650; font-size: var(--fs-md); }
.guard summary .chev { color: var(--text-faint); }
.guard ul { margin: 0; padding: 12px 18px 16px 40px; border-top: 1px solid var(--border); font-size: var(--fs-sm); }
.guard li { margin-bottom: 6px; }
.atts { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.att {
  display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 6px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.att:hover { border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.att img, .att-icon { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: var(--surface-2); color: var(--text-faint); }
.att-name { font-size: var(--fs-xs); color: var(--text-muted); }


/* ---------- Dateien ---------- */
.file-list { list-style: none; margin: 0; padding: 0; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--border); }
.file-row:first-child { border-top: none; }
.file-thumb {
  display: grid; place-items: center; width: 44px; height: 44px; flex: none; padding: 0; overflow: hidden; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-muted);
}
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-thumb .att-icon { width: auto; aspect-ratio: auto; background: none; }
.file-name { font-size: var(--fs-sm); font-weight: 550; }
.file-meta { font-size: var(--fs-xs); color: var(--text-muted); }
.files-empty { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
@container detail (max-width: 420px) { .hide-xs { display: none; } }

/* ---------- Verlauf nach Tagen ---------- */
.day-group summary { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 16px; cursor: pointer; list-style: none; }
.day-group summary::-webkit-details-marker { display: none; }
.day-group summary .chev { color: var(--text-faint); }
.day-label { font-weight: 650; }
.day-group > .card-body { padding-top: 14px; border-top: 1px solid var(--border); }

/* ---------- Verlauf ---------- */
.activity { list-style: none; margin: 0; padding: 0; }
.activity li { position: relative; display: flex; gap: 12px; padding-bottom: 16px; }
.activity li:last-child { padding-bottom: 0; }
.activity li:not(:last-child)::before { content: ""; position: absolute; left: 13.5px; top: 30px; bottom: 2px; width: 1px; background: var(--border); }
.act-icon {
  display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%;
  background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border);
}
li.tone-ok .act-icon { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
li.tone-info .act-icon { background: var(--info-soft); color: var(--info); border-color: transparent; }
li.tone-warn .act-icon { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
li.tone-violet .act-icon { background: var(--violet-soft); color: var(--violet); border-color: transparent; }
li.tone-danger .act-icon { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
li.tone-accent .act-icon { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.act-body { flex: 1; min-width: 0; padding-top: 4px; }
.act-title { font-size: var(--fs-sm); font-weight: 600; }
.act-time { margin-left: 8px; font-size: var(--fs-xs); font-weight: 400; color: var(--text-faint); }
.act-quote { margin-top: 2px; font-size: var(--fs-xs); color: var(--text-muted); }
.act-text { margin-top: 2px; font-size: var(--fs-sm); white-space: pre-wrap; overflow-wrap: anywhere; }
li.t-answer .act-text, li.t-client_message .act-text, li.t-nudge .act-text, li.t-rework .act-text {
  margin-top: 6px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border);
}
.act-open { margin-top: 6px; }

.danger-zone { padding: 4px 0; text-align: center; }
.danger-zone p { margin: 0 0 8px; }


/* ---------- Frag die KI (Chat-Panel mit fester Höhe) ---------- */
.assistant { display: flex; flex-direction: column; flex: 1; min-height: 0; background: var(--surface); }
.a-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.a-head h2 { font-size: var(--fs-md); }
.a-head .avatar.ai { width: 30px; height: 30px; border-radius: 9px; }
.a-log { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; overscroll-behavior: contain; padding: 16px; }
.a-empty { display: flex; align-items: flex-start; gap: 12px; }
.a-empty .avatar.ai { border-radius: 9px; }
.a-msg { display: flex; align-items: flex-end; gap: 8px; }
.a-msg.user { justify-content: flex-end; }
.a-msg .avatar.ai { width: 24px; height: 24px; border-radius: 7px; }
.a-bubble { max-width: 88%; padding: 9px 13px; border-radius: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.a-msg.ai .a-bubble { background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.a-msg.user .a-bubble { background: var(--ink); color: var(--ink-text); border-bottom-right-radius: 4px; white-space: pre-wrap; }
.a-msg.error .a-bubble { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.a-msg.typing .a-bubble { padding: 12px 14px; }
.a-foot { flex: none; border-top: 1px solid var(--border); background: var(--surface-2); padding-bottom: env(safe-area-inset-bottom); }
.a-suggest { display: flex; gap: 6px; padding: 10px 14px 0; overflow-x: auto; scrollbar-width: none; }
.a-suggest::-webkit-scrollbar { display: none; }
.a-suggest .chip { flex: none; padding: 5px 11px; font-size: var(--fs-xs); background: var(--surface); }
.a-suggest .chip .icon { color: var(--text-muted); }
.a-composer { display: flex; align-items: flex-end; gap: 8px; padding: 10px 14px 12px; }
.a-composer .textarea { min-height: 40px; resize: none; }
.a-composer .btn { flex: none; width: 40px; height: 40px; min-height: 40px; }
.a-note { margin: 0; padding: 0 16px 10px; }

/* ---------- Profil ---------- */
.profile-card { container-type: inline-size; }
.profile-head { display: flex; align-items: center; gap: 14px; }
.profile-head .avatar.lg { width: 52px; height: 52px; font-size: var(--fs-md); }
.ph-name { font-size: var(--fs-lg); }
.ph-email { overflow-wrap: anywhere; }
@container (max-width: 420px) {
  .profile-head .edit-btn { width: 36px; padding: 0; }
  .profile-head .edit-btn .btn-label { display: none; }
  .profile-head .edit-btn .icon { margin: 0; }
}
/* Kennzahlen: 2 × 2 schmal, 4 Spalten ab 560 px Kartenbreite – alle Kacheln gleich hoch */
.p-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 0 18px 18px; }
@container (min-width: 560px) { .p-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.p-stats .stat { display: flex; flex-direction: column; min-width: 0; padding: 12px 14px; background: var(--surface-2); box-shadow: none; }
.p-stats .stat-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-stats .stat-label .icon { color: var(--text-faint); }
.p-stats .stat-value { font-size: 22px; line-height: 1.2; }
.p-stats .stat-meta { margin-top: auto; padding-top: 2px; }
.switch-row { display: flex; align-items: center; gap: 14px; width: 100%; }
.switch-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.switch-text small { font-size: var(--fs-sm); }
.balance { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 4px; }
.balance-skel { display: block; width: 160px; height: 34px; }
.ledger { margin: 0; padding: 0; }
.ledger-row {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 11px 18px; border-top: 1px solid var(--border); font-size: var(--fs-sm);
}
.ledger-text { display: flex; flex-direction: column; min-width: 0; }
.ledger-reason { overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.ledger-date { font-size: var(--fs-xs); color: var(--text-muted); }
.ledger-row .amt { text-align: right; justify-self: end; }
.ledger-empty { margin: 0; padding: 0 18px 18px; }
.ledger-icon { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; }
.ledger-icon.plus { background: var(--ok-soft); color: var(--ok); }
.ledger-icon.minus { background: var(--danger-soft); color: var(--danger); }
.amt { font-weight: 650; white-space: nowrap; }
.amt.plus { color: var(--ok); }
.amt.minus { color: var(--danger); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip.static { cursor: default; }
.chip.static:hover { background: var(--surface); border-color: var(--border); }
.chip.static .icon { color: var(--text-muted); }
.theme-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.profile-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* Profil-Formular */
.profile-form .form-section { border-top: 1px solid var(--border); }
.profile-form .form-section:first-child { border-top: none; }
.form-section-title { margin: 0 0 14px; font-size: var(--fs-md); }
fieldset { min-width: 0; margin: 0 0 16px; padding: 0; border: 0; }
legend { padding: 0; }
input[type="range"] { width: 100%; height: 24px; margin: 0; accent-color: var(--accent); }
.range-scale { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--text-faint); }
.skill-group { margin-bottom: 12px; }
.skill-group-title { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }
.skill-group-title .icon { color: var(--text-faint); }
.chip.choice { position: relative; }
.chip.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.chip.choice:has(input:checked) { border-color: var(--ink); background: var(--ink); color: var(--ink-text); }
.chip.choice:has(input:focus-visible) { box-shadow: var(--ring); }
.counter { margin-top: 4px; font-size: var(--fs-xs); text-align: right; color: var(--text-faint); }

/* WhatsApp */
.wa-number { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.wa-number .icon { color: var(--text-muted); }
.wa-steps { margin: 0 0 14px; padding-left: 20px; font-size: var(--fs-sm); }
.wa-steps li { margin-bottom: 4px; }
.wa-code-box { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.wa-code-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.wa-code { font-family: var(--mono); font-size: 20px; font-weight: 700; letter-spacing: 0.08em; user-select: all; overflow-wrap: anywhere; }
.wa-wait { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.wa-wait .spinner { width: 14px; height: 14px; }
.wa-how { margin-top: 14px; font-size: var(--fs-sm); }
.wa-how summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 600; color: var(--text-muted); list-style: none; }
.wa-how summary::-webkit-details-marker { display: none; }
.wa-how summary:hover { color: var(--text); }
.wa-how ul { margin: 8px 0 0; padding-left: 20px; }
.wa-how li { margin-bottom: 4px; }

/* ---------- Benachrichtigungen ---------- */
.notif-drawer .drawer-head strong { font-size: var(--fs-md); }
.notif-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.notif {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 12px; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text);
  transition: background 0.12s, border-color 0.12s;
}
.notif:hover { background: var(--surface-2); }
.notif-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-muted); }
.notif.unread .notif-icon { background: var(--accent-soft); color: var(--accent); }
.notif-title { display: block; font-size: var(--fs-sm); font-weight: 600; overflow-wrap: anywhere; }
.notif-body { display: block; margin: 2px 0; font-size: var(--fs-sm); color: var(--text-muted); overflow-wrap: anywhere; }
.unread-dot { width: 8px; height: 8px; margin-top: 6px; flex: none; border-radius: 50%; background: var(--accent); }

/* ---------- Dialoge ---------- */
.modal .chips { margin: 4px 0 14px; }
.modal .callout { margin-bottom: 14px; }
.modal .field:last-of-type { margin-bottom: 4px; }
.reason-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.reason { justify-content: space-between; }
.lightbox-img { display: block; width: 100%; max-height: 68vh; object-fit: contain; border-radius: var(--radius-sm); background: var(--surface-2); margin-top: 10px; }
.issues { margin-top: 4px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--danger-soft); border: 1px solid color-mix(in srgb, var(--danger) 26%, transparent); font-size: var(--fs-sm); }
.issues-title { display: flex; align-items: center; gap: 6px; font-weight: 650; margin-bottom: 4px; }
.issues ul { margin: 0 0 8px; padding-left: 20px; }

/* Schlüssel/Wert-Listen auf schmalen Screens untereinander */
@media (max-width: 480px) {
  .kv { grid-template-columns: 1fr; gap: 0; }
  .kv dt { font-size: var(--fs-xs); }
  .kv dd { margin-bottom: 10px; }
  .kv dd:last-child { margin-bottom: 0; }
}

/* ---------- Tap-Ziele auf Touch-Geräten (≥ 36 px, DESIGN.md) ---------- */
#d-back { flex: none; }
.playbook summary { padding: 6px 0; }
@media (max-width: 900px) {
  body.has-shell .btn-sm, body.has-shell .segmented button, body.has-shell .a-suggest .chip { min-height: 36px; }
  body.has-shell .segmented button { padding-top: 0; padding-bottom: 0; }
  .topbar-brand { min-height: 40px; }
  .playbook summary { padding: 9px 0; }
}

/* ---------- Bewegung reduzieren ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero.pop, body.detail-open .pane-detail, .pool-card.entering { animation: none; }
  .pool-card { transition: none; }
}
