/* IDA embed widget — modern executive design */
#ida-embed-root {
    --ida-embed-accent: #0f766e;
    --ida-embed-accent-hover: #0d9488;
    --ida-embed-bg: #ffffff;
    --ida-embed-text: #0f172a;
    --ida-embed-muted: #64748b;
    --ida-embed-border: #e2e8f0;
    --ida-embed-surface: #f8fafc;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: var(--ida-embed-text);
    z-index: 2147483000;
}

#ida-embed-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 56px;
    height: 56px;
    border-radius: 999px;
    border: none;
    background: var(--ida-embed-accent);
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(15, 118, 110, 0.35);
    transition: transform 0.2s ease, background 0.2s ease;
}

#ida-embed-fab:hover {
    transform: scale(1.05);
    background: var(--ida-embed-accent-hover);
}

.ida-embed-panel {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: min(420px, calc(100vw - 24px));
    height: min(640px, calc(100vh - 24px));
    background: var(--ida-embed-bg);
    border: 1px solid var(--ida-embed-border);
    border-radius: 18px;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.14);
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.ida-embed-panel--inline {
    position: relative;
    right: auto;
    bottom: auto;
    width: 100%;
    max-width: 900px;
    margin: 20px auto;
    height: min(680px, calc(100vh - 40px));
    max-height: calc(100vh - 40px);
    min-height: 480px;
    border-radius: 20px;
    box-shadow: 0 10px 30px -5px rgba(15, 118, 110, 0.08);
    border: 1px solid #d1fae5;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.ida-embed-panel--inline .ida-embed-header #ida-embed-close {
    display: none;
}

.ida-embed-hidden {
    display: none !important;
}

.ida-embed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
}

.ida-embed-header strong {
    font-size: 16px;
    font-weight: 700;
    color: #0f766e;
    display: block;
}

.ida-embed-sub {
    font-size: 12px;
    color: #64748b;
    margin-top: 2px;
    font-weight: 500;
}

#ida-embed-close {
    border: none;
    background: transparent;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: var(--ida-embed-muted);
    transition: color 0.15s ease;
}

#ida-embed-close:hover {
    color: var(--ida-embed-text);
}

.ida-embed-tabs {
    display: flex;
    gap: 6px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--ida-embed-border);
    background: #ffffff;
}

.ida-embed-tab {
    flex: 1;
    border: 1px solid var(--ida-embed-border);
    background: #ffffff;
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    font-weight: 500;
    font-size: 13px;
    color: var(--ida-embed-muted);
    transition: all 0.2s ease;
}

.ida-embed-tab--active {
    border-color: var(--ida-embed-accent);
    color: var(--ida-embed-accent);
    background: #f0fdf4;
    font-weight: 600;
}

.ida-embed-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #f8fafc;
}

.ida-embed-disclaimer {
    font-size: 12px;
    color: #64748b;
    margin: 0 0 4px;
    line-height: 1.45;
    background: #f1f5f9;
    padding: 10px 12px;
    border-radius: 10px;
    border-left: 3px solid var(--ida-embed-accent);
}

.ida-embed-copy {
    margin: 0;
    line-height: 1.5;
    color: #334155;
    font-size: 15px;
}

.ida-embed-choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.ida-embed-choice {
    border: 1.5px solid #e2e8f0;
    background: #ffffff;
    border-radius: 12px;
    padding: 14px 18px;
    text-align: left;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.ida-embed-subcopy {
    font-size: 13px;
    color: #64748b;
    margin: -4px 0 8px;
    line-height: 1.4;
}

.ida-embed-choice--custom {
    border-color: #cbd5e1;
    background: #f8fafc;
    color: #0f766e;
    font-weight: 600;
}

.ida-embed-choice--custom:hover {
    border-color: #0f766e;
    background: #f0fdf4;
}

.ida-embed-btn {
    border: none;
    background: var(--ida-embed-accent);
    color: #ffffff;
    border-radius: 12px;
    padding: 12px 18px;
    text-align: center;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.2);
}

.ida-embed-btn:hover {
    background: var(--ida-embed-accent-hover);
    transform: translateY(-1px);
}

.ida-embed-btn--ghost {
    background: #ffffff;
    color: #475569;
    border: 1.5px solid #cbd5e1;
    box-shadow: none;
}

.ida-embed-btn--ghost:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #1e293b;
    transform: none;
}

/* Chat messaging rows and avatar */
.ida-embed-body--chat {
    padding: 0 !important;
    gap: 0 !important;
    overflow: hidden !important;
    background: #f8fafc;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.ida-embed-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 20px 10px;
}

.ida-embed-msg-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    width: 100%;
}

.ida-embed-msg-row--user {
    justify-content: flex-end;
}

.ida-embed-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--ida-embed-accent) 0%, var(--ida-embed-accent-hover) 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(15, 118, 110, 0.2);
}

.ida-embed-msg {
    max-width: 80%;
    padding: 10px 14px;
    line-height: 1.45;
    font-size: 14px;
    word-break: break-word;
    box-shadow: none;
}

.ida-embed-msg--user {
    background: var(--ida-embed-accent);
    color: #ffffff;
    border-radius: 16px 16px 4px 16px;
}

.ida-embed-msg--ai {
    background: #ffffff;
    color: #1e293b;
    border: none;
    border-radius: 16px 16px 16px 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.ida-embed-form {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    background: #ffffff;
    border-top: 1px solid #e2e8f0;
    align-items: center;
    box-sizing: border-box;
}

.ida-embed-form textarea {
    flex: 1;
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    min-height: 40px;
    max-height: 80px;
    box-sizing: border-box;
    background: #f8fafc;
}

.ida-embed-form textarea:focus {
    border-color: var(--ida-embed-accent);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
    background: #ffffff;
}

.ida-embed-form button[type='submit'] {
    border: none;
    border-radius: 50%;
    background: var(--ida-embed-accent);
    color: #ffffff;
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(15, 118, 110, 0.2);
    flex-shrink: 0;
}

.ida-embed-form button[type='submit']:hover {
    background: var(--ida-embed-accent-hover);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(15, 118, 110, 0.3);
}

.ida-embed-footer {
    padding: 10px 20px;
    font-size: 11px;
    color: #94a3b8;
    background: #ffffff;
    border-top: 1px solid #f1f5f9;
    text-align: center;
}

/* Tag Picker Styles */
.ida-embed-tags-wrapper {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 8px 20px 14px;
    margin: 0;
    flex-shrink: 0;
}

.ida-embed-tags-title {
    font-size: 13px;
    color: var(--ida-embed-muted);
    margin-bottom: 10px;
    font-weight: 500;
}

.ida-embed-tag-header {
    margin-bottom: 8px;
}

.ida-embed-tag-back {
    background: transparent;
    border: none;
    color: var(--ida-embed-accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}
.ida-embed-tag-back:hover {
    text-decoration: underline;
}

.ida-embed-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
    overflow-x: hidden;
}

.ida-embed-tag {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #334155;
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ida-embed-tag:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.ida-embed-tag--active {
    background: #e0f2fe;
    border-color: #bae6fd;
    color: #0369a1;
    font-weight: 600;
}

.ida-embed-tag--active-group {
    border-color: var(--ida-embed-accent);
    background: #f0fdf4;
    color: var(--ida-embed-accent);
}

.ida-onboarding-welcome {
    margin: 4px 0;
}
.ida-onboarding-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
}
.ida-onboard-btn {
    display: block;
    width: 100%;
    text-align: left;
    background: #ffffff;
    border: 1.5px solid var(--ida-embed-accent);
    color: var(--ida-embed-accent);
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13.5px;
    font-weight: 650;
    cursor: pointer;
    transition: all 0.2s ease;
}
.ida-onboard-btn:hover {
    background: var(--ida-embed-accent);
    color: #ffffff;
    transform: translateY(-1px);
}

/* Typing Indicator Animation */
.ida-embed-msg--typing {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-style: italic;
    font-size: 13px;
    padding: 8px 14px;
}
.ida-typing-dots span {
    animation: ida-bouncing-dots 1.4s infinite both;
    display: inline-block;
    font-weight: 800;
}
.ida-typing-dots span:nth-child(2) {
    animation-delay: .2s;
}
.ida-typing-dots span:nth-child(3) {
    animation-delay: .4s;
}
@keyframes ida-bouncing-dots {
    0% { opacity: .2; transform: translateY(0); }
    20% { opacity: 1; transform: translateY(-2px); }
    100% { opacity: .2; transform: translateY(0); }
}
