.dgs-ki {
    --dgs-ki-accent: #005b66;
    --dgs-ki-accent-dark: #003f47;
    --dgs-ki-accent-soft: #e9f3f4;
    --dgs-ki-border: #d9e1e3;
    --dgs-ki-muted: #5d686b;
    --dgs-ki-surface: #f5f8f8;
    box-sizing: border-box;
    max-width: 860px;
    margin: 1.25rem auto;
    padding: clamp(1rem, 3vw, 1.5rem);
    border: 1px solid var(--dgs-ki-border);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(0, 50, 58, 0.08);
    color: #172124;
    font: inherit;
}

.dgs-ki *, .dgs-ki *::before, .dgs-ki *::after,
.dgs-ki-floating *, .dgs-ki-floating *::before, .dgs-ki-floating *::after { box-sizing: border-box; }

.dgs-ki__header { display: flex; align-items: flex-start; gap: 0.9rem; margin-bottom: 1rem; }
.dgs-ki__avatar {
    display: grid; place-items: center; flex: 0 0 56px; width: 56px; height: 56px;
    border-radius: 16px; background: var(--dgs-ki-accent-soft); border: 1px solid rgba(0, 91, 102, 0.12); overflow: hidden;
}
.dgs-ki__logo { display: block; max-width: 42px; max-height: 42px; width: auto; height: auto; object-fit: contain; }
.dgs-ki__logo-fallback {
    display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
    background: var(--dgs-ki-accent); color: #fff; font-weight: 700; letter-spacing: 0.04em;
}
.dgs-ki__eyebrow { margin: 0 0 0.2rem; color: var(--dgs-ki-accent); font-size: 0.76rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.dgs-ki__title { margin: 0 0 0.25rem; font-size: clamp(1.25rem, 4vw, 1.65rem); line-height: 1.2; }
.dgs-ki__subtitle { margin: 0; color: var(--dgs-ki-muted); line-height: 1.5; }

.dgs-ki__messages {
    display: flex; flex-direction: column; gap: 0.8rem; max-height: min(52vh, 560px); overflow-y: auto;
    margin: 0 0 1rem; padding: 0.25rem; scroll-behavior: smooth;
}
.dgs-ki__messages:empty { display: none; }
.dgs-ki__message { max-width: 92%; }
.dgs-ki__message--user { align-self: flex-end; }
.dgs-ki__message--assistant { align-self: flex-start; }
.dgs-ki__message-label { margin: 0 0 0.25rem 0.25rem; color: var(--dgs-ki-muted); font-size: 0.78rem; font-weight: 700; }
.dgs-ki__message-body { padding: 0.85rem 1rem; border-radius: 15px; background: var(--dgs-ki-surface); line-height: 1.55; white-space: pre-wrap; }
.dgs-ki__message--user .dgs-ki__message-body { background: var(--dgs-ki-accent); color: #fff; border-bottom-right-radius: 4px; }
.dgs-ki__message--assistant .dgs-ki__message-body { border-bottom-left-radius: 4px; }
.dgs-ki__inline-link { color: var(--dgs-ki-accent-dark); font-weight: 650; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
.dgs-ki__message--user .dgs-ki__inline-link { color: #fff; }

.dgs-ki__sources { margin-top: 0.55rem; padding: 0.75rem 0.9rem; border: 1px solid var(--dgs-ki-border); border-radius: 12px; background: #fff; }
.dgs-ki__sources-title { font-size: 0.9rem; }
.dgs-ki__sources-list { margin: 0.4rem 0 0 1.25rem; padding: 0; }
.dgs-ki__source { margin: 0.4rem 0; }
.dgs-ki__source-link { color: var(--dgs-ki-accent-dark); font-weight: 650; text-decoration: underline; text-underline-offset: 2px; }
.dgs-ki__source-link--plain { text-decoration: none; }
.dgs-ki__source-snippet { margin: 0.2rem 0 0; color: var(--dgs-ki-muted); font-size: 0.88rem; line-height: 1.45; }
.dgs-ki__badge { display: inline-block; margin-right: 0.35rem; padding: 0.12rem 0.42rem; border-radius: 999px; background: #e8f0f1; color: #244247; font-size: 0.7rem; font-weight: 700; vertical-align: 0.08em; }
.dgs-ki__badge--live { background: #fff2cf; color: #6a4b00; }

.dgs-ki__form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.65rem; align-items: stretch; }
.dgs-ki__input { width: 100%; min-height: 54px; max-height: 160px; resize: vertical; padding: 0.8rem 0.9rem; border: 1px solid #aebcbe; border-radius: 12px; background: #fff; color: inherit; font: inherit; line-height: 1.4; }
.dgs-ki__input:focus { outline: 3px solid rgba(0, 91, 102, 0.18); border-color: var(--dgs-ki-accent); }
.dgs-ki__submit { min-width: 96px; padding: 0.75rem 1rem; border: 0; border-radius: 12px; background: var(--dgs-ki-accent); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.dgs-ki__submit:hover, .dgs-ki__submit:focus { filter: brightness(0.86); }
.dgs-ki__submit:disabled { cursor: wait; opacity: 0.65; }
.dgs-ki__notice { margin: 0.75rem 0 0; color: var(--dgs-ki-muted); font-size: 0.78rem; line-height: 1.45; }
.dgs-ki__notice a { white-space: nowrap; }

/* Floating shortcode: [dgs_kongresslotse_floating] */
.dgs-ki-floating {
    --dgs-ki-accent: #005b66;
    --dgs-ki-float-right: max(14px, env(safe-area-inset-right));
    --dgs-ki-float-bottom: max(96px, calc(env(safe-area-inset-bottom) + 88px));
    position: relative;
    z-index: 99998;
    font: inherit;
}
.dgs-ki-floating__trigger {
    position: fixed; right: var(--dgs-ki-float-right); bottom: var(--dgs-ki-float-bottom);
    z-index: 99998; display: grid; place-items: center; width: 60px; height: 60px; padding: 0;
    border: 0; border-radius: 50%; background: var(--dgs-ki-accent); color: #fff; box-shadow: 0 10px 28px rgba(0,0,0,.22);
    cursor: pointer;
}
.dgs-ki-floating__trigger:hover, .dgs-ki-floating__trigger:focus { filter: brightness(.94); outline-offset: 3px; }
.dgs-ki-floating__icon {
    display: grid; place-items: center; width: 100%; height: 100%; color: #fff;
    font-family: Arial, Helvetica, sans-serif; font-size: 2rem; font-weight: 500; line-height: 1;
}
.dgs-ki-floating__pilot-icon { width: 38px; height: 38px; display: block; overflow: visible; }
.dgs-ki-floating__pilot-bubble { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linejoin: round; }
.dgs-ki-floating__pilot-ring { fill: none; stroke: currentColor; stroke-width: 2; }
.dgs-ki-floating__pilot-needle { fill: currentColor; stroke: currentColor; stroke-width: .8; stroke-linejoin: round; }
.dgs-ki-floating__pilot-dot { fill: var(--dgs-ki-accent, #005b66); stroke: currentColor; stroke-width: 1; }
.dgs-ki-floating__icon--close { display: none; font-size: 2.2rem; font-weight: 300; transform: translateY(-1px); }
.dgs-ki-floating.is-open .dgs-ki-floating__icon--open { display: none; }
.dgs-ki-floating.is-open .dgs-ki-floating__icon--close { display: grid; }
.dgs-ki-floating.is-open .dgs-ki-floating__trigger { background: var(--dgs-ki-accent-dark, #003f47); }
.dgs-ki-floating__backdrop { position: fixed; inset: 0; z-index: 99998; background: rgba(16, 28, 31, .48); }
.dgs-ki-floating__dialog {
    position: fixed; right: max(12px, env(safe-area-inset-right)); bottom: calc(var(--dgs-ki-float-bottom) + 72px);
    z-index: 99999; width: min(440px, calc(100vw - 24px)); max-height: min(760px, calc(100dvh - 140px)); overflow: auto;
    border-radius: 20px; background: #fff; box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.dgs-ki-floating [hidden] { display: none !important; }
.dgs-ki--compact { width: 100%; max-width: none; margin: 0; border: 0; border-radius: 20px; box-shadow: none; padding: 1rem; padding-top: 1.25rem; }
.dgs-ki--compact .dgs-ki__header { padding-right: 0; }
.dgs-ki--compact .dgs-ki__subtitle { font-size: .9rem; }
.dgs-ki--compact .dgs-ki__messages { max-height: min(45vh, 420px); }
html.dgs-ki-modal-open { overflow: hidden; }


.dgs-ki__support { margin-top: 0.7rem; padding: 0.8rem; border: 1px solid var(--dgs-ki-border); border-radius: 12px; background: var(--dgs-ki-accent-soft); }

@media (max-width: 560px) {
    .dgs-ki { margin: 0.5rem 0; border-radius: 14px; }
    .dgs-ki__form { grid-template-columns: 1fr; }
    .dgs-ki__submit { width: 100%; min-height: 48px; }
    .dgs-ki__message { max-width: 97%; }
    .dgs-ki-floating {
        --dgs-ki-float-right: max(12px, env(safe-area-inset-right));
        --dgs-ki-float-bottom: max(88px, calc(env(safe-area-inset-bottom) + 80px));
    }
    .dgs-ki-floating__trigger { width: 56px; height: 56px; }
    .dgs-ki-floating__dialog { left: 8px; right: 8px; width: auto; max-height: calc(100dvh - 150px); }
}

@media (prefers-reduced-motion: reduce) { .dgs-ki__messages { scroll-behavior: auto; } }

.dgs-ki__chat-load-error { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(96px, calc(env(safe-area-inset-bottom) + 88px)); z-index: 100002; max-width: min(420px, calc(100vw - 32px)); padding: .85rem 1rem; border-radius: 14px; background: #fff; color: #26383b; box-shadow: 0 14px 40px rgba(0,0,0,.25); border: 1px solid var(--dgs-ki-border, #d9e1e3); font: inherit; line-height: 1.45; }

/* Human live-support handover */
.dgs-ki__support-offer { margin-top: .75rem; }
.dgs-ki__support-button {
    display: inline-flex; align-items: center; justify-content: center; min-height: 42px;
    padding: .65rem .9rem; border: 0; border-radius: 11px; background: var(--dgs-ki-accent); color: #fff;
    font: inherit; font-weight: 700; cursor: pointer;
}
.dgs-ki__support-button:hover, .dgs-ki__support-button:focus { filter: brightness(.9); }
.dgs-ki__support-button:disabled { opacity: .65; cursor: wait; }

.dgs-ki__support-name-prompt { margin: .7rem 0 .45rem; color: var(--dgs-ki-muted); font-size: .88rem; line-height: 1.45; }
.dgs-ki__support-name-form { display: flex; align-items: end; gap: .55rem; margin-top: .45rem; }
.dgs-ki__support-name-label { flex: 1 1 auto; display: grid; gap: .3rem; color: #244247; font-size: .8rem; font-weight: 700; }
.dgs-ki__support-name-input { width: 100%; min-height: 42px; padding: .55rem .65rem; border: 1px solid #aebcbe; border-radius: 10px; background: #fff; color: inherit; font: inherit; font-weight: 400; }
.dgs-ki__support-name-input:focus { outline: 3px solid rgba(0, 91, 102, .18); border-color: var(--dgs-ki-accent); }
@media (max-width: 480px) { .dgs-ki__support-name-form { align-items: stretch; flex-direction: column; } .dgs-ki__support-name-form .dgs-ki__support-button { width: 100%; } }
.dgs-ki__support-status {
    display: flex; align-items: center; justify-content: space-between; gap: .65rem;
    margin: 0 0 .65rem; padding: .55rem .7rem; border-radius: 10px; background: var(--dgs-ki-accent-soft); color: #244247;
    font-size: .82rem;
}
.dgs-ki__support-status-text { font-weight: 700; }
.dgs-ki__support-close {
    border: 0; padding: .35rem .55rem; border-radius: 8px; background: #fff; color: var(--dgs-ki-accent-dark);
    font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer;
}
.dgs-ki.is-support-active .dgs-ki__submit { background: var(--dgs-ki-accent-dark); }

/* Unread live-support messages while the floating dialog is minimized. */
.dgs-ki-floating__badge {
    position: absolute; top: -5px; right: -5px; min-width: 22px; height: 22px; padding: 0 6px;
    display: inline-flex; align-items: center; justify-content: center; border: 2px solid #fff; border-radius: 999px;
    background: #c62828; color: #fff; font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: 700; line-height: 1;
    box-shadow: 0 3px 10px rgba(0,0,0,.22);
}
.dgs-ki__support-offline { margin-top: .55rem; padding: .7rem .8rem; border-radius: 10px; background: #f7f4eb; color: #4d4431; line-height: 1.5; }


/* Per-answer participant quality feedback */
.dgs-ki__answer-feedback { display:flex; flex-wrap:wrap; align-items:center; gap:.4rem; margin:.4rem 0 0 .25rem; color:var(--dgs-ki-muted); font-size:.78rem; }
.dgs-ki__answer-feedback-prompt { margin-right:.15rem; }
.dgs-ki__answer-feedback-button, .dgs-ki__answer-feedback-send { border:1px solid var(--dgs-ki-border); border-radius:999px; background:#fff; color:#244247; padding:.3rem .55rem; font:inherit; cursor:pointer; }
.dgs-ki__answer-feedback-button:hover, .dgs-ki__answer-feedback-button:focus, .dgs-ki__answer-feedback-send:hover, .dgs-ki__answer-feedback-send:focus { border-color:var(--dgs-ki-accent); color:var(--dgs-ki-accent-dark); }
.dgs-ki__answer-feedback-negative-prompt { flex:1 0 100%; line-height:1.4; }
.dgs-ki__answer-feedback-textarea { flex:1 0 100%; width:100%; min-height:58px; padding:.5rem .6rem; border:1px solid #aebcbe; border-radius:9px; resize:vertical; font:inherit; }
.dgs-ki__answer-feedback-send { border-radius:9px; font-weight:700; }
.dgs-ki__answer-feedback-thanks { font-weight:650; }

.dgs-ki__history-controls{display:flex;justify-content:flex-end;margin:4px 0 8px}
.dgs-ki__history-clear{border:0;background:transparent;padding:3px 0;color:inherit;opacity:.68;text-decoration:underline;cursor:pointer;font-size:.82em}
.dgs-ki__history-clear:hover,.dgs-ki__history-clear:focus{opacity:1}

.dgs-ki__history-controls{display:flex;align-items:center;justify-content:space-between;gap:.65rem;flex-wrap:wrap;margin:.45rem 0;}
.dgs-ki__history-notice{font-size:.78rem;opacity:.72;}
.dgs-ki__history-clear{font:inherit;font-size:.78rem;padding:.3rem .55rem;cursor:pointer;}
