/* Classy Confidence AI Portal — 1:1-Übernahme des Base44-Hub-Designs (2026-07-13).
   Referenz: design-referenz-base44/ (Screenshots + Live-HTML mit Inline-Styles).
   Fonts: Oswald (Headlines caps), Playfair Display (Agent-Namen, Akzente), Public Sans (Body). */

:root {
  --signal: #A30009;
  --signal-dark: #7D0007;
  --signal-light: #C41420;
  --black: #000000;
  --text: #333333;
  --gray: #555555;
  --warmgray: #5A4F4B;      /* warme Textfarbe (Sublines, Claim) */
  --softgray: #8A7B77;      /* Feedback-Pill, "mit Liebe" */
  --line: #E0E0E0;
  --line-warm: #C9BFBB;
  --cardline: #E8E8E8;
  --band: #F5F5F5;          /* Filter-Leiste */
  --creme: #F6F1EC;         /* Icon-Farbe auf Kategorie-Tiles */
  --star: #ED7D31;          /* Favoriten-Stern */
  --chat-bg: #D4C9C6;       /* Fläche hinter der Chat-Karte */
  --chat-page: #F3F0ED;
  --fs-head: 'Oswald', sans-serif;
  --fs-display: 'Playfair Display', serif;
  --fs-body: 'Public Sans', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--fs-body);
  color: var(--text);
  background: #FFFFFF;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
button { font: inherit; }

/* ---------- Topbar (Base44: weiß, 64px, Logo links, Name + Abmelden rechts) ---------- */

.topbar {
  background: #FFFFFF;
  border-bottom: 1px solid var(--line);
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar__logo { text-decoration: none; flex-shrink: 0; margin-right: auto; display: flex; }
.topbar__logo img { height: 36px; width: auto; display: block; }
.topbar__user { font-size: .85rem; color: var(--gray); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar__link {
  font-size: .82rem; color: var(--gray); text-decoration: none; margin-right: 1.25rem;
  border-bottom: 1px solid transparent; transition: .2s;
}
.topbar__link:hover { color: var(--signal); }
.topbar__lnk-kurz { display: none; }
@media (max-width: 640px) { .topbar__lnk-kurz { display: inline; } }
.topbar__logout {
  display: flex; align-items: center; gap: .4rem;
  background: none; border: 1px solid var(--line-warm); border-radius: 6px;
  padding: .4rem .9rem; cursor: pointer; font-size: .82rem; color: var(--text);
  text-decoration: none; transition: .2s; flex-shrink: 0; margin-left: 1.5rem;
}
.topbar__logout:hover { border-color: var(--signal); color: var(--signal); }
@media (max-width: 640px) {
  .topbar { padding: 0 1rem; }
  .topbar__logo img { height: 28px; }
  .topbar__user { max-width: 72px; }
  .topbar__logout { margin-left: .75rem; padding: .35rem .6rem; }
  .topbar__link { margin-right: .75rem; }
}

/* ---------- Hub-Hero (zentriert: Badge, Oswald-Headline, Playfair-Subline) ---------- */

.hub-hero { text-align: center; padding: 3rem 1.5rem 2.5rem; }
.hub-hero--small { padding-bottom: 1rem; }
.hub-hero__badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(163, 0, 9, .06);
  border-radius: 999px;
  padding: .5rem 1.4rem;
  margin-bottom: 1.4rem;
  color: var(--signal);
}
.hub-hero__badge span {
  font-size: .78rem; font-weight: 500; letter-spacing: .06em; text-transform: uppercase;
}
.hub-hero__title {
  font-family: var(--fs-head);
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 400;
  color: var(--black);
  margin: 0 0 .8rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.hub-hero__title span { color: var(--signal); }
.hub-hero__sub {
  font-family: var(--fs-display); font-style: italic;
  font-size: 1.1rem; color: var(--warmgray);
  margin: 0 auto 2rem; max-width: 520px; line-height: 1.7;
}
.hub-hero__actions { display: inline-flex; flex-direction: column; gap: .75rem; align-items: stretch; }

/* Tages-Buttons (weiße Karten, Icon schwarz, "Täglich nutzen" rot) */
.hub-daily { display: flex; gap: .75rem; justify-content: center; }
.hub-daily__card {
  display: flex; align-items: center; gap: .75rem;
  background: #FFFFFF; border: 1px solid var(--line); border-radius: 12px;
  padding: .75rem 1.25rem; box-shadow: rgba(0,0,0,.07) 0 2px 10px;
  transition: .2s; min-width: 200px; text-decoration: none; cursor: pointer;
}
.hub-daily__card:hover { transform: translateY(-2px); box-shadow: rgba(0,0,0,.12) 0 6px 18px; }
.hub-daily__icon { display: inline-flex; color: #1A1A1A; }
.hub-daily__icon svg { width: 24px; height: 24px; display: block; }
.hub-daily__text { text-align: left; display: flex; flex-direction: column; }
.hub-daily__name { font-family: var(--fs-head); font-size: .95rem; font-weight: 400; color: var(--black); letter-spacing: .03em; }
.hub-daily__sub { font-size: .75rem; color: var(--signal); font-weight: 500; }
@media (max-width: 640px) {
  .hub-daily { flex-direction: column; }
  .hub-daily__card { justify-content: center; }
}

/* lea.ai-Banner (roter Gradient) */
.hub-lea {
  display: flex; align-items: center; justify-content: center; gap: .75rem;
  background: linear-gradient(135deg, var(--signal-dark) 0%, var(--signal) 55%, var(--signal-light) 100%);
  border-radius: 14px; padding: 22px 24px;
  box-shadow: rgba(163, 0, 9, .3) 0 10px 30px;
  transition: .15s; text-decoration: none; cursor: pointer;
}
.hub-lea:hover { transform: translateY(-2px); box-shadow: rgba(163, 0, 9, .4) 0 14px 34px; }
.hub-lea__icon { display: inline-flex; color: #FFFFFF; }
.hub-lea__icon svg { width: 30px; height: 30px; display: block; }
.hub-lea__text { text-align: left; display: flex; flex-direction: column; }
.hub-lea__title {
  font-family: var(--fs-head); font-size: 1rem; font-weight: 700; color: #FFFFFF;
  letter-spacing: .5px; text-transform: uppercase;
}
.hub-lea__sub { font-size: .72rem; color: rgba(255,255,255,.85); }

/* ---------- Reise-Fortschritt (Variante D', 2026-07-23): Kapitel-Ringe + Momentum-Modus ----------
   Fluchtlinien-Regel: die Ring-Reihe sitzt IM .hub-hero__actions-Container (align-items:stretch)
   und spannt mit justify-content:space-between exakt von Banner-Außenkante zu Banner-Außenkante. */

.hub-progress { display: flex; flex-direction: column; gap: .75rem; }
.hub-progress__rings { display: flex; justify-content: space-between; gap: .5rem; padding-top: .25rem; }
.hub-ring { width: 76px; text-align: center; }
.hub-ring__svg { position: relative; display: block; width: 76px; height: 76px; margin: 0 auto; }
.hub-ring__svg svg { display: block; width: 100%; height: 100%; }
.hub-ring__pct {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--fs-head); font-size: .9rem; color: var(--black);
}
.hub-ring__pct--done { color: #3E7A4E; font-size: 1.15rem; }
.hub-ring__lbl { display: block; margin-top: .35rem; font-size: .69rem; color: var(--warmgray); line-height: 1.35; }
.hub-ring__lbl--done { color: #3E7A4E; font-weight: 600; }
.hub-ring__sub { color: #B9AFAA; font-size: .62rem; }
.hub-progress__nextwrap { text-align: center; }
.hub-progress__next {
  display: inline-flex; align-items: center; gap: .5rem;
  border: 1px solid var(--line); border-radius: 999px; background: #FFFFFF;
  padding: .45rem 1rem; font-size: .82rem; text-decoration: none;
  transition: .2s; cursor: pointer;
}
.hub-progress__next:hover { border-color: var(--signal); transform: translateY(-1px); box-shadow: rgba(0,0,0,.08) 0 4px 12px; }
.hub-progress__nextk {
  font-family: var(--fs-head); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--softgray);
}
.hub-progress__next b { color: var(--signal); font-weight: 600; }

/* 100%-Momentum-Modus: grünes Abzeichen + 3 Kacheln in Banner-Flucht */
.hub-progress__badge {
  align-self: center;
  display: inline-flex; align-items: center; gap: .5rem;
  background: #EAF3EC; color: #2E6B3E; border-radius: 999px;
  padding: .45rem 1.15rem; font-size: .82rem; font-weight: 600;
}
.hub-momentum { display: flex; gap: .75rem; }
.hub-momentum__card {
  flex: 1; min-width: 0;
  border: 1px solid var(--cardline); border-radius: 12px; background: #FFFFFF;
  padding: .75rem .9rem; text-align: left; text-decoration: none;
}
.hub-momentum__card--link { transition: .2s; cursor: pointer; }
.hub-momentum__card--link:hover { transform: translateY(-2px); box-shadow: rgba(0,0,0,.1) 0 6px 16px; }
.hub-momentum__k {
  display: block; font-family: var(--fs-head); font-size: .58rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--softgray); margin-bottom: .2rem;
}
.hub-momentum__v { display: block; font-family: var(--fs-display); font-size: .95rem; color: var(--black); }

@media (max-width: 640px) {
  /* 5 Ringe müssen bei 390px in die Karten-Breite passen: Ringe schrumpfen mit */
  .hub-progress__rings { gap: .35rem; }
  .hub-ring { width: auto; flex: 1; min-width: 0; }
  .hub-ring__svg { width: 100%; max-width: 60px; height: auto; aspect-ratio: 1; }
  .hub-ring__pct { font-size: .72rem; }
  .hub-ring__lbl { font-size: .6rem; }
  .hub-ring__sub { display: none; }
  .hub-momentum { flex-direction: column; }
}

/* ---------- Filter-Leiste (graues Band, Pills zentriert) ---------- */

.hub-filter {
  background: var(--band);
  padding: 1.5rem 2rem;
  display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.pill {
  font-size: .82rem; font-weight: 500;
  padding: .45rem 1.1rem; border-radius: 20px;
  cursor: pointer; transition: .2s; border: none;
  letter-spacing: .03em;
  background: rgba(var(--crgb), .15);
  color: var(--cd);
}
.pill:hover { background: rgba(var(--crgb), .28); }
.pill--active { background: var(--c); color: #FFFFFF; }
.pill--all { --c: #000000; --cd: #333333; --crgb: 0, 0, 0; border: 1px solid var(--black); background: #FFFFFF; }
.pill--all.pill--active { background: var(--black); color: #FFFFFF; }
.pill--fav { --crgb: 237, 125, 49; --cd: #ED7D31; --c: #ED7D31; font-size: 1rem; padding: .45rem .85rem; line-height: 1; }
.pill--fav.pill--active { background: var(--star); color: #FFFFFF; }

/* ---------- Agent-Kacheln (flaches Grid wie Base44, keine Zwischenüberschriften) ---------- */

.hub-grid {
  max-width: 1240px; margin: 0 auto;
  padding: 2rem;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
  align-items: stretch;
}
@media (max-width: 980px) { .hub-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .hub-grid { grid-template-columns: 1fr; padding: 1.25rem 1rem; } }

.card { text-decoration: none; display: flex; flex-direction: column; position: relative; }
.card[hidden] { display: none; }
.card__inner {
  background: #FFFFFF; border-radius: 16px; border: 1px solid var(--cardline);
  flex: 1; display: flex; flex-direction: column;
  box-shadow: rgba(0,0,0,.06) 0 2px 12px;
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover .card__inner { transform: translateY(-4px); box-shadow: rgba(0,0,0,.12) 0 16px 40px; }
.card__strip { height: 3px; background: var(--c); flex-shrink: 0; }
.card__star {
  position: absolute; top: 14px; right: 14px;
  background: none; border: none; padding: 4px; cursor: pointer;
  line-height: 1; font-size: 1.1rem; color: var(--c);
  transition: color .15s, transform .15s; z-index: 2;
}
.card__star:hover { transform: scale(1.2); }
.card__star--on { color: var(--star); }
.card__body { padding: 2rem; display: flex; flex-direction: column; flex: 1; gap: 1rem; }
.card__top { display: flex; align-items: flex-start; gap: 1rem; }
.card__tile {
  width: 52px; height: 52px; border-radius: 12px;
  background: var(--c);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(0,0,0,.06); flex-shrink: 0;
  color: var(--creme); font-size: 1.6rem;
}
.card__tile svg { width: 26px; height: 26px; display: block; }
.card__cat {
  font-size: .72rem; font-weight: 500;
  color: var(--c); background: rgba(var(--crgb), .13);
  padding: .25rem .75rem; border-radius: 20px;
  letter-spacing: .06em; text-transform: uppercase;
}
/* Erledigt-Haken auf Link-Kacheln (Unternehmerinnen-Test): gleiches Chip-Format wie
   .card__cat, Grün wie die fertigen Fortschritts-Ringe (#3E7A4E). */
.card__done {
  font-size: .72rem; font-weight: 500;
  color: #3E7A4E; background: rgba(62, 122, 78, .13);
  padding: .25rem .75rem; border-radius: 20px;
  letter-spacing: .06em; text-transform: uppercase;
  white-space: nowrap;
}
.card__text { flex: 1; }
.card__text h3 {
  font-family: var(--fs-display); font-size: 1.15rem; font-weight: 400;
  color: var(--black); margin: 0 0 .5rem; letter-spacing: .01em;
}
.card__text p { font-size: .88rem; color: var(--gray); line-height: 1.6; margin: 0; }
.card__cta {
  display: flex; align-items: center; gap: .4rem;
  color: var(--signal); font-size: .85rem; font-weight: 500; margin-top: auto;
}

/* ---------- Footer (zentriert wie Base44 + Legal-Zeile) ---------- */

.footer {
  text-align: center; padding: 2rem;
  border-top: 1px solid var(--line);
  margin-top: 2rem; background: #FFFFFF; flex-shrink: 0;
}
.footer__feedback {
  display: inline-block; font-size: .78rem; color: var(--softgray);
  border: 1px solid #D0C8C5; border-radius: 20px; padding: .35rem 1rem;
  text-decoration: none; margin-bottom: 1.2rem; transition: .2s; letter-spacing: .02em;
}
.footer__feedback:hover { border-color: var(--signal); color: var(--signal); }
.footer__love {
  font-family: var(--fs-display); font-style: italic;
  font-size: .9rem; color: var(--softgray); display: block; margin-bottom: .4rem;
}
.footer__claim { font-size: .88rem; color: var(--warmgray); display: block; }
.footer__legal { margin-top: 1.2rem; display: flex; gap: 1.2rem; justify-content: center; }
.footer__legal a { font-size: .72rem; color: #B0A6A2; text-decoration: none; }
.footer__legal a:hover { color: var(--signal); }

/* ---------- Login ---------- */

.page-login { background: var(--chat-page); min-height: 100vh; display: flex; }
.login { margin: auto; width: 100%; max-width: 420px; padding: 1.5rem; }
.login__card {
  background: #FFFFFF; border: 1px solid var(--cardline); border-radius: 16px;
  box-shadow: rgba(0,0,0,.06) 0 2px 12px; padding: 2.2rem;
  text-align: center;
}
.login__logo { height: 30px; width: auto; margin-bottom: 1.4rem; }
.login__head {
  font-family: var(--fs-head); font-weight: 400; text-transform: uppercase;
  letter-spacing: .05em; font-size: 1.4rem; color: var(--black); margin: 0 0 .8rem;
}
.login__text { font-size: .9rem; color: var(--gray); line-height: 1.6; margin: 0 0 1.4rem; }
.login__error {
  background: rgba(163,0,9,.07); color: var(--signal);
  font-size: .85rem; border-radius: 8px; padding: .6rem .9rem; margin: 0 0 1rem;
}
.login form { text-align: left; }
.field-label { display: block; font-size: .78rem; font-weight: 500; color: var(--warmgray); margin: .9rem 0 .3rem; letter-spacing: .02em; }
.field {
  width: 100%; border: 1px solid var(--line-warm); border-radius: 8px;
  padding: .7rem .9rem; font-size: 1rem; font-family: var(--fs-body);
  background: #FFFFFF; color: var(--black);
}
.field:focus { outline: 2px solid rgba(163,0,9,.25); border-color: var(--signal); }
.btn { display: inline-block; text-decoration: none; text-align: center; }
.btn--primary {
  width: 100%; margin-top: 1.3rem;
  background: var(--signal); color: #FFFFFF; border: none; border-radius: 8px;
  padding: .8rem 1rem; font-size: .95rem; font-weight: 500; letter-spacing: .05em;
  cursor: pointer; transition: all .2s ease;
}
.btn--primary:hover { background: #8a0007; transform: translateY(-1px); }
.login__hint { font-size: .82rem; color: var(--gray); margin: 1.2rem 0 0; }
.login__hint a { color: var(--signal); }
.login__hint--buchen { border-top: 1px solid var(--cardline); padding-top: 1.1rem; line-height: 1.6; }

/* ---------- Erinnerungen ---------- */

.hub--sub { max-width: 760px; margin: 0 auto; padding: 0 1.25rem; }
.mem-list { list-style: none; margin: 1rem 0 3rem; padding: 0; display: flex; flex-direction: column; gap: .75rem; }
.mem {
  display: flex; align-items: center; gap: 1rem;
  background: #FFFFFF; border: 1px solid var(--cardline); border-radius: 12px;
  box-shadow: rgba(0,0,0,.05) 0 2px 8px; padding: 1rem 1.25rem;
}
.mem__body { flex: 1; display: flex; flex-direction: column; gap: .25rem; }
.mem__meta { font-size: .72rem; color: var(--softgray); letter-spacing: .04em; text-transform: uppercase; }
.mem__fact { font-size: .92rem; color: var(--text); line-height: 1.55; }
.mem__delete {
  background: none; border: 1px solid var(--line-warm); border-radius: 20px;
  font-size: .75rem; color: var(--softgray); padding: .3rem .8rem; cursor: pointer; transition: .2s;
}
.mem__delete:hover { border-color: var(--signal); color: var(--signal); }
.mem-empty { text-align: center; color: var(--gray); font-size: .92rem; padding: 2rem 0 3rem; }

/* ---------- Agent-Chat (Base44-AgentView: Breadcrumb-Band + Chat-Karte auf Taupe) ---------- */

.page-chat { background: var(--chat-page); }
.chat-shell { min-height: 100dvh; display: flex; flex-direction: column; }

.agent-header {
  background: #EDE9E6;
  border-bottom: 1px solid var(--line-warm);
  padding: .4rem 1.5rem;
  flex-shrink: 0;
}
.agent-header__row {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: .75rem; min-height: 44px;
}
.agent-header__back {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: .78rem; color: var(--warmgray); text-decoration: none;
  white-space: nowrap; flex-shrink: 0; transition: color .2s;
}
.agent-header__back:hover { color: var(--signal); }
.agent-header__sep { color: var(--line-warm); font-size: .8rem; flex-shrink: 0; }
.agent-header__tile {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--c); border: 1px solid rgba(0,0,0,.06);
  color: var(--creme); flex-shrink: 0; font-size: 1.3rem;
}
.agent-header__tile svg { width: 26px; height: 26px; display: block; }
.agent-header__title {
  font-family: var(--fs-head); font-size: clamp(.95rem, 2vw, 1.25rem); font-weight: 400;
  color: var(--black); margin: 0; letter-spacing: .04em; text-transform: uppercase;
  white-space: nowrap; flex-shrink: 0;
}
.agent-header__badge {
  font-size: .68rem; font-weight: 500; color: var(--signal);
  background: rgba(163,0,9,.08); padding: .15rem .6rem; border-radius: 20px;
  text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; flex-shrink: 0;
}
.agent-header__desc {
  font-size: .78rem; color: var(--warmgray);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.agent-header__star {
  margin-left: auto; background: none; border: none; padding: 4px;
  cursor: pointer; line-height: 1; font-size: 1.2rem; color: var(--warmgray);
  transition: color .15s, transform .15s; flex-shrink: 0;
}
.agent-header__star:hover { transform: scale(1.15); }
.agent-header__star--on { color: var(--star); }
@media (max-width: 640px) {
  .agent-header { padding: .4rem .75rem; }
  .agent-header__desc, .agent-header__badge { display: none; }
  .agent-header__title { white-space: normal; font-size: .95rem; line-height: 1.2; }
}

/* Hinweis über den Delphi-Embeds (Lea.AI / Sales Coach): schmaler Creme-Balken
   zwischen Agent-Header und Chat-Fläche. Bleibt auch mobil sichtbar — genau dort
   entsteht die Verwirrung über den fehlenden Verlauf. */
.embed-hint {
  background: var(--chat-page);
  border-bottom: 1px solid var(--line-warm);
  padding: .55rem 1rem;
  text-align: center;
}
.embed-hint p {
  margin: 0 auto;
  font-size: .82rem;
  line-height: 1.45;
  color: var(--warmgray);
  max-width: 720px;
}
@media (max-width: 640px) {
  .embed-hint { padding: .5rem .85rem; }
  .embed-hint p { font-size: .78rem; }
}

.chat-area {
  flex: 1; min-height: 0;
  background: var(--chat-bg);
  padding: 1.5rem;
  display: flex;
}
.chat-card {
  background: #FFFFFF; border-radius: 20px;
  box-shadow: rgba(0,0,0,.12) 0 10px 40px;
  width: 100%; max-width: 960px; margin: 0 auto;
  display: flex; flex-direction: column; min-height: 0;
}
.chat-card__head { text-align: center; padding: 1.6rem 1.5rem 0; flex-shrink: 0; }
.chat-card__head h2 {
  font-family: var(--fs-display); font-weight: 400; font-size: 1.7rem;
  color: var(--black); margin: 0 0 .35rem;
}
.chat-card__head p { font-size: .88rem; color: var(--gray); margin: 0 auto; max-width: 560px; line-height: 1.5; }
.chat-card__tools { margin-top: .7rem; display: flex; gap: .5rem; justify-content: center; align-items: center; }
.chat-card__dot { color: var(--line-warm); }
.chat-tool {
  background: none; border: none; cursor: pointer;
  font-size: .78rem; color: var(--softgray); padding: .2rem .3rem; transition: color .2s;
}
.chat-tool:hover { color: var(--signal); }
@media (max-width: 640px) {
  .chat-area { padding: .5rem; }
  .chat-card { border-radius: 14px; }
  .chat-card__head { padding-top: 1rem; }
  .chat-card__head h2 { font-size: 1.25rem; }
  .chat-card__head p { display: none; }
}

.chat-sessions {
  margin: .8rem 1.5rem 0; padding: .8rem;
  background: var(--chat-page); border: 1px solid var(--cardline); border-radius: 12px;
  max-height: 240px; overflow-y: auto; flex-shrink: 0;
}
.chat-sessions__title { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; color: var(--softgray); margin: 0 0 .5rem; }
.chat-sessions__empty { font-size: .85rem; color: var(--gray); margin: 0; }
.chat-sessions__item {
  display: flex; flex-direction: column; gap: .15rem; width: 100%;
  background: #FFFFFF; border: 1px solid var(--cardline); border-radius: 8px;
  padding: .55rem .8rem; margin-bottom: .4rem; cursor: pointer; text-align: left; transition: border-color .15s;
}
.chat-sessions__item:hover { border-color: var(--signal); }
.chat-sessions__item--active { border-color: var(--signal); }
.chat-sessions__meta { font-size: .7rem; color: var(--softgray); }
.chat-sessions__preview { font-size: .84rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chat-log {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 1.2rem 1.5rem;
  display: flex; flex-direction: column; gap: .8rem;
  overscroll-behavior: contain;
}
.msg { max-width: 85%; line-height: 1.6; font-size: .95rem; }
.msg p { margin: 0 0 .6em; } .msg p:last-child { margin-bottom: 0; }
.msg ul, .msg ol { margin: .3em 0; padding-left: 1.3em; }
/* Markdown-Überschriften/Trennlinien in Agent-Antworten (Stolperstein-Audit W5) */
.msg .msg__head { margin-top: 1em; color: var(--black); }
.msg .msg__head:first-child { margin-top: 0; }
.msg hr { border: none; border-top: 1px solid var(--line); margin: .8em 0; }
.msg--user {
  align-self: flex-end;
  background: var(--black); color: #FFFFFF;
  border-radius: 16px 16px 4px 16px;
  padding: .7rem 1rem;
  white-space: pre-wrap;
}
.msg--assistant { align-self: flex-start; color: var(--text); }
.msg--welcome { color: var(--text); }
.msg--tool { align-self: flex-start; font-size: .78rem; color: var(--softgray); font-style: italic; }
.typing::after { content: '···'; letter-spacing: .2em; animation: blink 1.2s infinite; font-size: 1.2rem; color: var(--softgray); }
.msg__status { font-size: .78rem; color: var(--softgray); font-style: italic; }
@keyframes blink { 0%,100% { opacity: .3; } 50% { opacity: 1; } }

.chat-starters { display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; margin-top: .5rem; }
.chat-starter {
  background: var(--chat-page); border: 1px solid var(--cardline); border-radius: 999px;
  padding: .5rem 1rem; font-size: .85rem; color: var(--text); cursor: pointer; text-align: left; transition: .15s;
}
.chat-starter:hover { border-color: var(--signal); color: var(--signal); }

.chat-input {
  flex-shrink: 0;
  display: flex; align-items: flex-end; gap: .5rem;
  padding: .8rem 1rem calc(.8rem + env(safe-area-inset-bottom));
}
/* Sofort-Hinweis unter dem Eingabefeld, solange eine Antwort streamt (Daniel 06.08.):
   die Abbrueche bei KURZEN Antworten passieren vor dem 20-s-Hinweis — Bildschirmsperre/
   App-Wechsel killt den Stream. Bewusst klein und ruhig, keine Warn-Optik. */
.chat-busy-hint {
  flex-shrink: 0; margin: 0;
  padding: 0 1rem calc(.5rem + env(safe-area-inset-bottom));
  font-size: .74rem; color: var(--softgray); text-align: center; font-style: italic;
}
.chat-busy-hint[hidden] { display: none; }
.chat-input textarea {
  flex: 1; resize: none; max-height: 140px;
  border: 1.5px solid var(--line-warm); border-radius: 24px;
  padding: .7rem 1.1rem; font: inherit; font-size: 1rem; line-height: 1.4;
  background: #FFFFFF; color: var(--black);
}
.chat-input textarea:focus { outline: none; border-color: var(--signal); }
.chat-mic {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: #FFFFFF; border: 1.5px solid var(--line-warm); color: var(--warmgray);
  display: flex; align-items: center; justify-content: center; cursor: pointer; transition: .2s;
}
.chat-mic svg { width: 20px; height: 20px; }
.chat-mic--live { border-color: var(--signal); color: var(--signal); animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(163,0,9,.3); } 50% { box-shadow: 0 0 0 8px rgba(163,0,9,0); } }
.chat-send {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  background: var(--signal); border: none; color: #FFFFFF; font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center; cursor: pointer; transition: .2s;
}
.chat-send:hover { background: var(--signal-dark); }
.chat-send:disabled { opacity: .5; cursor: default; }

/* Chat: Footer auf Mobile ausblenden (Chat behält volle Resthöhe — Lehre aus den Base44-Mobile-Fixes) */
@media (max-width: 900px) {
  .page-chat .footer { display: none; }
}
.page-chat .footer { margin-top: 0; }

/* ---------- Artefakte ---------- */

.artifact {
  align-self: stretch; max-width: 100%;
  border: 1px solid var(--cardline); border-radius: 12px; overflow: hidden;
  background: #FFFFFF; box-shadow: rgba(0,0,0,.06) 0 2px 10px;
}
.artifact__bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .5rem .8rem; background: var(--chat-page); border-bottom: 1px solid var(--cardline);
}
.artifact__title { font-size: .8rem; font-weight: 500; color: var(--warmgray); }
.artifact__actions { display: flex; gap: .4rem; }
.artifact__btn {
  background: #FFFFFF; border: 1px solid var(--line-warm); border-radius: 6px;
  font-size: .72rem; color: var(--text); padding: .25rem .6rem; cursor: pointer; transition: .15s;
}
.artifact__btn:hover { border-color: var(--signal); color: var(--signal); }
.artifact__frame { width: 100%; height: 380px; border: none; display: block; background: #FFFFFF; }
.artifact-overlay {
  position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.75);
  display: flex; flex-direction: column; padding: 1rem;
}
.artifact-overlay__bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .5rem .8rem; background: #FFFFFF; border-radius: 10px 10px 0 0;
}
.artifact-overlay__frame { flex: 1; border: none; background: #FFFFFF; border-radius: 0 0 10px 10px; }

/* ---------- Meine Ergebnisse (2026-07-22): Copy-Karten mobile-first + Downloads ---------- */

.results-toolbar { margin-top: 1rem; }
.results-list { display: flex; flex-direction: column; gap: .9rem; margin: 1rem 0 3rem; }
.result {
  border: 1px solid var(--cardline); border-radius: 12px; background: #FFFFFF;
  padding: 1.1rem 1.2rem; box-shadow: rgba(0,0,0,.04) 0 2px 8px;
}
.result__meta { font-size: .72rem; color: var(--softgray); letter-spacing: .04em; text-transform: uppercase; }
.result__title { font-family: var(--fs-display); font-size: 1.25rem; font-weight: 700; color: var(--black); margin: .3rem 0 .6rem; }
.result__actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.result__btn {
  font-size: .8rem; padding: .42rem .8rem; border: 1px solid var(--line-warm); border-radius: 999px;
  background: #FFFFFF; color: var(--warmgray); cursor: pointer; text-decoration: none; transition: .2s;
}
.result__btn:hover { border-color: var(--signal); color: var(--signal); }
.result__btn--ok { border-color: #3E7A4E; color: #3E7A4E; }
.result__body { margin: .3rem 0 .9rem; font-size: .92rem; line-height: 1.6; color: var(--text); }
.result__body p { margin: 0 0 .7em; }
.result__body ul, .result__body ol { margin: .3em 0 .8em; padding-left: 1.3em; }
.result__body hr { border: none; border-top: 1px solid var(--line); margin: 1em 0; }
.result__h1, .result__h2 { font-family: var(--fs-display); font-size: 1.05rem; color: var(--black); margin: 1.1em 0 .4em; }
.result__h3, .result__h4 { font-size: .9rem; color: var(--signal); margin: 1em 0 .3em; }
.copycard { border: 1px solid var(--line); border-radius: 10px; margin-bottom: .7rem; overflow: hidden; }
.copycard__head {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  padding: .5rem .8rem; background: var(--band); border-bottom: 1px solid var(--line);
}
.copycard__title { font-size: .8rem; font-weight: 600; color: var(--warmgray); }
.copycard__body { padding: .7rem .8rem; }
.copycard__body p:last-child { margin-bottom: 0; }

/* Hinweis-Karte im Chat nach gespeichertem Ergebnis */
.result-hint {
  align-self: flex-start; display: block; font-size: .84rem; line-height: 1.5; color: var(--warmgray);
  border: 1px solid var(--line-warm); border-left: 3px solid #3E7A4E; border-radius: 10px;
  padding: .65rem .9rem; background: #FFFFFF; text-decoration: none; max-width: 85%; transition: .2s;
}
.result-hint:hover { border-color: #3E7A4E; box-shadow: rgba(0,0,0,.06) 0 3px 10px; }
.result-hint b { color: #3E7A4E; font-weight: 600; }

/* ---------- Popups: 100%-Export + Wochenrückblick (2026-07-22) ---------- */

.popup {
  position: fixed; inset: 0; z-index: 300; background: rgba(20, 15, 13, .45);
  display: flex; align-items: center; justify-content: center; padding: 1.25rem;
}
.popup__card {
  background: #FFFFFF; border-radius: 14px; max-width: 460px; width: 100%;
  padding: 1.6rem 1.5rem 1.4rem; box-shadow: rgba(0,0,0,.25) 0 18px 50px;
}
.popup__kicker {
  display: block; font-family: var(--fs-head); font-size: .68rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--signal); margin-bottom: .35rem;
}
.popup__title { font-family: var(--fs-display); font-size: 1.35rem; color: var(--black); margin: 0 0 .6rem; }
.popup__text { font-size: .9rem; line-height: 1.55; color: var(--gray); margin: 0 0 .9rem; }
.popup__list { margin: 0 0 .9rem; padding-left: 1.2em; font-size: .9rem; line-height: 1.7; color: var(--text); }
.popup__list b { color: var(--black); }
.popup__actions { display: flex; flex-direction: column; gap: .55rem; align-items: stretch; }
.popup__later {
  border: none; background: none; font-size: .78rem; color: var(--softgray);
  cursor: pointer; padding: .2rem; text-align: center;
}
.popup__later:hover { color: var(--signal); }

/* Wochenrückblick-Popup grün statt Signal-Rot (Daniel-Feedback 23.07.2026) */
.popup--gruen .popup__kicker { color: #3E7A4E; }
.popup--gruen .btn--primary { background: #3E7A4E; }
.popup--gruen .btn--primary:hover { background: #2F5E3C; }
@media (max-width: 640px) {
  .popup { align-items: flex-end; padding: 0; }
  .popup__card { border-radius: 14px 14px 0 0; max-width: none; padding-bottom: calc(1.4rem + env(safe-area-inset-bottom)); }
}

/* hidden-Attribut muss gegen display:flex gewinnen (sonst schließen Popups nicht) */
.popup[hidden] { display: none; }

/* Topbar mobil: Name ausblenden + engere Abstände, damit beide Menü-Links reinpassen */
@media (max-width: 640px) {
  .topbar { padding: 0 1rem; }
  .topbar__user { display: none; }
  .topbar__link { margin-right: .8rem; font-size: .78rem; white-space: nowrap; }
  .topbar__lnk-lang { display: none; }
  .topbar__logo img { height: 30px; }
  /* Abmelden mobil nur als Icon — die Menü-Links brauchen den Platz */
  .topbar__logout { font-size: 0; gap: 0; margin-left: .25rem; padding: .35rem .5rem; }
  .topbar__logout svg { width: 18px; height: 18px; }
}
