#srai-widget {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 999999;
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

#srai-toggle {
    width: 72px;
    height: 72px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 28px;
    background: linear-gradient(135deg, #2e7d32, #4caf50);
    color: #fff;
    box-shadow: 0 12px 30px rgba(46, 125, 50, 0.35);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
    position: relative;
    z-index: 2;
}

#srai-toggle:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 16px 36px rgba(46, 125, 50, 0.45);
}

#srai-chat {
    position: fixed;
    right: 25px;
    bottom: 110px;
    width: 380px;
    max-width: calc(100vw - 24px);
    max-height: calc(100vh - 170px);
    height: min(420px, calc(100vh - 170px));
    background: #ffffff;
    border-radius: 22px;
    overflow: hidden;
    display: none;
    border: 1px solid rgba(76, 175, 80, 0.18);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
    pointer-events: auto;
    display: flex;
    flex-direction: column;
}

.srai-header {
    background: linear-gradient(135deg, #1b5e20, #4caf50);
    color: #fff;
    padding: 16px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding-right: 52px;
}

.srai-header-title-wrap {
    display: flex;
    gap: 12px;
    align-items: center;
}

.srai-header-icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.srai-header-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.srai-header-subtitle {
    font-size: 11px;
    opacity: 0.9;
    margin-top: 2px;
}

#srai-close {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 12px;
    right: 12px;
}

#srai-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

#srai-messages {
    height: 280px;
    max-height: calc(100vh - 220px);
    overflow-y: auto;
    padding: 16px;
    background: linear-gradient(180deg, #f9fbf9, #f3f7f3);
    flex: 1 1 auto;
}

.srai-message {
    display: flex;
    margin-bottom: 12px;
}

.srai-message.ai {
    justify-content: flex-start;
}

.srai-message.user {
    justify-content: flex-end;
}

.bubble {
    max-width: 82%;
    padding: 12px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

.srai-message.ai .bubble {
    background: #ffffff;
    border: 1px solid #e4ebe5;
    color: #1f2937;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
}

.srai-message.user .bubble {
    background: linear-gradient(135deg, #2e7d32, #4caf50);
    color: #ffffff;
}

.srai-footer {
    padding: 14px;
    background: #ffffff;
    border-top: 1px solid #edf1ed;
}

#srai-search-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

#srai-ingredients {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid #d7e0d7;
    background: #f9fbf9;
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
}

#srai-ingredients:focus {
    border-color: #4caf50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.14);
}

#srai-search-form button {
    width: 46px;
    height: 46px;
    border: none;
    background: linear-gradient(135deg, #2e7d32, #4caf50);
    color: #fff;
    border-radius: 12px;
    cursor: pointer;
    font-size: 16px;
    flex-shrink: 0;
    box-shadow: 0 10px 22px rgba(46, 125, 50, 0.25);
}

#srai-search-form button:hover {
    transform: translateY(-1px);
}

.srai-typing {
    opacity: 0.76;
    font-style: italic;
}

.srai-recipe-card {
    margin-top: 12px;
    border: 1px solid #dbe7dc;
    border-radius: 14px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
    cursor: pointer;
}

.srai-recipe-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
    background: #eef4ef;
}

.srai-recipe-content {
    padding: 12px;
}

.srai-recipe-meta {
    margin-top: 6px;
    font-size: 12px;
    color: #4caf50;
    font-weight: 700;
}

.srai-recipe-detail {
    display: none;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e7efe7;
}

.srai-recipe-detail-title {
    font-size: 13px;
    font-weight: 700;
    color: #1b5e20;
    margin-bottom: 8px;
}

.srai-recipe-description {
    margin: 0 0 12px;
    color: #4b5563;
    font-size: 13px;
}

.srai-recipe-section {
    margin-bottom: 12px;
}

.srai-recipe-section strong {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    color: #1f2937;
}

.srai-recipe-section span,
.srai-recipe-section li {
    font-size: 13px;
    color: #4b5563;
}

.srai-recipe-list {
    margin: 0;
    padding-left: 18px;
}

.srai-recipe-empty {
    margin: 0;
    color: #6b7280;
    font-size: 13px;
}

@media (max-width: 600px) {
    #srai-widget {
        bottom: 16px;
        right: 16px;
    }

    #srai-chat {
        width: min(92vw, 360px);
        right: 16px;
        bottom: 98px;
        max-height: calc(100vh - 120px);
        height: min(380px, calc(100vh - 120px));
    }

    #srai-messages {
        height: 235px;
        max-height: calc(100vh - 190px);
    }
}
