:root {
    --aira-primary: #6366f1;
    --aira-primary-rgb: 99, 102, 241;
    --aira-text: #1f2937;
    --aira-text-light: #6b7280;
    --aira-bg: #ffffff;
    --aira-bg-secondary: #f9fafb;
    --aira-border: #e5e7eb;
    --aira-error: #ef4444;
    --aira-success: #10b981;
    --aira-radius: 12px;
    --aira-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --aira-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

* {
    box-sizing: border-box;
}

.aira-ai-chat-wrapper {
    font-family: var(--aira-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif);
    line-height: 1.6;
    color: var(--aira-text);
}

/* ===== Section Container (matches design page demo) ===== */
.aira-sec-container {
    max-width: 600px;
    margin: 30px auto;
    background: var(--aira-bg);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: var(--aira-container-border, none);
}

.aira-sec-header {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    min-height: 56px;
    color: var(--aira-header-text, #ffffff);
}

.aira-sec-header.aira-header-center {
    justify-content: center;
    text-align: center;
    flex-direction: column;
    gap: 2px;
}

.aira-sec-header > * {
    position: relative;
    z-index: 1;
}

.aira-sec-hdr-bg {
    position: absolute !important;
    inset: 0 !important;
    z-index: 0 !important;
    background: var(--aira-header-bg, var(--aira-primary));
    background-size: cover;
    background-position: center;
}

.aira-sec-logo {
    max-width: var(--aira-logo-size, 36px);
    max-height: var(--aira-logo-size, 36px);
    width: auto;
    height: auto;
    border-radius: var(--aira-logo-radius, 50%);
    object-fit: contain;
    flex-shrink: 0;
}

.aira-sec-title-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.aira-sec-header.aira-header-center .aira-sec-title-wrap {
    flex: none;
    align-items: center;
}

.aira-sec-title {
    font-weight: 700;
    font-size: var(--aira-title-font-size, 18px);
    line-height: 1.3;
}

.aira-sec-subtitle {
    font-size: var(--aira-subtitle-font-size, 13px);
    opacity: 0.8;
    font-weight: 400;
    line-height: 1.3;
    margin-top: 2px;
}

.aira-sec-subtitle:empty {
    display: none;
}

.aira-sec-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 300px;
    max-height: 400px;
    overflow-y: auto;
}

.aira-sec-welcome .aira-widget-message {
    display: flex;
}

.aira-sec-welcome .aira-widget-bubble {
    max-width: 85%;
    padding: 10px 14px;
    font-size: var(--aira-font-size, 14px);
    line-height: 1.45;
    background: var(--aira-ai-bubble-bg, #f3f4f6);
    color: var(--aira-ai-bubble-text, #1f2937);
    border-radius: var(--aira-msg-ai-radius, 12px 12px 12px 4px);
    box-shadow: var(--aira-msg-shadow, none);
}

/* Section Form Fields */
.aira-sec-form-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 20px 16px;
}

.aira-sec-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.aira-sec-field label {
    font-size: 12px;
    font-weight: 600;
    color: var(--aira-text);
    text-align: left;
}

.aira-required {
    color: var(--aira-error);
    margin-left: 2px;
}

.aira-sec-field input,
.aira-sec-field textarea,
.aira-sec-field select {
    width: 100%;
    padding: 10px 14px;
    font-size: var(--aira-font-size, 14px);
    border: var(--aira-ff-border, 1px solid var(--aira-border));
    border-radius: var(--aira-ff-radius, 8px);
    background: var(--aira-ff-bg, var(--aira-bg));
    color: var(--aira-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
    border-bottom: var(--aira-ff-bb, none);
}

.aira-sec-field input:focus,
.aira-sec-field textarea:focus,
.aira-sec-field select:focus {
    outline: none;
    border-color: var(--aira-primary);
    box-shadow: 0 0 0 3px rgba(var(--aira-primary-rgb), 0.15);
}

.aira-sec-field input::placeholder,
.aira-sec-field textarea::placeholder {
    color: var(--aira-text-light);
}

.aira-sec-input-wrap textarea::placeholder {
    color: var(--aira-text-light);
}

.aira-sec-field textarea {
    resize: none;
    min-height: 60px;
}

.aira-sec-field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 44px;
}

.aira-sec-fields-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: #ffffff;
    background: var(--aira-primary);
    border: none;
    border-radius: 100px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    align-self: center;
    min-width: 160px;
}

.aira-sec-fields-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--aira-primary-rgb), 0.4);
}

.aira-sec-fields-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Section Social Links */
.aira-sec-social {
    display: flex;
    gap: var(--aira-social-gap, 6px);
    padding: 10px 20px;
    justify-content: center;
    border-top: 1px solid var(--aira-border);
}

.aira-sec-social a {
    width: var(--aira-social-icon-size, 32px);
    height: var(--aira-social-icon-size, 32px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--aira-primary);
    transition: all 0.2s;
}

.aira-sec-social a:hover {
    transform: scale(1.15);
    color: var(--aira-text);
}

.aira-sec-social a svg {
    width: 16px;
    height: 16px;
}

/* Section Footer (input + send) */
.aira-sec-footer {
    padding: 12px 20px;
    border-top: 1px solid var(--aira-border);
    background: var(--aira-bg);
}

.aira-sec-input-wrap {
    display: flex;
    gap: 8px;
    align-items: center !important;
}

.aira-sec-input-wrap textarea {
    flex: 1;
    padding: 10px 14px;
    border: var(--aira-input-border, 1px solid var(--aira-border));
    border-radius: var(--aira-input-radius, 10px);
    background: var(--aira-input-bg, #fff);
    color: var(--aira-input-text, var(--aira-text));
    box-shadow: var(--aira-input-shadow, none);
    font-size: var(--aira-font-size, 14px);
    font-family: inherit;
    resize: none;
    min-height: 40px;
    max-height: 100px;
    line-height: 1.4;
}

.aira-sec-input-wrap textarea:focus {
    outline: none;
    border-color: var(--aira-primary);
}

.aira-sec-send {
    padding: 10px 18px;
    background: var(--aira-primary);
    color: #fff;
    border: none;
    border-radius: var(--aira-input-radius, 10px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
    font-weight: 600;
    font-size: var(--aira-font-size, 13px);
    font-family: inherit;
    white-space: nowrap;
}

.aira-sec-send:hover {
    filter: brightness(1.1);
}

.aira-sec-send:active {
    transform: scale(0.95);
}

.aira-sec-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Section inline messages (reuse widget bubble styles) */
.aira-sec-body .aira-widget-message {
    display: flex;
}

.aira-sec-body .aira-widget-message.user {
    justify-content: flex-end;
}

.aira-sec-body .aira-widget-bubble {
    max-width: 85%;
    padding: 10px 14px;
    font-size: var(--aira-font-size, 14px);
    font-weight: var(--aira-font-weight, 400);
    line-height: var(--aira-line-height, 1.5);
    word-wrap: break-word;
}

.aira-sec-body .aira-widget-message.ai .aira-widget-bubble {
    background: var(--aira-ai-bubble-bg, #f3f4f6);
    color: var(--aira-ai-bubble-text, #1f2937);
    border-radius: var(--aira-msg-ai-radius, 12px 12px 12px 4px);
    box-shadow: var(--aira-msg-shadow, none);
}

.aira-sec-body .aira-widget-message.user .aira-widget-bubble {
    background: var(--aira-user-bubble-bg, var(--aira-primary));
    color: var(--aira-user-bubble-text, #ffffff);
    border-radius: var(--aira-msg-user-radius, 12px 12px 4px 12px);
    box-shadow: var(--aira-msg-shadow, none);
}

.aira-sec-body .aira-widget-typing {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: var(--aira-ai-bubble-bg, #f3f4f6);
    border-radius: var(--aira-msg-ai-radius, 12px 12px 12px 4px);
    width: fit-content;
}

.aira-sec-body .aira-widget-typing span {
    width: 8px;
    height: 8px;
    background: var(--aira-text-light);
    border-radius: 50%;
    animation: aira-bounce 1.4s ease-in-out infinite both;
}

.aira-sec-body .aira-widget-typing span:nth-child(1) { animation-delay: -0.32s; }
.aira-sec-body .aira-widget-typing span:nth-child(2) { animation-delay: -0.16s; }
.aira-sec-body .aira-widget-typing span:nth-child(3) { animation-delay: 0s; }

/* Legacy form group (keep for backward compat) */
.aira-ai-chat-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.aira-submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    background: var(--aira-primary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    margin-top: 8px;
}

.aira-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--aira-primary-rgb), 0.4);
}

.aira-submit-btn:active {
    transform: translateY(0);
}

.aira-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.aira-spinner {
    width: 20px;
    height: 20px;
    animation: aira-spin 1s linear infinite;
}

@keyframes aira-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.aira-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.aira-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.aira-modal {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    background: var(--aira-bg);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.aira-modal-overlay.active .aira-modal {
    transform: scale(1) translateY(0);
}

.aira-modal-inner {
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.aira-modal-hdr {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    min-height: 56px;
    color: var(--aira-header-text, #ffffff);
}

.aira-modal-hdr > * {
    position: relative;
    z-index: 1;
}

.aira-modal-hdr-bg {
    position: absolute !important;
    inset: 0 !important;
    z-index: 0 !important;
    background: var(--aira-header-bg, var(--aira-primary));
    background-size: cover;
    background-position: center;
}

.aira-modal-logo {
    max-width: var(--aira-logo-size, 36px);
    max-height: var(--aira-logo-size, 36px);
    width: auto;
    height: auto;
    border-radius: var(--aira-logo-radius, 50%);
    object-fit: contain;
}

.aira-modal-title-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.aira-modal-title {
    font-weight: 700;
    font-size: 16px;
    line-height: 1.3;
}

.aira-modal-subtitle {
    font-size: var(--aira-subtitle-font-size, 11px);
    opacity: 0.8;
    font-weight: 400;
    line-height: 1.3;
    margin-top: 1px;
}

.aira-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: inherit;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: background 0.2s;
    z-index: 10;
    flex-shrink: 0;
}

.aira-modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.aira-modal-social {
    display: flex;
    gap: var(--aira-social-gap, 6px);
    padding: 10px 20px;
    justify-content: center;
    border-top: 1px solid var(--aira-border);
}

.aira-modal-social a {
    width: var(--aira-social-icon-size, 32px);
    height: var(--aira-social-icon-size, 32px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--aira-primary);
    transition: all 0.2s;
}

.aira-modal-social a:hover {
    transform: scale(1.15);
    color: var(--aira-text);
}

.aira-modal-social a svg {
    width: 16px;
    height: 16px;
}

.aira-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    max-height: 400px;
}

.aira-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.aira-loading-dots {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.aira-loading-dots span {
    width: 12px;
    height: 12px;
    background: var(--aira-primary);
    border-radius: 50%;
    animation: aira-bounce 1.4s ease-in-out infinite both;
}

.aira-loading-dots span:nth-child(1) { animation-delay: -0.32s; }
.aira-loading-dots span:nth-child(2) { animation-delay: -0.16s; }
.aira-loading-dots span:nth-child(3) { animation-delay: 0s; }

@keyframes aira-bounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes aira-typing-bounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.aira-loading p {
    margin: 0;
    color: var(--aira-text-light);
    font-size: 0.875rem;
}

.aira-response {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--aira-text);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.aira-response p {
    margin: 0 0 16px;
}

/* Modal Messages */
.aira-modal-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.aira-modal-message {
    display: flex;
    max-width: 85%;
}

.aira-modal-message.user {
    align-self: flex-end;
    justify-content: flex-end;
    max-width: 100%;
}

.aira-modal-message.ai {
    align-self: flex-start;
}

.aira-modal-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    line-height: 1.5;
    word-wrap: break-word;
    font-size: var(--aira-font-size, 14px);
}

.aira-modal-message.user .aira-modal-bubble {
    background: var(--aira-user-bubble-bg, var(--aira-primary));
    color: var(--aira-user-bubble-text, #fff);
    border-bottom-right-radius: 4px;
}

.aira-modal-message.ai .aira-modal-bubble {
    background: var(--aira-ai-bubble-bg, #f3f4f6);
    color: var(--aira-ai-bubble-text, var(--aira-text));
    border-bottom-left-radius: 4px;
}

.aira-modal-typing .aira-modal-bubble {
    padding: 16px 20px;
}

.aira-modal-typing .aira-loading-dots {
    margin: 0;
}

.aira-modal-typing .aira-loading-dots span {
    width: 8px;
    height: 8px;
}

.aira-modal-input {
    padding: 12px 20px;
    border-top: 1px solid var(--aira-border);
    background: var(--aira-bg);
}

.aira-modal-input-wrap {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.aira-modal-input-wrap textarea {
    flex: 1;
    padding: 10px 14px;
    border: var(--aira-input-border, 1px solid var(--aira-border));
    border-radius: var(--aira-input-radius, 10px);
    font-size: 14px;
    font-family: inherit;
    resize: none;
    max-height: 100px;
    line-height: 1.4;
    background: var(--aira-input-bg, #fff);
    color: var(--aira-input-text, var(--aira-text));
}

.aira-modal-input-wrap textarea:focus {
    outline: none;
    border-color: var(--aira-primary);
}

.aira-modal-input-wrap button {
    padding: 10px 18px;
    background: var(--aira-primary);
    color: #fff;
    border: none;
    border-radius: var(--aira-input-radius, 10px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
    font-weight: 600;
    font-size: 13px;
    white-space: nowrap;
}

.aira-modal-input-wrap button:hover {
    filter: brightness(1.1);
}

/* Widget Share Section */
.aira-widget-share {
    display: flex;
    gap: var(--aira-social-gap, 6px);
    padding: 10px 20px;
    justify-content: center;
    border-top: 1px solid var(--aira-border);
    background: var(--aira-bg);
}

/* Section Share Section */
.aira-sec-share {
    display: flex;
    gap: 6px;
    padding: 10px 20px;
    justify-content: center;
    border-top: 1px solid var(--aira-border);
    background: var(--aira-bg);
}

/* Inline Share Buttons (legacy per-message) */
.aira-inline-share {
    display: flex;
    gap: 6px;
    padding: 8px 0;
    margin-top: 8px;
}

.aira-widget-share .aira-share-btn,
.aira-sec-share .aira-share-btn,
.aira-inline-share .aira-share-btn,
.aira-client-social .aira-share-btn {
    width: var(--aira-social-icon-size, 32px);
    height: var(--aira-social-icon-size, 32px);
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
    color: #fff;
    position: relative;
}

.aira-widget-share .aira-share-twitter,
.aira-sec-share .aira-share-twitter,
.aira-inline-share .aira-share-twitter,
.aira-client-social .aira-share-twitter { background: #1da1f2; }

.aira-widget-share .aira-share-facebook,
.aira-sec-share .aira-share-facebook,
.aira-inline-share .aira-share-facebook,
.aira-client-social .aira-share-facebook { background: #1877f2; }

.aira-widget-share .aira-share-linkedin,
.aira-sec-share .aira-share-linkedin,
.aira-inline-share .aira-share-linkedin,
.aira-client-social .aira-share-linkedin { background: #0077b5; }

.aira-widget-share .aira-share-whatsapp,
.aira-sec-share .aira-share-whatsapp,
.aira-inline-share .aira-share-whatsapp,
.aira-client-social .aira-share-whatsapp { background: #25d366; }

.aira-widget-share .aira-share-copy,
.aira-sec-share .aira-share-copy,
.aira-inline-share .aira-share-copy,
.aira-client-social .aira-share-copy { background: #64748b; }

.aira-widget-share .aira-share-link,
.aira-sec-share .aira-share-link,
.aira-inline-share .aira-share-link,
.aira-client-social .aira-share-link { background: var(--aira-primary, #0053D4); }

.aira-widget-share .aira-share-btn:hover,
.aira-sec-share .aira-share-btn:hover,
.aira-inline-share .aira-share-btn:hover,
.aira-client-social .aira-share-btn:hover {
    transform: scale(1.15);
}

.aira-widget-share .aira-share-btn svg,
.aira-sec-share .aira-share-btn svg,
.aira-inline-share .aira-share-btn svg,
.aira-client-social .aira-share-btn svg {
    width: 16px;
    height: 16px;
    transition: opacity 0.2s;
}

.aira-widget-share .aira-share-btn.sharing svg,
.aira-sec-share .aira-share-btn.sharing svg,
.aira-inline-share .aira-share-btn.sharing svg,
.aira-client-social .aira-share-btn.sharing svg {
    opacity: 0;
}

.aira-widget-share .aira-share-btn.sharing::after,
.aira-sec-share .aira-share-btn.sharing::after,
.aira-inline-share .aira-share-btn.sharing::after,
.aira-client-social .aira-share-btn.sharing::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: airaShareSpin 0.6s linear infinite;
}

@keyframes airaShareSpin {
    to { transform: rotate(360deg); }
}

.aira-response p:last-child {
    margin-bottom: 0;
}

.aira-error {
    padding: 16px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    color: var(--aira-error);
    font-size: 0.875rem;
    text-align: center;
}

.aira-modal-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--aira-border);
    background: var(--aira-bg-secondary);
}

.aira-modal-share {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.aira-share-label {
    margin: 0 0 12px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--aira-text-light);
}

.aira-share-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.aira-share-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    color: #fff;
    position: relative;
}

.aira-modal-share .aira-share-twitter { background: #1da1f2; }
.aira-modal-share .aira-share-facebook { background: #1877f2; }
.aira-modal-share .aira-share-linkedin { background: #0077b5; }
.aira-modal-share .aira-share-whatsapp { background: #25d366; }
.aira-modal-share .aira-share-copy { background: #64748b; }
.aira-modal-share .aira-share-link { background: var(--aira-primary, #0053D4); }

.aira-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.aira-share-btn:active {
    transform: translateY(0);
}

.aira-share-btn svg {
    width: 20px;
    height: 20px;
    transition: opacity 0.2s;
}

.aira-share-btn.sharing svg {
    opacity: 0;
}

.aira-share-btn.sharing::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: airaShareSpin 0.6s linear infinite;
}

.aira-share-twitter { background: #1da1f2; color: #fff; }
.aira-share-facebook { background: #1877f2; color: #fff; }
.aira-share-linkedin { background: #0077b5; color: #fff; }
.aira-share-whatsapp { background: #25d366; color: #fff; }
.aira-share-copy { background: #64748b; color: #fff; }
.aira-share-link { background: var(--aira-primary, #0053D4); color: #fff; }

.aira-share-copy.copied {
    background: var(--aira-success, #22c55e);
    color: #ffffff;
}

.aira-try-again-btn {
    width: 100%;
    padding: 12px 24px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--aira-primary);
    background: transparent;
    border: 2px solid var(--aira-primary);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.aira-try-again-btn:hover {
    background: var(--aira-primary);
    color: #ffffff;
}

/* Shared Chat Popup */
#aira-shared-chat-popup {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aira-shared-popup-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(4px);
}

.aira-shared-popup-card {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    width: 90%;
    max-width: 480px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: airaSharedPopupIn 0.3s ease;
}

@keyframes airaSharedPopupIn {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.aira-shared-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--aira-primary, #0053D4);
    color: #fff;
}

.aira-shared-popup-title {
    font-weight: 700;
    font-size: 15px;
}

.aira-shared-popup-close {
    background: none;
    border: none;
    color: rgba(255,255,255,.8);
    font-size: 22px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.2s;
}

.aira-shared-popup-close:hover {
    color: #fff;
}

.aira-shared-popup-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.aira-shared-popup-msg {
    display: flex;
    max-width: 85%;
}

.aira-shared-popup-user {
    align-self: flex-end;
    justify-content: flex-end;
}

.aira-shared-popup-ai {
    align-self: flex-start;
}

.aira-shared-popup-bub {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.aira-shared-popup-user .aira-shared-popup-bub {
    background: var(--aira-primary, #0053D4);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.aira-shared-popup-ai .aira-shared-popup-bub {
    background: var(--aira-ai-bg, #f3f4f6);
    color: var(--aira-ai-text, #1f2937);
    border-bottom-left-radius: 4px;
}

.aira-shared-popup-footer {
    padding: 12px 20px;
    border-top: 1px solid #f1f5f9;
    text-align: center;
}

@media (max-width: 640px) {
    .aira-sec-container {
        margin: 15px auto;
        border-radius: 12px;
    }
    
    .aira-sec-field input,
    .aira-sec-field textarea,
    .aira-sec-field select {
        padding: 10px 12px;
        font-size: 16px;
    }
    
    .aira-modal {
        max-height: 95vh;
        margin: 10px;
    }
    
    .aira-modal-body {
        padding: 16px;
    }
    
    .aira-modal-footer {
        padding: 12px 16px;
    }
    
    .aira-share-btn {
        width: 36px;
        height: 36px;
    }
    
    .aira-share-btn svg {
        width: 16px;
        height: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .aira-modal-overlay,
    .aira-modal,
    .aira-submit-btn,
    .aira-share-btn,
    .aira-modal-close {
        transition: none;
    }
    
    .aira-spinner,
    .aira-loading-dots span {
        animation: none;
    }
}

/* Inline Response Mode */
.aira-inline-messages {
    margin-bottom: 20px;
    padding: 20px;
    background: var(--aira-bg-secondary);
    border-radius: var(--aira-radius);
    max-height: 400px;
    overflow-y: auto;
}

.aira-inline-message {
    margin-bottom: 12px;
    display: flex;
}

.aira-inline-message:last-child {
    margin-bottom: 0;
}

.aira-inline-message.user {
    justify-content: flex-end;
}

.aira-inline-bubble {
    max-width: 85%;
    padding: 12px 16px;
    font-size: var(--aira-font-size, 14px);
    font-weight: var(--aira-font-weight, 400);
    line-height: var(--aira-line-height, 1.5);
}

.aira-inline-message.ai .aira-inline-bubble {
    background: var(--aira-ai-bubble-bg, #f3f4f6);
    color: var(--aira-ai-bubble-text, #1f2937);
    border-radius: var(--aira-msg-ai-radius, 12px 12px 12px 4px);
    box-shadow: var(--aira-msg-shadow, none);
}

.aira-inline-message.user .aira-inline-bubble {
    background: var(--aira-user-bubble-bg, var(--aira-primary));
    color: var(--aira-user-bubble-text, #ffffff);
    border-radius: var(--aira-msg-user-radius, 12px 12px 4px 12px);
    box-shadow: var(--aira-msg-shadow, none);
}

.aira-inline-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--aira-ai-bubble-bg, #f3f4f6);
    border-radius: var(--aira-radius);
    border-bottom-left-radius: 4px;
}

.aira-inline-loading .aira-loading-dots {
    margin: 0;
}

.aira-inline-loading .aira-loading-dots span {
    width: 8px;
    height: 8px;
}

/* Floating Widget */
.aira-widget-wrapper {
    position: fixed;
    z-index: 999998;
    font-family: var(--aira-font, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    font-size: var(--aira-font-size, 14px);
    line-height: 1.5;
}

.aira-widget-wrapper.aira-position-bottom-right {
    bottom: 20px;
    right: 20px;
}

.aira-widget-wrapper.aira-position-bottom-left {
    bottom: 20px;
    left: 20px;
}

.aira-widget-btn {
    width: var(--aira-widget-size, 60px);
    height: var(--aira-widget-size, 60px);
    border-radius: 50%;
    background: var(--aira-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    padding: 15px 0px !important;
}

.aira-widget-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.aira-widget-btn svg {
    width: 28px;
    height: 28px;
}

.aira-widget-btn.open .aira-widget-icon:not(.aira-icon-close) {
    display: none;
}

.aira-widget-btn.open .aira-icon-close {
    display: block !important;
}

.aira-widget-panel {
    position: absolute;
    bottom: calc(var(--aira-widget-size, 60px) + 15px);
    width: var(--aira-widget-panel-width, 380px);
    transform: scale(var(--aira-widget-scale, 1));
    transform-origin: bottom right;
    bottom: 0;
    background: var(--aira-bg);
    border-radius: var(--aira-radius);
    box-shadow: var(--aira-shadow, 0 10px 40px rgba(0, 0, 0, 0.15));
    border: var(--aira-container-border, none);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--aira-animation-speed, 0.3s) ease, visibility var(--aira-animation-speed, 0.3s) ease, transform var(--aira-animation-speed, 0.3s) ease;
    overflow: hidden;
    max-height: var(--aira-widget-chat-height, 450px);
}

.aira-position-bottom-right .aira-widget-panel {
    right: 0;
}

.aira-position-bottom-left .aira-widget-panel {
    left: 0;
}

.aira-widget-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(-80px) scale(var(--aira-widget-scale, 1));
}

.aira-widget-wrapper[data-anim="fade"] .aira-widget-panel {
    transform: translateY(-80px) scale(var(--aira-widget-scale, 1));
}
.aira-widget-wrapper[data-anim="fade"] .aira-widget-panel.open {
    opacity: 1;
    visibility: visible;
}

.aira-widget-wrapper[data-anim="slide"] .aira-widget-panel {
    transform: translateY(0) scale(var(--aira-widget-scale, 1));
}
.aira-widget-wrapper[data-anim="slide"] .aira-widget-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(-80px) scale(var(--aira-widget-scale, 1));
}

.aira-widget-wrapper[data-anim="scale"] .aira-widget-panel {
    transform: translateY(-80px) scale(0.5);
}
.aira-widget-wrapper[data-anim="scale"] .aira-widget-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(-80px) scale(var(--aira-widget-scale, 1));
}

.aira-widget-wrapper[data-anim="bounce"] .aira-widget-panel {
    transform: translateY(0) scale(var(--aira-widget-scale, 1));
    transition: opacity var(--aira-animation-speed, 0.3s) ease, visibility var(--aira-animation-speed, 0.3s) ease, transform var(--aira-animation-speed, 0.3s) cubic-bezier(0.34, 1.56, 0.64, 1);
}
.aira-widget-wrapper[data-anim="bounce"] .aira-widget-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(-80px) scale(var(--aira-widget-scale, 1));
}

.aira-widget-wrapper[data-anim="none"] .aira-widget-panel {
    transition: none;
    transform: translateY(-80px) scale(var(--aira-widget-scale, 1));
}
.aira-widget-wrapper[data-anim="none"] .aira-widget-panel.open {
    opacity: 1;
    visibility: visible;
}

.aira-widget-header {
    background: var(--aira-header-bg, var(--aira-primary));
    background-size: cover;
    background-position: center;
    color: var(--aira-header-text, #ffffff);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    border-bottom: var(--aira-header-border, none);
}

.aira-header-center {
    justify-content: center;
    text-align: center;
    flex-direction: column;
    gap: 2px;
}

.aira-header-center .aira-widget-close {
    position: absolute;
    right: 12px;
    top: 12px;
    padding: 5px !important;
}

.aira-header-center .aira-widget-title-wrap {
    align-items: center;
}

.aira-header-glass {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.aira-widget-title-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.aira-widget-subtitle {
    font-size: var(--aira-subtitle-font-size, 13px);
    opacity: .8;
    font-weight: 400;
    line-height: 1.3;
    margin-top: 1px;
}

.aira-widget-subtitle:empty {
    display: none;
}

.aira-widget-logo {
    max-width: var(--aira-logo-size, 36px);
    max-height: var(--aira-logo-size, 36px);
    width: auto;
    height: auto;
    border-radius: var(--aira-logo-radius, 50%);
    object-fit: contain;
}

.aira-widget-title {
    font-weight: 600;
    font-size: var(--aira-title-font-size, 18px);
    line-height: 1.3;
}

.aira-widget-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 4px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.aira-widget-close:hover {
    opacity: 1;
}

.aira-widget-close svg {
    width: 20px;
    height: 20px;
}

.aira-widget-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: var(--aira-widget-chat-height, 400px);
    min-height: 230px !important;
}

.aira-widget-welcome {
    text-align: center;
    color: var(--aira-text-light);
    padding: 20px;
}

.aira-widget-welcome p {
    margin: 0;
}

.aira-widget-message {
    display: flex;
}

.aira-widget-message.user {
    justify-content: flex-end;
}

.aira-widget-bubble {
    max-width: 85%;
    padding: 10px 14px;
    font-size: var(--aira-font-size, 14px);
    font-weight: var(--aira-font-weight, 400);
    line-height: var(--aira-line-height, 1.5);
    word-wrap: break-word;
}

.aira-widget-message.ai .aira-widget-bubble {
    background: var(--aira-ai-bubble-bg, #f3f4f6);
    color: var(--aira-ai-bubble-text, #1f2937);
    border-radius: var(--aira-msg-ai-radius, 12px 12px 12px 4px);
    box-shadow: var(--aira-msg-shadow, none);
}

.aira-widget-message.user .aira-widget-bubble {
    background: var(--aira-user-bubble-bg, var(--aira-primary));
    color: var(--aira-user-bubble-text, #ffffff);
    border-radius: var(--aira-msg-user-radius, 12px 12px 4px 12px);
    box-shadow: var(--aira-msg-shadow, none);
}

.aira-widget-typing {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: var(--aira-ai-bubble-bg, #f3f4f6);
    border-radius: var(--aira-radius);
    border-bottom-left-radius: 4px;
    width: fit-content;
}

.aira-widget-typing span {
    width: 8px;
    height: 8px;
    background: var(--aira-text-light);
    border-radius: 50%;
    animation: aira-bounce 1.4s ease-in-out infinite both;
}

.aira-widget-typing span:nth-child(1) { animation-delay: -0.32s; }
.aira-widget-typing span:nth-child(2) { animation-delay: -0.16s; }
.aira-widget-typing span:nth-child(3) { animation-delay: 0s; }

/* Widget Form Fields */
.aira-widget-fields {
    display: flex;
    flex-direction: column;
    gap: var(--aira-wf-gap, 10px);
    padding: 12px 16px;
    border-top: 1px solid var(--aira-border);
    background: var(--aira-bg);
    overflow-y: auto;
}

.aira-widget-fields.aira-wf-active {
    min-height: 300px;
    justify-content: space-between;
}

.aira-widget-field {
    display: flex;
    flex-direction: column;
    gap: var(--aira-wf-gap, 10px);
}

.aira-widget-field label {
    font-size: var(--aira-wf-label-size, 11px);
    font-weight: 600;
    color: var(--aira-text);
    text-align: left;
}

.aira-widget-field input,
.aira-widget-field textarea,
.aira-widget-field select {
    width: 100%;
    padding: 8px 12px;
    font-size: var(--aira-wf-input-size, 13px);
    border: var(--aira-ff-border, 1px solid var(--aira-border));
    border-bottom: var(--aira-ff-bb, none);
    border-radius: var(--aira-ff-radius, 8px);
    background: var(--aira-ff-bg, var(--aira-bg));
    color: var(--aira-text);
    transition: border-color 0.2s ease;
    font-family: inherit;
}

.aira-widget-field input:focus,
.aira-widget-field textarea:focus,
.aira-widget-field select:focus {
    outline: none;
    border-color: var(--aira-primary);
}

.aira-widget-field textarea {
    resize: none;
    min-height: 70px;
}

.aira-widget-field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px;
    padding-right: 36px;
}

.aira-widget-fields-submit {
    padding: 8px 16px;
    font-size: var(--aira-wf-btn-size, 13px);
    font-weight: 600;
    font-family: inherit;
    color: #ffffff;
    background: var(--aira-primary);
    border: none;
    border-radius: 100px;
    cursor: pointer;
    transition: transform 0.15s ease;
    align-self: center;
    min-width: 140px;
}

.aira-widget-fields-submit:hover {
    filter: brightness(1.1);
}

.aira-widget-form {
    padding: 15px;
    border-top: 1px solid var(--aira-border);
    background: var(--aira-bg);
}

.aira-widget-input-wrap {
    display: flex;
    gap: 10px;
    align-items: center !important;
}

.aira-widget-input-wrap textarea {
    flex: 1;
    padding: 10px 14px;
    border: var(--aira-input-border, 1px solid var(--aira-border));
    border-radius: var(--aira-input-radius, 10px);
    background: var(--aira-input-bg, #fff);
    color: var(--aira-input-text, var(--aira-text));
    box-shadow: var(--aira-input-shadow, none);
    font-size: var(--aira-font-size, 14px);
    font-family: inherit;
    resize: none;
    max-height: 100px;
    line-height: 1.4;
}

.aira-widget-input-wrap textarea::placeholder {
    color: var(--aira-text-light);
}

.aira-widget-input-wrap textarea:focus {
    outline: none;
    border-color: var(--aira-primary);
}

.aira-widget-send {
    padding: 10px 18px;
    background: var(--aira-primary);
    color: #fff;
    border: none;
    border-radius: var(--aira-input-radius, 10px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.1s;
    flex-shrink: 0;
    font-weight: 600;
    font-size: var(--aira-font-size, 13px);
    font-family: inherit;
    white-space: nowrap;
}

.aira-widget-send:hover {
    filter: brightness(1.1);
}

.aira-widget-send:active {
    transform: scale(0.95);
}

.aira-widget-send:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* Response Images */
.aira-response-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 10px;
    display: block;
}

.aira-widget-message.fieldsxxinfo {
    align-self: center;
    justify-content: center;
    width: 100%;
}

.aira-widget-message.fieldsxxinfo .aira-widget-bubble {
    max-width: 100%;
    background: transparent;
    color: var(--aira-text, #1f2937);
    border-radius: 0;
    box-shadow: none;
    text-align: center;
    font-size: 13px;
    line-height: 1.6;
    padding: 8px 0;
    border-bottom: 1px solid var(--aira-border, #e5e7eb);
}

.aira-widget-bubble .aira-response-image {
    margin-top: 8px;
    max-width: 200px;
}

.aira-inline-bubble .aira-response-image {
    margin-top: 8px;
}

@media (max-width: 480px) {
    .aira-widget-panel {
        width: calc(100vw - 40px);
        max-height: 70vh;
    }
    
    .aira-widget-wrapper.aira-position-bottom-right,
    .aira-widget-wrapper.aira-position-bottom-left {
        left: 10px;
        right: 10px;
    }
    
    .aira-widget-panel {
        left: 0 !important;
        right: 0 !important;
    }

    .aira-client-container {
        padding: 24px 15px !important;
    }

    .aira-client-header-text{
        line-height: 1.2 !important;
    }

    .aira-client-header {
        padding-right: 25px !important;
        padding-left: 25px !important;
    }
}

/* Markdown Formatting Styles */
.aira-md-h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem;
    color: var(--aira-text);
    line-height: 1.3;
}

.aira-md-h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0.875rem 0 0.4rem;
    color: var(--aira-text);
    line-height: 1.3;
}

.aira-md-h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0.75rem 0 0.35rem;
    color: var(--aira-text);
    line-height: 1.3;
}

.aira-md-h2:first-child,
.aira-md-h3:first-child,
.aira-md-h4:first-child {
    margin-top: 0;
}

.aira-md-p {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.aira-md-p:first-child {
    margin-top: 0;
}

.aira-md-p:last-child {
    margin-bottom: 0;
}

.aira-md-list {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
    list-style: disc;
}

.aira-md-list li {
    margin: 0.25rem 0;
    line-height: 1.5;
}

.aira-md-code {
    display: block;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    padding: 12px 16px;
    margin: 0.75rem 0;
    overflow-x: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.aira-md-inline-code {
    background: rgba(0, 0, 0, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
}

.aira-inline-bubble .aira-md-list,
.aira-modal-bubble .aira-md-list {
    margin: 0.4rem 0;
}

.aira-response .aira-md-h2,
.aira-response .aira-md-h3,
.aira-response .aira-md-h4 {
    color: inherit;
}

.aira-response .aira-md-code {
    background: rgba(255, 255, 255, 0.1);
}

.aira-response .aira-md-inline-code {
    background: rgba(255, 255, 255, 0.15);
}

/* ===== Client Mode Section Form ===== */
/* 1:1 mirror of admin preview CSS (.pv-client-*) using .aira-client-* prefix */

/* Outer wrapper — mirrors .pv-client-section */
.aira-client-section {
    width: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    border-radius: var(--aira-sec-container-radius, 16px);
    overflow: hidden;
}

/* Inner wrapper — mirrors .pv-client-wrapper */
.aira-client-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Header — mirrors .pv-client-header */
.aira-client-header {
    padding: var(--aira-sec-header-padding-tb, 32px) var(--aira-sec-header-padding-lr, 40px);
    background: var(--aira-header-bg, var(--aira-primary));
    border-bottom: var(--aira-sec-header-border, none);
    display: flex;
    align-items: flex-start;
    gap: var(--aira-sec-header-gap, 16px);
    flex-direction: row;
}
.aira-client-header.aira-header-glass {
    opacity: 0.92;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.aira-client-header.align-left {
    justify-content: flex-start;
    text-align: left;
}
.aira-client-header.align-center {
    justify-content: center;
    text-align: center;
    flex-direction: column;
    align-items: center;
}
.aira-client-header.align-right {
    justify-content: flex-end;
    text-align: right;
    flex-direction: row-reverse;
}

/* Logo — mirrors .pv-client-logo */
.aira-client-logo {
    max-width: var(--aira-sec-logo-size, 80px) !important;
    max-height: var(--aira-sec-logo-size, 80px);
    width: auto;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
}

/* Header content wrapper — mirrors .pv-client-header-content */
.aira-client-header-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* Header title — mirrors .pv-client-header-title */
.aira-client-header-title {
    font-size: var(--aira-sec-header-title-size, 28px);
    font-weight: 700;
    color: var(--aira-sec-header-text-color, #fff);
    line-height: 1.2;
    letter-spacing: -.01em;
}

/* Header text — mirrors .pv-client-header-text */
.aira-client-header-text {
    font-size: var(--aira-sec-header-font-size, 16px);
    font-weight: 400;
    color: var(--aira-sec-header-text-color, #fff);
    line-height: 0.9;
    white-space: pre-wrap;
    opacity: .9;
    padding-top: 10px;
}

/* Container — mirrors .pv-client-container */
.aira-client-container {
    flex: 1;
    padding: 24px 40px;
}

/* Body — mirrors .pv-client-body */
.aira-client-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    font-family: var(--aira-sec-font, inherit);
}

/* Initial state — mirrors .pv-client-initial */
.aira-client-initial {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: var(--aira-sec-align, flex-start);
}

/* Row — mirrors .pv-client-row */
.aira-client-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
    justify-content: var(--aira-sec-align, flex-start);
}

/* Label — mirrors .pv-client-label */
.aira-client-label {
    font-size: var(--aira-sec-font-size, 15px);
    font-weight: 500;
    color: var(--aira-sec-label-color, #1f2937);
    white-space: nowrap;
}

/* Input + Select shared — mirrors .pv-client-input,.pv-client-select */
.aira-client-input,
.aira-client-select {
    height: var(--aira-sec-input-height, 42px);
    padding: 0 16px;
    border: 1.5px solid var(--aira-sec-input-border, #e5e7eb) !important;
    border-radius: var(--aira-sec-input-radius, 10px) !important;
    font-size: var(--aira-sec-font-size, 14px);
    color: var(--aira-sec-input-text, #1f2937);
    background: var(--aira-sec-input-bg, #fff);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    font-family: var(--aira-sec-font, inherit);
    box-sizing: border-box;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

/* Input specific — mirrors .pv-client-input */
.aira-client-input {
    flex: 1;
    min-width: 120px;
    max-width: 280px;
}
.aira-client-input::placeholder {
    color: #9ca3af;
    opacity: 0.9;
}

/* Select specific — mirrors .pv-client-select */
.aira-client-select {
    width: auto;
    min-width: 140px;
    max-width: 250px;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* Focus states — mirrors .pv-client-input:focus,.pv-client-select:focus */
.aira-client-input:focus,
.aira-client-select:focus {
    border-color: var(--aira-sec-btn-bg, #6366f1);
    box-shadow: 0 0 0 3px rgba(99,102,241,.1);
}

/* Submit button — mirrors .pv-client-submit */
.aira-client-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--aira-sec-btn-height, 44px);
    padding: 0 32px;
    background: var(--aira-primary);
    color: var(--aira-sec-btn-text, #fff);
    border: none;
    border-radius: var(--aira-sec-btn-radius, 10px);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: opacity .2s, transform .1s;
}
.aira-client-submit:hover {
    opacity: .9;
}
.aira-client-submit:active {
    transform: scale(.98);
}
.aira-client-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Response area — mirrors .pv-client-response */
.aira-client-response {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.aira-client-shared-history {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

/* User message bubble — mirrors .pv-client-user-msg */
.aira-client-user-msg {
    padding: 14px 18px;
    background: var(--aira-sec-user-bg, #0053D4);
    color: var(--aira-sec-user-text, #fff);
    border-radius: 16px 16px 4px 16px;
    font-size: 14px;
    align-self: flex-end;
    max-width: 85%;
    line-height: 1.5;
}

.aira-client-user-msg b {
    font-weight: 600;
}

/* AI message bubble — mirrors .pv-client-ai-msg */
.aira-client-ai-msg {
    padding: 14px 18px;
    background: var(--aira-sec-response-bg, #f3f4f6);
    color: var(--aira-sec-response-text, #1f2937);
    border-radius: 16px 16px 16px 4px;
    font-size: 14px;
    max-width: 85%;
    line-height: 1.5;
}

/* Typing indicator */
.aira-client-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 16px;
}
.aira-client-typing span {
    width: 8px;
    height: 8px;
    background: var(--aira-primary);
    border-radius: 50%;
    animation: aira-typing-bounce 1.4s infinite ease-in-out both;
}
.aira-client-typing span:nth-child(1) { animation-delay: -0.32s; }
.aira-client-typing span:nth-child(2) { animation-delay: -0.16s; }
.aira-client-typing span:nth-child(3) { animation-delay: 0s; }

/* Restart button — mirrors .pv-client-restart */
.aira-client-restart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--aira-sec-btn-height, 44px);
    padding: 0 24px;
    background: transparent;
    color: var(--aira-primary);
    border: 2px solid var(--aira-primary);
    border-radius: var(--aira-sec-btn-radius, 10px);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: background .2s, color .2s;
    align-self: center;
}
.aira-client-social {
    display: flex;
    justify-content: center;
    gap: var(--aira-social-gap, 6px);
    padding: 12px 40px;
    border-top: 1px solid #e5e7eb;
}

.aira-client-social .aira-share-btn {
    width: var(--aira-social-icon-size, 32px);
    height: var(--aira-social-icon-size, 32px);
}

.aira-client-restart:hover {
    background: var(--aira-primary);
    color: var(--aira-sec-btn-text, #fff);
}

/* Display page input styles */
.aira-dp-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    color: #374151;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.aira-dp-input:focus {
    border-color: #0053D4;
    box-shadow: 0 0 0 3px rgba(0, 83, 212, 0.1);
}

.aira-dp-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #9ca3af;
}
