/* Peltron AI Asistan popup */
#peltron-assistant-root,
#peltron-assistant-root * {
    box-sizing: border-box;
}

#peltron-assistant-root {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 9999;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.peltron-assistant-toggle {
    border: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #0f2b5b 0%, #1565c0 100%);
    color: #fff;
    border-radius: 999px;
    padding: 13px 18px;
    font-weight: 800;
    font-size: 14px;
    box-shadow: 0 18px 40px rgba(15, 43, 91, 0.28);
    transition: transform .18s ease, box-shadow .18s ease;
}

.peltron-assistant-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 50px rgba(15, 43, 91, 0.34);
}

.peltron-assistant-toggle-icon {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.16);
    font-size: 15px;
}

.peltron-assistant-panel {
    width: 390px;
    max-width: calc(100vw - 28px);
    height: min(650px, calc(100vh - 110px));
    display: none;
    flex-direction: column;
    overflow: hidden;
    border-radius: 24px;
    background: #ffffff;
    border: 1px solid rgba(15, 43, 91, .10);
    box-shadow: 0 24px 70px rgba(15, 23, 42, .26);
}

#peltron-assistant-root.is-open .peltron-assistant-panel {
    display: flex;
}

#peltron-assistant-root.is-open .peltron-assistant-toggle {
    display: none;
}

.peltron-assistant-header {
    background: linear-gradient(135deg, #0f2b5b 0%, #1565c0 100%);
    color: #fff;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.peltron-assistant-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.peltron-assistant-title strong {
    display: block;
    font-size: 15px;
    line-height: 1.2;
}

.peltron-assistant-title span {
    display: block;
    font-size: 12px;
    opacity: .86;
    margin-top: 2px;
}

.peltron-assistant-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: rgba(255,255,255,.14);
    color: #fff;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.peltron-assistant-messages {
    flex: 1;
    overflow-y: auto;
    background: #f8fafc;
    padding: 16px;
}

.peltron-msg {
    width: 100%;
    display: flex;
    margin-bottom: 11px;
}

.peltron-msg.bot {
    justify-content: flex-start;
}

.peltron-msg.user {
    justify-content: flex-end;
}

.peltron-msg-bubble {
    max-width: 86%;
    border-radius: 17px;
    padding: 11px 13px;
    font-size: 13px;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.peltron-msg.bot .peltron-msg-bubble {
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 6px;
}

.peltron-msg.user .peltron-msg-bubble {
    background: #1565c0;
    color: #ffffff;
    border-bottom-right-radius: 6px;
}

.peltron-assistant-composer {
    border-top: 1px solid #e5e7eb;
    background: #fff;
    padding: 13px;
}

.peltron-input-row {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.peltron-chat-input,
.peltron-chat-textarea {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    padding: 12px 13px;
    font-size: 13px;
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease;
}

.peltron-chat-textarea {
    min-height: 88px;
    resize: vertical;
}

.peltron-chat-input:focus,
.peltron-chat-textarea:focus {
    border-color: #1565c0;
    box-shadow: 0 0 0 3px rgba(21, 101, 192, .12);
}

.peltron-send-btn,
.peltron-choice-btn,
.peltron-file-btn,
.peltron-confirm-btn {
    border: 0;
    cursor: pointer;
    background: #1565c0;
    color: #fff;
    border-radius: 14px;
    padding: 12px 14px;
    font-weight: 800;
    font-size: 13px;
    transition: background .16s ease, transform .16s ease;
}

.peltron-send-btn:hover,
.peltron-confirm-btn:hover {
    background: #0f4f9c;
}

.peltron-send-btn:disabled,
.peltron-confirm-btn:disabled {
    opacity: .65;
    cursor: not-allowed;
}

.peltron-choice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.peltron-choice-btn {
    background: #eff6ff;
    color: #0f2b5b;
    border: 1px solid #bfdbfe;
    text-align: left;
}

.peltron-choice-btn:hover {
    background: #dbeafe;
}

.peltron-file-box {
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    padding: 14px;
    background: #f8fafc;
}

.peltron-file-box input {
    width: 100%;
    font-size: 13px;
}

.peltron-file-status {
    margin-top: 9px;
    color: #047857;
    font-size: 12px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.peltron-file-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}

.peltron-file-btn.secondary {
    background: #e5e7eb;
    color: #111827;
}

.peltron-assistant-note {
    color: #64748b;
    font-size: 11px;
    line-height: 1.4;
    margin-top: 9px;
}

.peltron-summary {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 12px;
    font-size: 12px;
    color: #334155;
    line-height: 1.55;
}

.peltron-summary strong {
    color: #0f172a;
}

.peltron-assistant-status {
    font-size: 12px;
    margin-top: 9px;
    color: #dc2626;
    font-weight: 700;
}

@media (max-width: 640px) {
    #peltron-assistant-root {
        right: 12px;
        left: 12px;
        bottom: 12px;
    }

    .peltron-assistant-toggle {
        margin-left: auto;
        padding: 12px 15px;
    }

    .peltron-assistant-panel {
        width: 100%;
        height: min(620px, calc(100vh - 28px));
        border-radius: 22px;
    }

    .peltron-choice-grid {
        grid-template-columns: 1fr;
    }
}
