#chat-widget {
    bottom: 0px;
    right: 20px;
    max-height: 100vh;
    z-index: 20000;
    width: 450px;
    position: fixed;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    overflow: visible;
}

#chat-widget.minimized {
    bottom: 173px;
    right: 20px;
}

#chat-toggle-btn {
    display: none;
    position: absolute;
    top: -28px;
    left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
    z-index: 10;
    background: #000000;
}

#chat-arrow {
    width: 46px;
    height: 30px;
    fill: #f47122;
    transition: transform 0.3s ease;
    transform: rotate(180deg);
}
#chat-toggle-btn.closed #chat-arrow {
    transform: rotate(0deg);
}
#chat-header {
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    padding: 8px 12px;
    background-color: #000000;
    color: #fff;
    font-weight: bold;
    height: 80px;
    cursor: pointer;
}
#chat-body {
    padding: 10px;
    box-sizing: border-box;
}
#chat-messages {
    max-height: 600px;
    overflow-y: auto;
    padding: 8px;
    font-size: 18px;
    font-family: 'Readex Pro',sans-serif;
    max-height: calc(100vh - 250px);
}
#chat-input {
    width: calc(100% - 16px);
    margin: 4px 8px;
    padding: 12px;
    border-radius: 5px;
    border: 1px solid #ccc;
    font-size: 18px;
    font-family: 'Readex Pro',sans-serif;
}
#chat-send {
    width: calc(100% - 16px);
    margin: 8px auto;
    display: block;
    padding: 5px 20px;
    background: #f47122;
    color: white;
    border: none;
    cursor: pointer;
    border-radius: 50px;
    font-size: 18px;
    height: 52px;
    font-family: 'Readex Pro',sans-serif;
}
#chat-header .chat-logo {
    height: 40px;
    width: auto;
    padding-left: 8px;
}
#chat-header span {
    margin-right: 8px;
    color: white;
    font-family: 'Readex Pro',sans-serif;
    font-size: 18px;
}
.thinking {
    margin: 8px 0;
    font-size: 14px;
    opacity: 0.85;
}
.thinking-text {
    margin-bottom: 6px;
    font-style: italic;
    font-family: 'Readex Pro',sans-serif;
}
.progress-wrapper {
    width: 100%;
    height: 6px;
    background: #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    width: 0%;
    background: #f47122;
    transition: width 0.4s ease;
}
.user-message {
    background-color: #F071301A;
    color: #000;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 18px;
    line-height: 1.4;
    text-align: right;
    font-family: 'Readex Pro',sans-serif;
}
.bot-message {
    background-color: #edeeef;
    color: #000;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 18px;
    line-height: 1.4;
    text-align: left;
    font-family: 'Readex Pro',sans-serif;
}
#chat-hide-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #205081;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-weight: bold;
    font-family: 'Readex Pro',sans-serif;
}
@media screen and (max-width: 768px) {
    #chat-widget {
        width: 90%;
    }
    #chat-messages {
        max-height: 300px;
    }
}

#chat-widget.minimized {
    width: 120px!important;
}
#chat-widget.minimized #chat-header {
    flex-direction: row!important;
}
#chat-widget.minimized #chat-header span {
    margin-right: 0px!important;
}

#chat-widget.minimized #chat-body {
    display: none!important;
}
#chat-widget .regular-question {
    display: none;
}
#chat-widget .initial-question-1, #chat-widget .initial-question-2 {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    padding-top: 20px!important;
    padding-bottom: 40px!important;
    gap: 20px;
}

#chat-widget .initial-question-1 h4, #chat-widget .initial-question-2 h4 {
    width: 100% !important;
    min-width: 100% !important;
    padding-left: 10px;
}
#chat-widget .initial-question-2 {
    display: none;
}

#chat-widget{
    resize: horizontal !important;
    overflow: auto !important;
}



#chat-widget{
    resize: horizontal !important;
    overflow: hidden !important;

    min-width: 320px !important;
    max-width: min(900px, 95vw) !important;

    width: 450px; /* bleibt Startwert, wird beim Ziehen überschrieben */
    box-sizing: border-box;
}

#chat-header,
#chat-body{
    box-sizing: border-box;
    width: 100%;
}

#chat-input,
#chat-send{
    width: calc(100% - 16px);
    box-sizing: border-box;
}

#chat-widget{
    resize: none !important;
    overflow: hidden;
}

#chat-widget .chat-resize-handle{
    display: flex;
    position: absolute;
    top: 6px;
    left: 6px;
    width: 28px;
    height: 20px;
    z-index: 99999;
    cursor: ew-resize;
    border-radius: 6px;
    background: rgba(244,113,34,0.9);
    box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

#chat-widget .chat-resize-handle::after{
    content:"";
    position:absolute;
    inset:4px;
    opacity:.7;
    border-radius:4px;
}

#chat-widget.minimized .chat-resize-handle {
    display: none!important;
}

.minimized #chat-header{
    position: relative;
    overflow: hidden;
    isolation: isolate;
    transform: translateZ(0);
}

.minimized #chat-header *{
    position: relative;
    z-index: 2;
}

.minimized #chat-header::before{
    content: "";
    position: absolute;
    z-index: 1;

    top: 50%;
    left: 50%;

    width: 22%;
    min-width: 70px;
    max-width: 140px;
    height: 460%;

    background: linear-gradient(
            110deg,
            rgba(255,255,255,0) 0%,
            rgba(255,255,255,0.18) 35%,
            rgba(255,255,255,0.85) 50%,
            rgba(255,255,255,0.18) 65%,
            rgba(255,255,255,0) 100%
    );

    transform: translate(-50%, -50%) rotate(25deg) translateX(-260%);
    filter: blur(8px);
    opacity: 0.95;

    transition: transform 1.9s cubic-bezier(.19,1,.22,1);
    pointer-events: none;
}

.minimized #chat-header:hover::before{
    transform: translate(-50%, -50%) rotate(25deg) translateX(260%);
}

.minimized #chat-header::before{
    animation: chatShine 6s infinite;
}

@keyframes chatShine{
    0%{
        transform: translate(-50%, -50%) rotate(25deg) translateX(-260%);
    }
    40%{
        transform: translate(-50%, -50%) rotate(25deg) translateX(260%);
    }
    100%{
        transform: translate(-50%, -50%) rotate(25deg) translateX(260%);
    }
}

@media screen and (max-width: 768px) {
    #chat-widget.minimized  {
        max-width: 110px!important;
        height: 95px!important;
        min-width:110px!important;
        text-align: center;
    }

    #chat-widget.minimized  #chat-header {
        flex-direction: column !important;
        height: 100%!important;
    }
}