/* DigiSchicht KI-Assistent. Aufbau und Verhalten wie die Chats der Schwesterprojekte (DigMa, BERA), Farben DigiSchicht. */
.dsc-root { --navy: #0B1F3A; --navy-2: #12304f; --teal: #0F9D91; --teal-ink: #0B7B72; --mist: #E4F5F3; --line: #E2E8F0; --muted: #64748B; --warn: #B45309; }
.dsc-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.dsc-root [hidden] { display: none !important; }
.dsc-root, .dsc-root * { box-sizing: border-box; }

/* Schaltfläche */
.dsc-launcher { position: fixed; right: 1.5rem; bottom: 1rem; z-index: 65; display: flex; align-items: center; gap: .5rem; padding: .85rem 1.35rem; border: 0; border-radius: 9999px; cursor: pointer;
  background: var(--teal-ink); color: #fff; font: 600 .95rem/1 inherit; font-family: inherit; box-shadow: 0 8px 24px rgba(11,123,114,.3);
  opacity: 0; transform: translateY(16px); pointer-events: none; transition: transform .2s, box-shadow .2s, background .2s; }
.dsc-launcher.is-visible { opacity: 1; transform: none; pointer-events: auto; animation: dsc-in .35s ease-out; }
.dsc-launcher:hover { background: #09665e; transform: translateY(-2px); }
.dsc-launcher:focus-visible { outline: 3px solid #fff; outline-offset: -3px; box-shadow: 0 0 0 4px var(--navy); }
.dsc-launcher svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dsc-label-short { display: none; }
@keyframes dsc-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

/* Fenster */
.dsc-panel { position: fixed; right: 1.5rem; bottom: 1rem; z-index: 9999; width: min(440px, calc(100vw - 2.5rem)); height: 600px; max-height: calc(100vh - 2.5rem);
  display: none; flex-direction: column; overflow: hidden; background: #fff; border: 1.5px solid var(--teal); border-radius: 16px; box-shadow: 0 25px 60px rgba(11,31,58,.25);
  font-family: inherit; color: #1f2937; }
.dsc-panel.is-open { display: flex; animation: dsc-in .3s ease-out; }
.dsc-grip { height: 10px; flex: none; position: relative; background: var(--navy); cursor: ns-resize; touch-action: none; }
.dsc-grip::before { content: ""; position: absolute; top: 3px; left: 50%; width: 36px; height: 4px; transform: translateX(-50%); border-radius: 9999px; background: rgba(255,255,255,.35); }
.dsc-view { display: none; flex-direction: column; flex: 1; min-height: 0; }
.dsc-view.is-on { display: flex; }

/* Hinweisfenster beim ersten Start */
.dsc-consent { overflow-y: auto; }
.dsc-chead { display: flex; align-items: flex-start; gap: .75rem; padding: 1.1rem 1.25rem; background: linear-gradient(to right, var(--navy), var(--navy-2)); color: #fff; flex: none; }
.dsc-badge { width: 2.25rem; height: 2.25rem; border-radius: 9999px; background: var(--teal); display: flex; align-items: center; justify-content: center; flex: none; }
.dsc-badge svg { width: 1.1rem; height: 1.1rem; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.dsc-chead h3 { margin: 0; font-size: 1.02rem; font-weight: 800; line-height: 1.25; color: #fff; }
.dsc-csub { margin: .15rem 0 0; font-size: .72rem; color: #B8C4D9; }
.dsc-intro { margin: 1rem 1.25rem 0; font-size: .85rem; line-height: 1.55; color: #374151; }
.dsc-points { list-style: none; margin: .9rem 1.25rem 0; padding: 0; display: flex; flex-direction: column; gap: .75rem; }
.dsc-points li { display: flex; align-items: flex-start; gap: .65rem; }
.dsc-picon { width: 2.1rem; height: 2.1rem; border-radius: .5rem; display: flex; align-items: center; justify-content: center; flex: none; background: var(--mist); color: var(--teal-ink); }
.dsc-picon svg { width: 1.05rem; height: 1.05rem; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.dsc-ptext { flex: 1; min-width: 0; font-size: .78rem; line-height: 1.5; color: #4b5563; }
.dsc-ptext strong { display: block; font-size: .85rem; font-weight: 700; color: var(--navy); margin-bottom: .1rem; }
.dsc-links { display: flex; flex-wrap: wrap; gap: 0 1rem; margin: 1rem 1.25rem 0; font-size: .72rem; }
.dsc-links a { color: var(--teal-ink); font-weight: 600; text-decoration: none; }
.dsc-links a:hover { text-decoration: underline; }
.dsc-actions { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: .5rem; margin-top: auto; padding: .85rem 1.25rem 1.25rem; background: #fff; border-top: 1px solid #f1f5f9; }
.dsc-cancel { padding: .6rem 1rem; border: 0; border-radius: 9999px; background: transparent; color: #374151; font: 600 .82rem inherit; font-family: inherit; cursor: pointer; }
.dsc-cancel:hover { background: #f3f4f6; }
.dsc-accept { padding: .6rem 1.1rem; border: 0; border-radius: 9999px; background: var(--teal-ink); color: #fff; font: 700 .82rem inherit; font-family: inherit; cursor: pointer; box-shadow: 0 4px 12px rgba(11,123,114,.25); }
.dsc-accept:hover { background: #09665e; }

/* Gespräch */
.dsc-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .6rem 1rem; background: linear-gradient(to right, var(--navy), var(--navy-2)); color: #fff; flex: none; }
.dsc-hleft { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.dsc-avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; }
.dsc-avatar img { width: 22px; height: 22px; display: block; }
.dsc-htext { display: flex; flex-direction: column; gap: .1rem; min-width: 0; }
.dsc-title { margin: 0; font-weight: 700; font-size: .95rem; color: #fff; }
.dsc-sub { font-size: .7rem; color: #B8C4D9; }
.dsc-sub a { color: #5EE0D6; text-decoration: none; padding-left: .2rem; }
.dsc-sub a:hover { text-decoration: underline; }
.dsc-close { flex: none; background: transparent; border: 0; color: #fff; cursor: pointer; padding: .35rem; line-height: 0; border-radius: 6px; }
.dsc-close svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.dsc-close:focus-visible, .dsc-trash:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.dsc-log { flex: 1; min-height: 0; overflow-y: auto; padding: 1rem; background: #F8FAFC; display: flex; flex-direction: column; gap: .65rem; }
.dsc-msg { display: flex; flex-direction: column; gap: .3rem; max-width: 88%; }
.dsc-msg-user { align-self: flex-end; }
.dsc-msg-bot { align-self: flex-start; }
.dsc-bubble { padding: .65rem .9rem; border-radius: 16px; font-size: .88rem; line-height: 1.5; word-wrap: break-word; overflow-wrap: anywhere; }
.dsc-bubble p { margin: 0 0 .4rem; }
.dsc-bubble p:last-child { margin-bottom: 0; }
.dsc-bubble ul { margin: .3rem 0; padding-left: 1.1rem; }
.dsc-msg-user .dsc-bubble { background: var(--navy); color: #fff; border-bottom-right-radius: 4px; }
.dsc-msg-bot .dsc-bubble { background: #fff; color: #1f2937; border: 1px solid var(--line); border-bottom-left-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.dsc-bubble a { color: var(--teal-ink); text-decoration: underline; }
.dsc-note { font-size: .7rem; color: var(--muted); line-height: 1.4; }
.dsc-sources { display: flex; flex-direction: column; gap: .3rem; }
.dsc-sources-title { font-size: .65rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.dsc-src { display: flex; align-items: center; gap: .5rem; padding: .4rem .6rem; background: #fff; border: 1px solid var(--line); border-radius: 10px; color: var(--navy); text-decoration: none; font-size: .78rem; font-weight: 600; line-height: 1.3; }
a.dsc-src:hover { border-color: var(--teal); }
.dsc-src-n { flex: none; width: 20px; height: 20px; border-radius: 6px; background: var(--mist); color: var(--teal-ink); font-size: .7rem; font-weight: 750; display: grid; place-items: center; }
.dsc-src-t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dsc-typing { display: flex; gap: .3rem; align-items: center; padding: .75rem .9rem; }
.dsc-typing span { width: 6px; height: 6px; border-radius: 50%; background: #94a3b8; animation: dsc-bounce 1.2s infinite; }
.dsc-typing span:nth-child(2) { animation-delay: .15s; }
.dsc-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes dsc-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.dsc-slow { font-size: .72rem; color: var(--muted); padding: 0 .9rem .5rem; }

.dsc-faq { flex: none; padding: .55rem 1rem .15rem; background: #fff; border-top: 1px solid var(--line); }
.dsc-faq[hidden] { display: none; }
.dsc-faq-title { margin: 0 0 .35rem; font-size: .65rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.dsc-chips { display: flex; flex-flow: row wrap; align-items: flex-start; gap: .35rem; }
/* The former shorthand "font: ... inherit" was invalid and dropped the whole declaration, so the browser's large button font applied. */
.dsc-chip { padding: .4rem .8rem; text-align: left; border: 0; border-radius: 9999px; background: #F1F5F9; color: #334155; font-family: inherit; font-size: .68rem; font-weight: 500; line-height: 1.25; text-align: center; cursor: pointer; }
.dsc-chip:hover { background: var(--mist); color: var(--teal-ink); }
.dsc-status { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .7rem; padding: .55rem 1rem; background: #FEF3E2; color: var(--navy); font-size: .76rem; border-top: 1px solid #f5d9ab; }
.dsc-status a, .dsc-status button { color: var(--teal-ink); font: 700 .76rem inherit; font-family: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; }
.dsc-histbar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .15rem 1rem .35rem; background: #fff; font-size: .66rem; line-height: 1.3; color: var(--muted); }
.dsc-trash { background: none; border: 0; padding: .25rem; color: var(--muted); cursor: pointer; line-height: 0; border-radius: 6px; }
.dsc-trash:hover { color: var(--navy); }
.dsc-trash svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.dsc-hint { margin: 0; color: var(--muted); font-size: .66rem; line-height: 1.3; }
.dsc-form { flex: none; display: flex; gap: .5rem; padding: .55rem 1rem .25rem; background: #fff; border-top: 1px solid var(--line); }
.dsc-input { flex: 1; min-width: 0; padding: .6rem .85rem; border: 1px solid var(--line); border-radius: 10px; font: .88rem inherit; font-family: inherit; color: #1f2937; background: #F8FAFC; outline: none; }
.dsc-input:focus { border-color: var(--teal); outline: 2px solid var(--teal); outline-offset: 1px; background: #fff; }
.dsc-send { flex: none; width: 40px; height: 40px; border-radius: 10px; border: 0; background: var(--teal-ink); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.dsc-send[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
.dsc-send svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.dsc-foot { display: flex; flex-direction: row; justify-content: space-between; flex: none; background: #F8FAFC; border-top: 1px solid #f0f4f8; }
.dsc-foot a { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 12px; font-size: 10.5px; line-height: 1; text-decoration: none; }
.dsc-promo { background: #F8FAFC; color: #64748B; }
.dsc-promo strong { color: #3CA035; font-weight: 600; }
.dsc-cta { color: var(--teal-ink); font-weight: 600; }
.dsc-foot a:hover { opacity: .8; }
.dsc-foot svg { flex: none; }

html.dsc-lock { overflow: hidden; }
@media (max-width: 480px) {
  .dsc-panel { right: .75rem; left: .75rem; width: auto; bottom: calc(.75rem + env(safe-area-inset-bottom)); height: min(600px, calc(100dvh - 1.5rem - env(safe-area-inset-top) - env(safe-area-inset-bottom))); max-height: none; }
  .dsc-launcher { right: .75rem; bottom: calc(.75rem + env(safe-area-inset-bottom)); width: 52px; height: 52px; padding: 0; justify-content: center; gap: 0; }
  .dsc-label-long, .dsc-label-short { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .dsc-launcher svg { width: 24px; height: 24px; }
  .dsc-input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { .dsc-launcher, .dsc-panel, .dsc-panel *, .dsc-typing span { animation: none !important; transition: none !important; } }
@media (prefers-contrast: more) { .dsc-panel, .dsc-bubble, .dsc-src { border-color: var(--navy); } }
@media (forced-colors: active) { .dsc-launcher, .dsc-send, .dsc-accept { border: 2px solid ButtonText; } .dsc-panel { border: 2px solid CanvasText; } }
/* Hinweis Beratungslimit */
.dsc-limit { margin-top: .45rem; padding: .7rem .8rem; background: var(--mist); border: 1px solid var(--teal); border-radius: 12px; color: var(--navy); }
.dsc-limit-text { margin: 0 0 .55rem; font-size: .84rem; line-height: 1.45; }
.dsc-limit-links { display: flex; flex-wrap: wrap; gap: .45rem; }
.dsc-limit-link { display: inline-flex; align-items: center; min-height: 36px; padding: .35rem .75rem; background: var(--teal-ink); color: #fff; border-radius: 9px; font-size: .8rem; font-weight: 650; text-decoration: none; }
.dsc-limit-link:hover { background: var(--navy); }
.dsc-limit-link:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }
