
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
}

body {
    min-height: 100vh;
    background: #f3f4f6;
    color: #1f2937;
}

button, input {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    opacity: .6;
    cursor: wait;
}

.app-container {
    display: flex;
    width: 100%;
    min-height: 100vh;
    background: #fff;
}

.sidebar {
    width: 320px;
    flex: 0 0 320px;
    background: #fff;
    border-right: 1px solid #e5e7eb;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 28px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: #10b981;
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
}

.brand h2 {
    font-size: 1.45rem;
    color: #065f46;
}

.brand-desc {
    color: #6b7280;
    font-size: .92rem;
    line-height: 1.55;
}

.sidebar-bottom {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.status-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0fdf4;
    padding: 11px 13px;
    border-radius: 9px;
    border: 1px solid #bbf7d0;
    font-size: .86rem;
    color: #166534;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #9ca3af;
    flex: 0 0 auto;
}

.status-dot.active {
    background: #10b981;
    box-shadow: 0 0 0 4px #d1fae5;
}

.btn-primary {
    width: 100%;
    border: 0;
    border-radius: 10px;
    padding: 14px 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    background: #10b981;
    color: #fff;
    font-weight: 650;
    transition: background .2s;
}

.btn-primary:hover {
    background: #059669;
}

.btn-primary.connected {
    background: #dc2626;
}

.btn-primary.connected:hover {
    background: #b91c1c;
}

.privacy-note {
    font-size: .75rem;
    color: #9ca3af;
    line-height: 1.45;
}

.chat-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    background: #f9fafb;
    min-height: 100vh;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 17px 28px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
}

.chat-header strong {
    display: block;
    font-size: .98rem;
}

.chat-header span {
    display: block;
    color: #6b7280;
    font-size: .8rem;
    margin-top: 3px;
}

.icon-button {
    width: 38px;
    height: 38px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    border-radius: 9px;
}

.icon-button:hover {
    color: #dc2626;
    background: #fef2f2;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 900px;
    width: fit-content;
    animation: fadeIn .2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    flex: 0 0 36px;
}

.genio-avatar {
    background: #10b981;
    color: #fff;
}

.user-avatar {
    background: #374151;
    color: #fff;
}

.message-content {
    background: #fff;
    padding: 13px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 13px;
    box-shadow: 0 1px 3px #00000008;
    font-size: .95rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.message-content p {
    white-space: pre-wrap;
}

.user-message .message-content {
    background: #10b981;
    color: #fff;
    border-color: #10b981;
}

.message-content img {
    display: block;
    max-width: min(280px, 100%);
    max-height: 260px;
    object-fit: contain;
    margin-top: 9px;
    border-radius: 8px;
}

.file-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 8px;
    padding: 7px 10px;
    border-radius: 8px;
    background: #f3f4f6;
    color: #374151;
    font-size: .82rem;
}

.user-message .file-chip {
    background: #059669;
    color: #fff;
}

.genie-floating {
    position: absolute;
    top: 78px;
    right: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #ffffffef;
    padding: 9px 14px;
    border: 1px solid #a7f3d0;
    border-radius: 30px;
    box-shadow: 0 5px 20px #10b98120;
    z-index: 2;
    animation: floaty 2.5s ease-in-out infinite;
}

.hidden {
    display: none !important;
}

@keyframes floaty {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

.floating-orb {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    background: #10b981;
}

.floating-label {
    color: #047857;
    font-size: .82rem;
    font-weight: 650;
}

.chat-input-area {
    padding: 15px 22px 12px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
}

.chat-form {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 13px;
    padding: 7px 10px;
}

.chat-form:focus-within {
    border-color: #10b981;
    background: #fff;
}

.btn-attach {
    color: #6b7280;
    padding: 8px;
    cursor: pointer;
}

.btn-attach:hover {
    color: #059669;
}

#userInput {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    padding: 8px 3px;
    font-size: .95rem;
    color: #1f2937;
}

.btn-send {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 9px;
    display: grid;
    place-items: center;
    background: #10b981;
    color: #fff;
}

.btn-send:hover {
    background: #059669;
}

.input-hint {
    color: #9ca3af;
    font-size: .73rem;
    margin: 8px 4px 0;
}

.attachment-preview {
    margin-bottom: 8px;
    color: #4b5563;
    font-size: .84rem;
}

.attachment-preview button {
    margin-left: 10px;
    border: 0;
    background: none;
    color: #dc2626;
}

.typing {
    color: #6b7280;
    font-style: italic;
    font-size: .85rem;
}

@media (max-width: 760px) {
    .app-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        flex-basis: auto;
        padding: 15px;
        gap: 14px;
    }

    .sidebar-bottom {
        gap: 9px;
    }

    .privacy-note {
        display: none;
    }

    .chat-main {
        min-height: 68vh;
        flex: 1;
    }

    .chat-header {
        padding: 13px 16px;
    }

    .chat-messages {
        padding: 17px 13px;
    }

    .chat-input-area {
        padding: 12px;
    }

    .genie-floating {
        top: 60px;
        right: 12px;
    }
}
