/* ==========================================================================
   Finanzassistent als Seitenpanel (js/mitteilungen.js): Mitteilungen abhaken oder löschen, Fragen stellen.
   Farben nur über die Tokens aus css/app.css.
   ========================================================================== */
.ma-drawer .modal-body { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
/* Fenster des Finanzassistenten: größer als ein normaler Dialog, feste Höhe, der Inhalt scrollt */
.modal.ma-fenster { width: min(760px, 100%); height: min(82vh, 820px); }
.ma-seg { align-self: flex-start; margin-bottom: 4px; }
.ma-gruppe { margin: 8px 2px 0; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3); }
.ma-liste { display: flex; flex-direction: column; }
.ma-zeile { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid var(--line); }
.ma-zeile:last-child { border-bottom: 0; }
.ma-ziel { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 10px; padding: 10px 6px; border-radius: var(--r-mittel); color: var(--ink); text-decoration: none; }
.ma-ziel:hover { background: var(--hover); }
.ma-ziel:focus-visible { outline: none; box-shadow: var(--ring); }
.ma-ziel .status-dot { margin-top: 6px; flex: none; }
.ma-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ma-text b { font-weight: 560; font-size: 14px; line-height: 1.35; }
.ma-knoepfe { display: flex; gap: 2px; flex: none; }
.ma-fuss { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.ma-leer { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 32px 12px; text-align: center; }

/* Fragen */
.ma-frage-form { position: relative; }
.ma-frage-form .input { padding-left: 36px; }
.ma-frage-form .ml-lupe { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); display: grid; }
.ma-fragen { display: flex; flex-direction: column; }
.ma-frage { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 12px 6px; border: 0; border-bottom: 1px solid var(--line);
  background: none; color: var(--ink); font: inherit; font-size: 14px; font-weight: 550; text-align: left; cursor: pointer; border-radius: 0; }
.ma-frage:hover { color: var(--accent-text); }
.ma-frage:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-klein); }
.ma-frage svg { flex: none; color: var(--ink-3); }
.ma-antwort { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 10px 0 6px; padding: 14px; border-radius: var(--r-mittel); background: var(--inset); }
.ma-antwort .prose { margin: 0; font-size: 13.5px; }
.ma-wert { font-family: var(--font-display); font-size: 24px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ma-hinweis { margin: 4px 2px 8px; }

/* Beispiel in der Tour */
.tb-karte.ma { padding: 8px 12px; }

/* gleiche Mitteilung bei mehreren Immobilien: eine Zeile mit Anzahl, aufklappbar */
.ma-buendel { border-bottom: 1px solid var(--line); }
.ma-buendel:last-child { border-bottom: 0; }
.ma-buendel > .ma-zeile { border-bottom: 0; }
button.ma-ziel { border: 0; background: none; font: inherit; text-align: left; cursor: pointer; width: 100%; }
button.ma-ziel > svg { margin-left: auto; margin-top: 4px; flex: none; color: var(--ink-3); }
.ma-unter { padding: 0 0 6px 18px; }
.ma-unter .ma-zeile { border-bottom: 0; }
.ma-unter .ma-text b { font-weight: 500; font-size: 13.5px; }
.ma-mehr { align-self: flex-start; margin: 6px 0 0; }

/* ---------------- nasqo: Vorstellung, „Was kann ich?“, Gespräch ---------------- */
.modal.timmo-fenster { width: min(520px, 100%); }
.timmo-hallo { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 8px 0 4px; }
.timmo-figur { width: 88px; height: 88px; border-radius: var(--r-rund); background: var(--accent); display: grid; place-items: center; box-shadow: 0 10px 30px rgba(var(--accent-rgb), .35); flex: none; }
.timmo-figur.klein { width: 40px; height: 40px; box-shadow: none; }
.timmo-gesicht { position: relative; width: 46%; height: 34%; display: block; }
.timmo-gesicht i { position: absolute; top: 0; width: 18%; height: 42%; border-radius: var(--r-rund); background: var(--on-accent); }
.timmo-gesicht i:first-child { left: 16%; } .timmo-gesicht i:nth-child(2) { right: 16%; }
.timmo-gesicht b { position: absolute; left: 22%; right: 22%; bottom: 0; height: 30%; border: 0 solid var(--on-accent); border-bottom-width: 3px; border-radius: 0 0 var(--r-rund) var(--r-rund); }
.timmo-figur.klein .timmo-gesicht b { border-bottom-width: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .timmo-hallo .timmo-figur { animation: timmo-rein .7s var(--ease-feder) both, timmo-schweben 3.2s ease-in-out .8s infinite; }
  .timmo-hallo .timmo-gesicht i { animation: timmo-blinzeln 4s ease-in-out 1.2s infinite; transform-origin: center; }
  .timmo-blase { animation: timmo-blase var(--dauer-3) ease both; }
  .timmo-msg.neu { animation: timmo-blase var(--dauer-3) ease both; }
}
@keyframes timmo-rein { from { transform: translateY(18px) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes timmo-schweben { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
@keyframes timmo-blinzeln { 0%, 92%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }
@keyframes timmo-blase { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
.timmo-blasen { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.timmo-blase { margin: 0; padding: 10px 14px; border-radius: var(--r-gross) var(--r-gross) var(--r-gross) var(--r-klein); background: var(--inset); font-size: 15px; line-height: 1.45; min-height: 42px; }
.timmo-blase.warte { visibility: hidden; }
.timmo-blase.tippt::after { content: ''; display: inline-block; width: 2px; height: 1em; margin-left: 2px; vertical-align: -2px; background: var(--accent); }
.timmo-kann { display: flex; flex-direction: column; gap: 4px; }
.timmo-kann-zeile { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: var(--r-mittel); color: var(--ink); text-decoration: none; }
a.timmo-kann-zeile:hover { background: var(--inset); }
.timmo-kann-zeile .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
/* Gespräch auf der Seite Finanzassistent */
.timmo-chat { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.timmo-chat-kopf { display: flex; align-items: center; gap: 12px; }
.timmo-chat-kopf .h3 { margin: 0; }
.timmo-chat-kopf .sub { margin: 0; }
.timmo-verlauf { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; overscroll-behavior: contain; padding: 2px; }
.timmo-msg { max-width: min(560px, 85%); padding: 10px 14px; font-size: 14px; line-height: 1.45; }
.timmo-msg p { margin: 0; }
.timmo-msg.timmo { align-self: flex-start; background: var(--inset); border-radius: var(--r-gross) var(--r-gross) var(--r-gross) var(--r-klein); }
.timmo-msg.ich { align-self: flex-end; background: var(--ink); color: var(--page); border-radius: var(--r-gross) var(--r-gross) var(--r-klein) var(--r-gross); }
.timmo-wert { display: block; font-size: 18px; font-weight: 650; margin-bottom: 2px; font-variant-numeric: tabular-nums; }
.timmo-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; font-weight: 600; color: var(--accent-text); text-decoration: none; }
.timmo-eingabe { display: flex; gap: 8px; }
.timmo-eingabe .input { flex: 1; }
.timmo-eingabe .btn.icon-only { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: var(--r-rund); }
.timmo-denkt { color: var(--ink-3); } .timmo-ki { display: block; margin-top: 6px; font-size: 11.5px; }
/* Score oben im Panel (öffnet die Seite Hinweise & Score) */
.ma-score { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-mittel); background: var(--inset); color: var(--ink); text-decoration: none; }
.ma-score:hover { background: var(--sel-bg); }
.ma-score-ring { position: relative; width: 48px; height: 48px; flex: none; }
.ma-score-ring svg { width: 100%; height: 100%; }
.ma-score-ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 15px; }
.ma-score .ma-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
/* Umschalter und Textfeld oben im Panel (über Score und Hinweisen); kein Kartenrahmen, nur die Eingabezeile */
.ma-frage { flex: none; display: flex; flex-direction: column; gap: 10px; padding: 4px 20px 12px; border-bottom: 1px solid var(--line); background: var(--card); }
.ma-frage .ma-reiter { margin: 0; padding: 0; position: static; background: transparent; }
.ma-frage .ma-kompakt { padding: 0; border: 0; box-shadow: none; background: transparent; margin: 0; }
.ma-frage .ma-kompakt .tk-kopf { display: none; }
@media (max-width: 640px) { .ma-frage { padding-left: var(--rand); padding-right: var(--rand); } }
.ma-frage .ma-kompakt { display: block; width: 100%; }
.ma-frage .timmo-zeile { width: 100%; max-width: none; }

/* Nachrichten aus der Kopfleiste: dieselbe große Maske wie der Finanzassistent, etwas breiter für Liste und Unterhaltung */
.modal.msg-fenster { width: min(1080px, 100%); }
.msg-fenster .modal-body { overflow: hidden; }
.msg-maske, .msg-maske .msg-eingang { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.msg-maske .msg-layout { flex: 1; min-height: 0; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); }
.msg-maske .msg-layout > .card { overflow-y: auto; overscroll-behavior: contain; min-height: 0; margin: 0; }
.msg-zurueck { display: none; margin: -4px 0 8px -8px; }
@media (max-width: 860px) {
  .msg-maske .msg-layout { grid-template-columns: minmax(0, 1fr); }
  .msg-maske .msg-layout > .msg-detail { display: none; }
  .msg-maske .msg-layout.zeigt-detail > .msg-detail { display: block; }
  .msg-maske .msg-layout.zeigt-detail > .card:first-child { display: none; }
  .msg-maske .msg-zurueck { display: inline-flex; }
}
/* Handy: beide Masken (Finanzassistent und Nachrichten) vollflächig */
@media (max-width: 640px) {
  .modal.ma-fenster { width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .msg-fenster .modal-foot { flex-wrap: nowrap; }
}
