/* quik Sites: Feedback-Runden (docs/BAUPLAN.md Abschnitt 29). Ansicht für Kunde (Link) und Team (App):
   public/js/feedback-ansicht.js, dazu die Seite „Zusammenarbeit“ (public/js/zusammenarbeit.js, public/js/feedback.js).
   Regeln: docs/GESTALTUNG.md. Farben nur über Variablen aus app.css, Status nach Abschnitt 13 (ein Signal je Zeile,
   Erledigtes ruhig grau). Präfix fb- (Ansicht) und za- (Zusammenarbeit). */

/* ---------- Ansicht: Kopfleiste, Vorschau, Anmerkungen ---------- */
.fb { display: flex; flex-direction: column; height: 100vh; height: 100dvh; background: var(--bg); color: var(--ink); }
.fb-top { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 16px; background: var(--surface); border-bottom: 1px solid var(--line-soft); flex: none; }
.fb-top-l { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1 1 0; }
.fb-top-l .gast-top-t { flex: 0 1 auto; }
.fb-top-m { display: flex; align-items: center; gap: 8px; flex: none; }
.fb-acts { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: 1 1 0; min-width: 0; }
.fb-back { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: var(--fs-sm); font-weight: 550; padding: 6px 10px 6px 6px; border-radius: 99px; flex: none; }
.fb-back:hover { background: var(--hover); color: var(--fg); text-decoration: none; }
.fb-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.fb-title b { font-weight: 600; }
.fb-title span { font-size: var(--fs-xs); color: var(--ink-faint); }
.fb-pages { width: auto; max-width: 220px; min-width: 130px; }
.fb-mode.on { background: var(--fg); border-color: var(--fg); color: var(--on-fg); }
.fb-mode.on:hover { background: var(--fg-hover); }
.fb-mode[hidden] { display: none; }
.fb-kurz { display: none; }

.fb-main { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 384px; }
.fb-stage { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.fb-canvas { position: relative; margin: 0 auto; overflow: hidden; background: var(--paper); }
.fb-stage.is-mobile .fb-canvas { margin-top: 16px; border-radius: 22px 22px 0 0; box-shadow: 0 0 0 1px var(--line); }
.fb-frame { display: block; border: 0; background: var(--paper); transform-origin: 0 0; }
.fb-stage.is-mode .fb-canvas::after { content: ""; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 2px var(--accent); }
.fb-tip { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); display: none; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; background: var(--fg); color: var(--on-fg); font-size: var(--fs-sm); font-weight: 550; white-space: nowrap; box-shadow: var(--shadow-pop); pointer-events: none; }
.fb-stage.is-mode .fb-tip { display: inline-flex; }
.fb-wait { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; gap: 10px; background: var(--bg); color: var(--ink-soft); font-size: var(--fs-sm); }
.fb-stage.is-loading .fb-wait { display: flex; }
.fb-spin { width: 16px; height: 16px; border-radius: 99px; border: 2px solid var(--line-strong); border-top-color: transparent; animation: fb-dreh .8s linear infinite; }
@keyframes fb-dreh { to { transform: rotate(360deg); } }

.fb-side { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-left: 1px solid var(--line-soft); }
.fb-side-b { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; }
/* Nichts in der Spalte darf schrumpfen: sonst schiebt sich bei langer Liste der Filter über den Stand */
.fb-side-b > * { flex-shrink: 0; }
.fb-side-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 32px; }
.fb-side-h h2 { font-size: var(--fs-lg); }
.fb-note-box:empty, .fb-new-box:empty { display: none; }
.fb-sheet-btn { display: none; }
.fb-list { display: flex; flex-direction: column; gap: 8px; }
.fb-list > .empty { padding: 36px 12px; }

.fb-meta { display: block; font-size: var(--fs-xs); font-weight: 400; color: var(--ink-faint); line-height: 1.4; }
.fb-nr { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 99px; background: var(--fg); color: var(--on-fg); font-size: var(--fs-xs); font-weight: 600; font-variant-numeric: tabular-nums; }
.fb-nr.done { background: var(--surface-3); color: var(--ink-soft); }
.fb-nr.neu { background: var(--surface); color: var(--fg); box-shadow: inset 0 0 0 1.5px var(--fg); }
.fb-team { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-ink); font-size: var(--fs-2xs); font-weight: 550; vertical-align: 1px; }

.fb-p { border: 1px solid var(--line-soft); border-radius: 14px; background: var(--surface); transition: border-color .15s; }
.fb-p.on { border-color: var(--line-strong); }
.fb-p-h { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 12px 12px 6px; text-align: left; border-radius: 14px 14px 0 0; }
.fb-p-h b { font-weight: 600; font-size: var(--fs-sm); }
.fb-p-h:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.fb-text { padding: 0 12px 12px 46px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.fb-p.done .fb-text { color: var(--ink-soft); }
.fb-text > .fb-ta { margin-bottom: 8px; }
.fb-hint { margin: -4px 12px 10px 46px; font-size: var(--fs-xs); color: var(--ink-faint); overflow-wrap: anywhere; }
.fb-ants { display: flex; flex-direction: column; gap: 10px; margin: 0 12px 12px 46px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.fb-ant { display: flex; gap: 8px; align-items: flex-start; }
.fb-ant b { font-weight: 600; font-size: var(--fs-sm); }
.fb-ant .fb-meta { display: inline; margin-left: 6px; }
.fb-ant p { margin: 2px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.fb-av { width: 24px; height: 24px; font-size: 10px; }
.fb-ant:not(.team) .fb-av { background: var(--surface-2); color: var(--ink-soft); }
.fb-p-f { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 0 12px 10px 46px; }
.fb-p-f > .btn { margin-right: auto; }
.fb-p-f:empty { display: none; }
.fb-reply { margin: 0 12px 12px 46px; }
.fb-reply .fld, .fb-new .fld { margin: 8px 0 0; }
.fb-ta { resize: vertical; min-height: 64px; line-height: 1.5; }
.fb-as { margin: 8px 0 0; font-size: var(--fs-xs); color: var(--ink-faint); }
.fb-as .link-btn { font-size: inherit; }

.fb-new { padding: 12px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface); }
.fb-new-h { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.fb-new-h b { font-weight: 600; font-size: var(--fs-sm); display: block; }
.fb-new-f { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.fb-key { margin-right: auto; font-size: var(--fs-2xs); color: var(--ink-faint); }

.fb-intro { display: flex; flex-direction: column; gap: 12px; }
.fb-intro:empty { display: none; }
.fb-quote { margin: 0; padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); }
.fb-quote p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.fb-steps { margin: 0; padding: 0; list-style: none; counter-reset: fb; display: flex; flex-direction: column; gap: 8px; font-size: var(--fs-sm); color: var(--ink-soft); line-height: 1.5; }
.fb-steps li { counter-increment: fb; position: relative; padding-left: 30px; }
.fb-steps li::before { content: counter(fb); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 99px; background: var(--surface-2); color: var(--ink-soft); font-size: var(--fs-2xs); font-weight: 600; }
.fb-steps b { color: var(--fg); font-weight: 600; }
.fb-state { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; border-radius: var(--r); background: var(--surface-2); }
.fb-state-h { display: flex; align-items: center; gap: 10px; width: 100%; }
.fb-state-h b { font-weight: 600; display: block; }
.fb-state p { margin: 0; font-size: var(--fs-sm); color: var(--ink-soft); line-height: 1.5; }
.fb-state .gast-ct { width: 100%; padding-top: 10px; border-top: 1px solid var(--line-soft); }
/* schmale Spalte: E-Mail und Telefon gleich breit unter dem Namen */
.fb-state .gast-ct > .grow { flex: 1 1 calc(100% - 42px); }
.fb-state .gast-ct > .btn { flex: 1 1 auto; }
.fb-state .fb-quote { width: 100%; background: var(--surface); }
.fb-state .fb-quote p { margin: 0; font-size: var(--fs-base); color: var(--ink); }
.fb-seg > button { padding-inline: 10px; }
/* Team (public/js/feedback.js, Abschnitt 17): Schleife „1/3“ und Teile „1/4 frei“ rechts im Kasten, Einzelheiten im Blatt */
.fb-state-r { display: inline-flex; align-items: center; gap: 6px; flex: none; margin-left: auto; }
.fb-sl-k, .fb-teile-k { display: inline-flex; align-items: center; gap: 3px; height: 26px; padding: 0 9px; border-radius: 99px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-soft); color: var(--ink-soft); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; white-space: nowrap; cursor: help; }
.fb-sl-k { gap: 1px; }
.fb-sl-k b { font-weight: 650; color: var(--fg); }
.fb-teile-k { gap: 4px; cursor: pointer; font-weight: 550; }
.fb-teile-k:hover { color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-strong); }
.fb-sl-k:focus-visible, .fb-teile-k:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.pop .fb-teile { min-width: 260px; max-width: 340px; padding: 2px; border: 0; }
.pop .fb-teile ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.pop .fb-teile li { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); }
/* Status je Anmerkung (Team): Symbol mit Tooltip statt Wort-Pille */
.fb-st-ic { display: inline-flex; align-items: center; margin-left: 6px; vertical-align: -2px; color: var(--ink-faint); }
.fb-st-ic.is-rueckfrage { color: var(--orange-dot); }

/* Schmale Bildschirme: Anmerkungen als Blatt von unten, Kopfleiste in zwei Zeilen */
@media (max-width: 860px) {
  .fb-top { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .fb-top-l { flex: 1 1 0; gap: 6px; }
  .fb-top .fb-back { width: 40px; height: 40px; margin-left: -6px; padding: 0; justify-content: center; gap: 0; font-size: 0; }
  .fb-top .fb-back .ic { width: 18px; height: 18px; }
  .fb-top-l .gast-top-t { padding-left: 10px; }
  .fb-acts { flex: 0 0 auto; }
  .fb-acts .btn span { display: none; }
  .fb-acts .btn { padding-inline: .7em; min-height: 40px; min-width: 40px; justify-content: center; }
  /* Seite des Kunden: die Hauptaktion bleibt beschriftet, der Name der Marke weicht dem Titel */
  .fb-acts .btn span.fb-kurz { display: inline; }
  .fb-top .gast-logo b { display: none; }
  .fb-top-m { order: 3; flex: 1 1 100%; }
  .fb-pages { flex: 1; max-width: none; }
  .fb-dev { display: none; }
  .fb-main { grid-template-columns: minmax(0, 1fr); padding-bottom: 54px; }
  .fb-stage.is-mobile .fb-canvas { margin-top: 0; border-radius: 0; box-shadow: none; }
  .fb-tip { bottom: 14px; font-size: var(--fs-xs); }
  .fb-side { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; max-height: 82vh; max-height: 82dvh; border-left: 0; border-radius: 18px 18px 0 0; box-shadow: 0 -1px 0 var(--line-soft), 0 -18px 40px -22px rgba(var(--shadow-rgb), .35); transform: translateY(calc(100% - 54px)); transition: transform .22s var(--ease); }
  .fb-side.open { transform: none; }
  .fb-sheet-btn { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; height: 54px; padding: 8px 18px 0; flex: none; font-size: var(--fs-base); }
  .fb-sheet-btn b { font-weight: 600; }
  .fb-sheet-btn .ic { transition: transform .2s var(--ease); transform: rotate(180deg); color: var(--ink-faint); }
  .fb-side.open .fb-sheet-btn .ic { transform: none; }
  .fb-sheet-grip { position: absolute; left: 50%; top: 7px; width: 36px; height: 4px; margin-left: -18px; border-radius: 99px; background: var(--line-strong); }
  .fb-side-h h2 { display: none; }
  .fb-side-h { min-height: 0; }
  .fb-side-b { padding: 4px 14px 18px; }
  .fb-key { display: none; }
}
@media (prefers-reduced-motion: reduce) { .fb-side { transition: none; } .fb-spin { animation-duration: 2s; } }

/* ---------- Zusammenarbeit (Team): Runden und Dialoge ---------- */
.za-page .tabs { margin-bottom: 22px; }
.za-row { display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-radius: 10px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.za-row:last-child { border-bottom: 0; }
.za-row:hover { background: var(--hover); }
.za-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.za-row b { font-weight: 600; }
.za-row > .grow > b { display: block; }
.za-row .fb-meta { margin-top: 1px; }
.za-num { flex: none; min-width: 92px; text-align: right; font-size: var(--fs-sm); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.za-row.is-done b, .za-row.is-done .za-num { color: var(--ink-soft); font-weight: 500; }
.za-acts { display: flex; align-items: center; gap: 4px; flex: none; }
.za-link { display: flex; flex-direction: column; gap: 8px; }
.za-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.za-chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 11px; border-radius: 99px; background: var(--surface-2); font-size: var(--fs-sm); max-width: 100%; }
.za-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.za-chip button { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 99px; color: var(--ink-faint); flex: none; }
.za-chip button:hover { background: var(--surface-3); color: var(--fg); }
.za-sent { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 8px 0 4px; }
.za-sent b { font-size: var(--fs-lg); font-weight: 600; }
.za-sent p { margin: 0; color: var(--ink-soft); max-width: 44ch; }
.za-sent .copy-row { width: 100%; }
/* Handy: Symbol, Text und Menü in einer Zeile; der Zähler steht darunter, bündig mit dem Text */
@media (max-width: 640px) {
  .za-row { flex-wrap: wrap; row-gap: 4px; align-items: flex-start; }
  .za-row > .grow { flex: 1 1 0; min-width: 0; }
  .za-row > .za-acts { order: 2; }
  .za-row > .za-num { order: 3; flex: 1 1 100%; min-width: 0; padding-left: 46px; text-align: left; }
  .za-row > .za-num:empty { display: none; }
  .za-row .fb-meta { overflow-wrap: anywhere; }
  .za-row > .grow > b { display: block; white-space: normal; overflow-wrap: anywhere; }
}
