/* Fixed right-side Ask Anything panel */
.gnw-ask-panel {
    position: fixed;
    bottom: 12px;
    z-index: 9990;
    width: min(360px, calc(100vw - 24px));
    max-height: min(520px, calc(100vh - 24px));
    display: flex;
    flex-direction: column;
    background: linear-gradient(165deg, #fffef8 0%, #f4f0e6 100%);
    border: 1px solid #d8cfb8;
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(45, 74, 28, 0.18);
    font-family: 'Ubuntu', sans-serif;
    overflow: hidden;
}

.gnw-ask-panel--collapsed .gnw-ask-panel__body {
    display: none;
}

.gnw-ask-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    background: linear-gradient(90deg, #2d4a1c 0%, #5a8f14 55%, #c9a227 100%);
    color: #fff;
}

.gnw-ask-panel__title {
    font-weight: 600;
    font-size: 0.95rem;
}

.gnw-ask-panel__actions {
    display: flex;
    gap: 0.35rem;
}

.gnw-ask-btn-icon {
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0;
}

.gnw-ask-btn-icon:hover {
    background: rgba(255, 255, 255, 0.35);
}

.gnw-ask-panel__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 0.5rem;
}

.gnw-ask-tabs {
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.45rem;
}

.gnw-ask-tab {
    flex: 1;
    border: 1px solid #c5b89a;
    background: #fff;
    border-radius: 8px;
    padding: 0.35rem 0.4rem;
    font-size: 0.72rem;
    cursor: pointer;
    color: #3d4228;
    min-width: 0;
}

.gnw-ask-hint {
    font-size: 0.78rem;
    color: #5c6178;
    margin: 0 0 0.35rem;
    line-height: 1.35;
}

.gnw-ask-new-topic {
    align-self: flex-start;
    border: 1px solid #c5b89a;
    background: #fff;
    color: #2d4a1c;
    font-size: 0.72rem;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 0.4rem;
}

.gnw-ask-new-topic:hover {
    background: #f0f8e8;
}

.gnw-ask-input--blocked {
    border-color: #c62828 !important;
    background: #fff5f5;
}

.gnw-ask-blocked-msg {
    color: #c62828;
    font-size: 0.82rem;
    margin: 0 0 0.35rem;
}

.gnw-ask-tab--active {
    background: #2d4a1c;
    border-color: #2d4a1c;
    color: #fff;
}

.gnw-ask-messages-wrap {
    flex: 1;
    min-height: 200px;
    max-height: 340px;
    margin-bottom: 0.45rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.gnw-ask-messages {
    flex: 1;
    overflow-y: auto;
    min-height: 200px;
    max-height: 340px;
    padding: 0.35rem;
    background: #fff;
    border: 1px solid #e8e0d0;
    border-radius: 10px;
    font-size: 0.88rem;
}

.gnw-ask-messages--panel[hidden] {
    display: none !important;
}

.gnw-ask-messages--modal {
    min-height: 240px;
    max-height: 50vh;
}

.gnw-ask-msg {
    margin-bottom: 0.65rem;
    line-height: 1.45;
}

.gnw-ask-msg--user {
    text-align: right;
}

.gnw-ask-msg--user .gnw-ask-bubble {
    display: inline-block;
    background: #e8f4d8;
    border-radius: 10px 10px 2px 10px;
    padding: 0.4rem 0.6rem;
    max-width: 92%;
    text-align: left;
}

.gnw-ask-msg--bot .gnw-ask-bubble {
    background: #f6f3ea;
    border-left: 3px solid #79b91c;
    padding: 0.45rem 0.55rem;
    border-radius: 4px 10px 10px 4px;
}

.gnw-ask-msg--loading {
    color: #6b7058;
    font-style: italic;
}

.gnw-ask-result {
    display: block;
    margin-top: 0.35rem;
    padding: 0.35rem 0.45rem;
    background: #fff;
    border: 1px solid #ece5d5;
    border-radius: 8px;
    color: #2d4a1c;
    text-decoration: none;
    font-size: 0.82rem;
}

.gnw-ask-result:hover {
    background: #f0f8e8;
    text-decoration: none;
}

.gnw-ask-result small {
    display: block;
    color: #5c6178;
    margin-top: 0.15rem;
}

.gnw-ask-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.gnw-ask-form input[type="text"] {
    flex: 1 1 140px;
    min-width: 0;
    border: 1px solid #c5b89a;
    border-radius: 8px;
    padding: 0.45rem 0.55rem;
    font-size: 0.88rem;
}

.gnw-ask-source {
    flex: 0 0 auto;
    border-radius: 8px;
    border: 1px solid #c5b89a;
    font-size: 0.8rem;
    padding: 0.35rem;
}

.gnw-ask-source[hidden] {
    display: none !important;
}

.gnw-ask-send {
    flex: 0 0 40px;
    height: 38px;
    border: none;
    border-radius: 8px;
    background: #2d4a1c;
    color: #fff;
    cursor: pointer;
}

.gnw-ask-send:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* Gurbani modal */
.gnw-ask-modal[hidden] {
    display: none !important;
}

.gnw-ask-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.gnw-ask-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(30, 35, 25, 0.55);
}

.gnw-ask-modal__dialog {
    position: relative;
    width: min(560px, 100%);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: #fffef8;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    padding: 1rem 1.1rem 1.1rem;
    overflow: hidden;
}

.gnw-ask-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.gnw-ask-modal__head h2 {
    margin: 0;
    font-size: 1.15rem;
    color: #2d4a1c;
}

.gnw-ask-modal__hint {
    font-size: 0.85rem;
    color: #5c6178;
    margin: 0.5rem 0 0.65rem;
}

@media (max-width: 991px) {
    .gnw-ask-panel {
        right: 8px;
        bottom: 8px;
        width: min(320px, calc(100vw - 16px));
    }
}

@media (max-width: 575px) {
    .gnw-ask-panel {
        left: 8px;
        right: 8px;
        width: auto;
    }
}
