.chatbox {
    padding: 10px 20px;
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: calc(100% - 280px);
    box-sizing: border-box;
    width: calc(100% - 120px);
    margin-top: 60px;
    margin-left: 60px;
    margin-right: 60px;
    overflow: none;
    box-sizing: border-box;
}

.messages-container {
    overflow-y: auto;
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.input-container {
    display: flex;
    justify-content: space-between;
    padding-top: 2px;
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 20px;
}

#userInput {
    flex-grow: 1;
    margin-right: 10px;
    padding: 10px;
    height: 40px;
    font-size: 18px;
    border-radius: 3px;
    border: 2px solid #E591A7;
    transition: height 0.3s;
}

#userInput:focus {
    outline: 2px solid #E591A7;
}

.custom-chat-button {
    border: none;
    background-color: transparent;
    cursor: pointer;
}

.custom-chat-button img {
    width: 34px;
    height: auto;
    transition: height 0.3s;
}

.chatbox-footer {
    text-align: center;
    font-size: 16px;
    color: #FBD7DF;
    background-color: transparent;
    margin-bottom: 10px;
    margin-top: 10px;
    padding: 10px;
    width: calc(100% - 20px);
    resize: none;
}

.chat-bubble {
    position: relative;
    padding-top: 10px;
    padding-bottom: 10px;
    padding-right: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 16px;
    max-width: 55%;
    min-width: 150px;
    display: grid;
    grid-template-columns: 20px 1fr;
    grid-template-rows: repeat(3, auto);
    gap: 5px 50px;
    color: #000;
}

.chat-bubble img {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 40px;
}

.chat-bubble-title,
.chat-bubble-time,
.chat-bubble-text,
.chat-bubble-cyclibtool-title-success,
.chat-bubble-cyclibtool-title-caution,
.chat-bubble-cyclibtool-title-high {
    grid-column: 2;
    font-size: 16px;
}

.chat-bubble-title {
    color: #747474;
    font-weight: bold;
}

.chat-bubble-time {
    color: #000;
    font-size: 16px;
    font-weight: bold;
}

.chat-bubble-text {
    font-size: 16px;
    margin-top: 5px;
    margin-bottom: 0px;
}

.chat-bubble-text ul,
.chat-bubble-text ol {
    margin: 8px 0 8px 20px;
    padding: 0;
}

.chat-bubble-text li {
    margin-bottom: 4px;
}

.chat-bubble-text a {
    color: #2c6cb0;
    text-decoration: underline;
    word-break: break-word;
}

.chat-bubble-text pre {
    background-color: #f4f4f4;
    border-radius: 6px;
    padding: 10px;
    overflow-x: auto;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 14px;
    margin: 10px 0;
}

.chat-bubble-text code {
    background-color: #f4f4f4;
    border-radius: 4px;
    padding: 2px 4px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 14px;
}

.chat-bubble-text blockquote {
    border-left: 4px solid #d0d0d0;
    margin: 10px 0;
    padding: 8px 12px;
    background-color: #fafafa;
    color: #555555;
}

.chat-bubble-text .md-heading {
    margin: 8px 0;
}

.chat-bubble-user {
    background-color: #CCCCCC;
    align-self: flex-end;
}
.chat-bubble-user .chat-bubble-time {
    margin-top: 10px;
}

.chat-bubble-cyclibtool {
    background-color: #e2e1e2;
}

.chat-bubble-cyclibtool-success {
    background-color: #DBE5BD;
}
.chat-bubble-cyclibtool-title-success {
    color: #7DAC11;
    font-weight: bold;
}

.chat-bubble-cyclibtool-caution {
    background-color: #F4E1B8;
}
.chat-bubble-cyclibtool-title-caution {
    color: #DD9B36;
    font-weight: bold;
}

.chat-bubble-cyclibtool-high {
    background-color: #E9B5B9;
}

.chat-bubble-cyclibtool-title-high {
    color: #D70011;
    font-weight: bold;
}

.chat-bubble--card {
    display: block;
    width: auto;
    max-width: 60%;
    margin: 0 0 24px 0;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 0;
    gap: 0;
    min-width: auto;
    grid-template-columns: none;
    grid-template-rows: none;
    align-self: flex-start;
}

.chat-bubble--card > img,
.chat-bubble--card .chat-bubble-title,
.chat-bubble--card .chat-bubble-time {
    display: none !important;
}

.chat-bubble--card .chat-bubble-text {
    width: 100%;
    margin: 0;
    padding: 0;
}
.chat-bubble--card > div {
    width: 100%;
}
.autocomplete-items {
    position: absolute;
    border: 1px solid #d4d4d4;
    background: white;
    box-sizing: border-box;
    border-bottom: none;
    border-top: none;
    z-index: 1000;
    width: 100%;
    top: 10%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
}

.autocomplete-item.active {
    background-color: #f0f0f0;
}

.autocomplete-items div {
    padding: 10px;
    cursor: pointer;
    background-color: #fff;
    border-bottom: 1px solid #d4d4d4;
}

.autocomplete-items div:hover {
    background-color: #e9e9e9;
}


@keyframes dotAnimation {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0;
    }
    30% {
        transform: scale(1.2);
        opacity: 1;
    }
    60% {
        transform: scale(1);
        opacity: 0.6;
    }
}

.dot-anim {
    display: inline-block;
    margin-left: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: black;
}

.dot-anim:nth-child(1) {
    animation: dotAnimation 1.2s infinite;
}

.dot-anim:nth-child(2) {
    animation: dotAnimation 1.2s infinite 0.2s;
}

.dot-anim:nth-child(3) {
    animation: dotAnimation 1.2s infinite 0.4s;
}

@media (max-width: 768px) {
    .chat-bubble {
        max-width: 100%;
        min-width: 150px;
        gap: 5px 50px;
    }
    .chatbox {
        height: calc(100% - 180px);
        margin-top: 60px;
        margin-left: 5px;
        margin-right: 5px;
        margin-bottom: 0px;
        width: calc(100% - 10px);
    }
    .chatbox-footer {
        font-size: 8px;
        margin-top: 5px;
        margin-left: 0px;
        margin-right: 0px;
        height: 30px;
        margin-bottom: 5px;
        width: calc(100% - 30px);
    }
    
    .input-container {
        padding-bottom: 2px;
    }
    #userInput {
        height: 20px;
        font-size: 14px;
    }

    .custom-chat-button img {
        width: 26px;
        height: auto;
    }
    .chat-bubble--card {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    .interaction-card {
        max-width: 100%;
        padding: 22px 24px;
    }
}

.interaction-card-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: auto;
    align-items: flex-start;
}

.interaction-card {
    border-radius: 28px;
    background: #f7f4ec;
    padding: 26px 32px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin: 0;
    box-shadow: 0 18px 32px rgba(0, 0, 0, 0.08);
}

.chat-bubble-cyclibtool-success .interaction-card {
    background: #DBE5BD;
}

.chat-bubble-cyclibtool-caution .interaction-card {
    background: #F4E1B8;
}

.chat-bubble-cyclibtool-high .interaction-card {
    background: #E9B5B9;
}

.interaction-card__header {
    display: flex;
    align-items: center;
    gap: 14px;
}

.interaction-card__logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: url("/images/chat/bubble-cyclibtool-logo.png") center/contain no-repeat;
    flex-shrink: 0;
}

.interaction-card__brand {
    font-size: 15px;
    font-weight: 600;
    color: #d9a137;
    text-decoration: underline dotted;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.chat-bubble-cyclibtool-success .interaction-card__logo,
.chat-bubble-cyclibtool-success .interaction-card__brand {
    color: #7DAC11;
}

.chat-bubble-cyclibtool-success .interaction-card__logo {
    background-image: url("/images/chat/bubble-cyclibtool-success-logo.png");
}

.chat-bubble-cyclibtool-caution .interaction-card__logo,
.chat-bubble-cyclibtool-caution .interaction-card__brand {
    color: #DD9B36;
}

.chat-bubble-cyclibtool-caution .interaction-card__logo {
    background-image: url("/images/chat/bubble-cyclibtool-caution-logo.png");
}

.chat-bubble-cyclibtool-high .interaction-card__logo,
.chat-bubble-cyclibtool-high .interaction-card__brand {
    color: #D70011;
}

.chat-bubble-cyclibtool-high .interaction-card__logo {
    background-image: url("/images/chat/bubble-cyclibtool-high-logo.png");
}

.interaction-card__chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #82662a;
    background: rgba(0, 0, 0, 0.08);
    width: fit-content;
}

.interaction-card__body {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.interaction-card__entry {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.interaction-card__entry--divider {
    padding-top: 18px;
    border-top: 1px solid rgba(0, 0, 0, 0.18);
}

.interaction-card__title-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: baseline;
}

.interaction-card__title {
    font-weight: 700;
    font-size: 20px;
    color: #1f1f1f;
    letter-spacing: 0.01em;
    line-height: 1.2;
}

.interaction-card__subtitle {
    font-size: 12px;
    color: #4d4d4d;
    line-height: 1.2;
}

.interaction-card__rationale {
    margin-top: 6px;
    font-size: 14px;
    color: #2f2f2f;
    line-height: 1.6;
}

.interaction-card__rationale-label {
    font-weight: 600;
    text-decoration: underline;
    margin-right: 4px;
}

.interaction-card__rationale-text {
    color: #2b2b2b;
}

.interaction-card__rationale-text p {
    margin: 4px 0;
    line-height: 1.5;
}

.interaction-card__unresolved {
    margin-top: 12px;
    font-size: 13px;
    color: #8b1d1d;
}

.chat-bubble-rating {
    background: transparent;
    box-shadow: none;
}

.chat-bubble-rating.chat-bubble--card {
    max-width: 60%;
    width: 100%;
}

.rating-card-wrapper {
    width: 100%;
    display: block;
}

.rating-card {
    background: #ffffff;
    border: 1px solid #e4e7ec;
    box-shadow: 0 24px 50px rgba(15, 23, 42, 0.08);
    width: 100%;
    box-sizing: border-box;
}

.rating-card__header .interaction-card__brand {
    color: #a855f7;
    text-decoration: none;
    letter-spacing: 0.12em;
}

.rating-card__logo {
    background-image: url("/images/chat/bubble-cyclibtool-logo.png");
    filter: grayscale(10%);
}

.rating-card__body {
    gap: 18px;
}

.rating-card__headline {
    margin: 0;
    font-size: 19px;
    font-weight: 600;
    color: #101828;
}

.rating-card__description {
    margin: 0;
    font-size: 15px;
    color: #475467;
}

.rating-card__scale {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rating-card__scale-track {
    position: relative;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #e9edf5;
    overflow: hidden;
}

.rating-card__scale-track::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.rating-card__scale-fill {
    position: absolute;
    inset: 0;
    width: 0;
    background: linear-gradient(90deg, #0ea5e9, #6366f1);
    transition: width 0.3s ease;
}

.rating-card__scale-dots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(56px, 1fr));
    gap: 10px;
    width: 100%;
}

.rating-card__scale-dot {
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: #ffffff;
    color: #0f172a;
    width: 100%;
    height: 48px;
    border-radius: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.rating-card__scale-dot:hover,
.rating-card__scale-dot:focus-visible {
    border-color: #a855f7;
    color: #a855f7;
    transform: translateY(-1px);
    outline: none;
    box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.25);
}

.rating-card__scale-dot--active {
    background: linear-gradient(135deg, #ec4899, #8b5cf6);
    border-color: transparent;
    color: #ffffff;
    box-shadow: 0 20px 34px rgba(139, 92, 246, 0.35);
}

.rating-card--submitted .rating-card__scale-dot {
    cursor: default;
}

.rating-card--submitted .rating-card__scale-dot:not(.rating-card__scale-dot--active) {
    opacity: 0.6;
}

.rating-card__thanks {
    margin: 8px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    color: #0f172a;
    background: #f7fef9;
    border-left: 3px solid #16a34a;
    border: 1px solid #d1fae5;
    padding: 12px 16px;
    border-radius: 14px;
}

.rating-card__thanks::before {
    content: "✓";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #16a34a;
    color: #fff;
    font-size: 12px;
}
