/* ===== Zapf FinanzManagement – Finanz-Assistent ===== */
/* Farben: Anthrazit #33312e / #2b2a26, Bordeaux #9c2b28 / #7d1f1d / #e0a09d */

.zc-launch {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 99998;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 20px 13px 17px;
  border: 0;
  border-radius: 999px;
  background: #9c2b28;
  color: #fff !important;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(43, 42, 38, 0.32);
  transition: transform 0.18s ease, background 0.18s ease;
}
.zc-launch:hover { background: #7d1f1d; transform: translateY(-2px); }
.zc-launch:focus-visible { outline: 3px solid #33312e; outline-offset: 3px; }
.zc-launch svg { width: 22px; height: 22px; stroke: #fff !important; }
.zc-launch[hidden] { display: none; }

.zc-panel {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 99999;
  width: 396px;
  max-width: calc(100vw - 24px);
  height: 620px;
  max-height: calc(100vh - 40px);
  display: none;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(43, 42, 38, 0.34);
  font-family: inherit;
  color: #2b2a26;
}
.zc-panel.zc-open { display: flex; animation: zc-in 0.22s ease-out; }
@keyframes zc-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* Kopfzeile */
.zc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 14px 16px 18px;
  background: #33312e;
  color: #fff;
}
.zc-head .zc-mark {
  flex: none;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: #9c2b28;
}
.zc-head .zc-mark svg { width: 21px; height: 21px; stroke: #fff !important; }
.zc-head-txt { flex: 1; min-width: 0; line-height: 1.3; }
.zc-head-txt strong { display: block; font-size: 0.98rem; color: #fff; }
.zc-head-txt span { font-size: 0.78rem; color: #e0a09d; }
.zc-close {
  flex: none;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 0; border-radius: 8px;
  background: transparent;
  color: #fff !important;
  cursor: pointer;
}
.zc-close:hover { background: rgba(255,255,255,0.12); }
.zc-close svg { width: 18px; height: 18px; stroke: #fff !important; }

/* Verlauf */
.zc-log {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px 8px;
  background: #faf9f8;
  scroll-behavior: smooth;
}
.zc-msg { margin-bottom: 14px; display: flex; }
.zc-msg.zc-user { justify-content: flex-end; }
.zc-bubble {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.6;
  background: #fff;
  border: 1px solid #e8e4e0;
  border-left: 3px solid #9c2b28;
}
.zc-user .zc-bubble {
  background: #33312e;
  color: #fff;
  border: 0;
  border-radius: 12px;
}
.zc-bubble p { margin: 0 0 9px; }
.zc-bubble p:last-child { margin-bottom: 0; }
.zc-bubble strong { color: #7d1f1d; }
.zc-user .zc-bubble strong { color: #fff; }
.zc-bubble ul { margin: 6px 0 10px; padding-left: 18px; }
.zc-bubble li { margin-bottom: 4px; }
.zc-bubble b.zc-h {
  display: block;
  margin: 12px 0 5px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #33312e;
}
.zc-tip {
  margin: 10px 0 4px;
  padding: 10px 12px;
  background: #f5efee;
  border-left: 3px solid #9c2b28;
  border-radius: 0 6px 6px 0;
  font-size: 0.84rem;
}
.zc-bubble a {
  color: #7d1f1d;
  font-weight: 700;
  text-decoration: underline;
}
.zc-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  padding: 9px 15px;
  border-radius: 7px;
  background: #9c2b28;
  color: #fff !important;
  font-size: 0.83rem;
  font-weight: 700;
  text-decoration: none !important;
}
.zc-cta:hover { background: #7d1f1d; }
.zc-cta svg { width: 15px; height: 15px; stroke: #fff !important; }

/* Vorschläge */
.zc-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 2px 0 16px; }
.zc-chip {
  padding: 7px 13px;
  border: 1px solid #d9d3ce;
  border-radius: 999px;
  background: #fff;
  color: #33312e;
  font-family: inherit;
  font-size: 0.8rem;
  line-height: 1.3;
  cursor: pointer;
  text-align: left;
}
.zc-chip:hover { border-color: #9c2b28; color: #7d1f1d; }
.zc-chip:focus-visible { outline: 2px solid #9c2b28; outline-offset: 2px; }

/* Rechner im Chat */
.zc-calc { margin-top: 12px; padding: 12px; background: #f4f2f0; border-radius: 9px; }
.zc-calc label { display: block; font-size: 0.76rem; font-weight: 700; color: #33312e; margin: 0 0 3px; }
.zc-calc-row { display: flex; gap: 8px; margin-bottom: 9px; }
.zc-calc-row > div { flex: 1; }
.zc-calc input {
  width: 100%;
  padding: 8px 9px;
  border: 1px solid #d9d3ce;
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  color: #2b2a26;
  box-sizing: border-box;
}
.zc-calc input:focus { outline: 2px solid #9c2b28; outline-offset: -1px; }
.zc-calc button {
  width: 100%;
  padding: 9px;
  border: 0; border-radius: 6px;
  background: #33312e;
  color: #fff !important;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}
.zc-calc button:hover { background: #2b2a26; }
.zc-calc-out { margin-top: 10px; font-size: 0.85rem; line-height: 1.7; }
.zc-calc-out b { color: #7d1f1d; }


/* Tabelle im Chat */
.zc-bubble .zc-tab {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 12px;
  font-size: 0.84rem;
}
.zc-bubble .zc-tab td {
  padding: 5px 8px;
  border-bottom: 1px solid #ece8e4;
}
.zc-bubble .zc-tab td:last-child {
  text-align: right;
  font-weight: 700;
  color: #7d1f1d;
  white-space: nowrap;
}
.zc-bubble .zc-tab tr:last-child td { border-bottom: 0; }

/* Auswahlfeld im Rechner */
.zc-calc select {
  width: 100%;
  padding: 8px 9px;
  border: 1px solid #d9d3ce;
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  color: #2b2a26;
  box-sizing: border-box;
}
.zc-calc select:focus { outline: 2px solid #9c2b28; outline-offset: -1px; }

/* Eingabe */
.zc-form {
  display: flex;
  gap: 8px;
  padding: 12px 14px 6px;
  border-top: 1px solid #e8e4e0;
  background: #fff;
}
.zc-input {
  flex: 1;
  padding: 11px 13px;
  border: 1px solid #d9d3ce;
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.88rem;
  color: #2b2a26;
  resize: none;
  max-height: 96px;
  line-height: 1.45;
}
.zc-input:focus { outline: 2px solid #9c2b28; outline-offset: -1px; }
.zc-send {
  flex: none;
  width: 44px;
  border: 0; border-radius: 9px;
  background: #9c2b28;
  color: #fff !important;
  cursor: pointer;
  display: grid; place-items: center;
}
.zc-send:hover { background: #7d1f1d; }
.zc-send svg { width: 19px; height: 19px; stroke: #fff !important; }
.zc-note {
  padding: 0 14px 12px;
  background: #fff;
  font-size: 0.7rem;
  line-height: 1.5;
  color: #7a736d;
}
.zc-note a { color: #7a736d; }

/* Schreibpunkte */
.zc-dots span {
  display: inline-block;
  width: 6px; height: 6px;
  margin-right: 4px;
  border-radius: 50%;
  background: #9c2b28;
  animation: zc-blink 1.1s infinite;
}
.zc-dots span:nth-child(2) { animation-delay: 0.18s; }
.zc-dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes zc-blink { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; } }

@media (max-width: 700px) {
  /* Vollbild und an der echten Sichtflaeche ausgerichtet.
     100dvh beruecksichtigt die ein- und ausfahrende Browserleiste,
     sonst rutscht die Kopfzeile mit dem Schliessen-Knopf nach oben aus dem Bild. */
  .zc-panel {
    top: 0; right: 0; bottom: 0; left: 0;
    width: auto;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
  }
  /* Kopf- und Fusszeile aus Notch und Gestenleiste heraushalten */
  .zc-head { padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
  .zc-note { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  /* groessere Tippflaeche zum Schliessen */
  .zc-close { width: 44px; height: 44px; }
  .zc-close svg { width: 22px; height: 22px; }
  /* Auf dem Handy nur der runde Knopf, sonst verdeckt er die Fusszeile */
  .zc-launch {
    right: 16px;
    bottom: 16px;
    width: 56px;
    height: 56px;
    padding: 0;
    gap: 0;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(43, 42, 38, 0.3);
  }
  .zc-launch span { display: none; }
  .zc-launch svg { width: 26px; height: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .zc-panel.zc-open { animation: none; }
  .zc-launch { transition: none; }
  .zc-dots span { animation: none; opacity: 0.6; }
  .zc-log { scroll-behavior: auto; }
}
