.master-ara__toggle {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 999;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #facc15, #d81f26);
    color: #0f172a;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.85rem 1.4rem;
    box-shadow: 0 1.75rem 3rem rgba(8, 9, 10, 0.45);
    cursor: pointer;
}

.master-ara__toggle-icon {
    font-size: 1.25rem;
}

.master-ara__toggle:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.8);
    outline-offset: 3px;
}

.master-ara__toggle-label {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
}

.master-ara {
    position: fixed;
    bottom: 1rem; /* Adjusted to be closer to the bottom */
    right: 1.5rem;
    width: min(360px, calc(100vw - 2rem));
    max-height: 90vh; /* Ensure it fits within the viewport height */
    border-radius: 1.25rem;
    background: rgba(15, 23, 42, 0.96);
    color: #fff;
    box-shadow: 0 2rem 4rem rgba(8, 9, 10, 0.55);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1000; /* Increased z-index for the main panel */
}

.master-ara__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem 1.75rem;
    background: radial-gradient(circle at top left, rgba(248, 165, 9, 0.45), transparent 55%), rgba(15, 23, 42, 0.95);
}

.master-ara__eyebrow {
    margin: 0;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}

.master-ara__header h2 {
    margin: 0.25rem 0;
    font-family: var(--font-heading, "Rajdhani", sans-serif);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.master-ara__intro {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.75);
}

.master-ara__close {
    border: none;
    background: rgba(255, 255, 255, 0.12);
    color: inherit;
    border-radius: 999px;
    width: 70px; /* Further increased width */
    height: 40px; /* Increased height */
    font-size: 1rem; /* Further adjusted font size for "Close" text */
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex; /* Use flexbox for centering */
    align-items: center; /* Center vertically */
    justify-content: center; /* Center horizontally */
    padding: 0 10px; /* Add some padding */
    z-index: 1001; /* Further increased z-index */
}

.master-ara__close:hover,
.master-ara__close:focus-visible {
    background: rgba(255, 255, 255, 0.25);
}

.master-ara__messages {
    padding: 1.25rem 1.75rem;
    display: grid;
    gap: 1rem;
    max-height: 320px;
    overflow-y: auto;
}

.master-ara__message {
    display: flex;
}

.master-ara__message--bot {
    justify-content: flex-start;
}

.master-ara__message--user {
    justify-content: flex-end;
}

.master-ara__bubble {
    padding: 0.85rem 1rem;
    border-radius: 1rem;
    font-size: 0.95rem;
    line-height: 1.45;
    max-width: 85%;
}

.master-ara__message--bot .master-ara__bubble {
    background: rgba(255, 255, 255, 0.08);
}

.master-ara__message--user .master-ara__bubble {
    background: linear-gradient(135deg, #facc15, #f97316);
    color: #0f172a;
    font-weight: 600;
}

.master-ara__quick-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.master-ara__quick-btn {
    border: none;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    cursor: pointer;
}

.master-ara__form {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: 1rem 1.75rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.master-ara__label {
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}

.master-ara__input {
    resize: vertical;
    min-height: 60px;
    border-radius: 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    background: rgba(15, 23, 42, 0.75);
    color: inherit;
}

.master-ara__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: space-between;
}

.master-ara__send {
    border: none;
    background: linear-gradient(135deg, #facc15, #d81f26);
    color: #0f172a;
    font-weight: 700;
    padding: 0.75rem 1.4rem;
    border-radius: 999px;
    cursor: pointer;
}

.master-ara__email {
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: inherit;
    padding: 0.75rem 1.4rem;
    border-radius: 999px;
    cursor: pointer;
}

.master-ara__form.is-busy .master-ara__send {
    opacity: 0.65;
    pointer-events: none;
}

@media (max-width: 600px) {
    .master-ara__toggle {
        bottom: 1rem;
        right: 1rem;
    }

    .master-ara {
        bottom: 0.5rem; /* Adjusted for smaller screens */
        right: 1rem;
        width: min(320px, calc(100vw - 2rem));
        max-height: 90vh; /* Ensure it fits within the viewport height */
    }

    .master-ara__messages {
        max-height: 260px;
    }
}

/* Ensure hidden attribute works correctly */
[hidden] {
    display: none !important;
}

.master-ara__feedback-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    justify-content: flex-end; /* Align feedback buttons to the right */
}

.master-ara__feedback-btn {
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.master-ara__feedback-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}
