/* Norman — aligned with Vernice Merchants corporate UI (uses :root tokens from styles.css) */

.norman-launcher {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1200;
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: var(--gradient-primary);
    color: #fff;
    padding: 0.65rem 1.15rem 0.65rem 0.85rem;
    font-family: "IBM Plex Sans", "Inter", sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.norman-launcher:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-1px);
}

.norman-launcher:focus-visible {
    outline: 3px solid var(--accent-line);
    outline-offset: 3px;
}

.norman-launcher__icon {
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.norman-launcher__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
    text-align: left;
}

.norman-launcher__label {
    font-size: 0.95rem;
    font-weight: 600;
}

.norman-launcher__hint {
    font-size: 0.7rem;
    font-weight: 500;
    opacity: 0.85;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.norman-panel {
    position: fixed;
    right: 20px;
    bottom: 88px;
    width: min(400px, calc(100vw - 24px));
    max-height: min(70vh, 640px);
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-2xl);
    display: none;
    flex-direction: column;
    z-index: 1201;
    overflow: hidden;
    font-family: "Inter", -apple-system, sans-serif;
}

.norman-panel.active {
    display: flex;
}

.norman-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--gradient-hero);
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.norman-header__brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    text-align: left;
}

.norman-header__avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "IBM Plex Sans", sans-serif;
    font-size: 1rem;
    font-weight: 700;
    flex-shrink: 0;
}

.norman-header__titles {
    min-width: 0;
}

.norman-header__titles strong {
    font-family: "IBM Plex Sans", sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    display: block;
    letter-spacing: -0.02em;
}

.norman-header__subtitle {
    font-size: 0.72rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.8;
    margin-top: 2px;
}

.norman-header__actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.norman-header__actions button {
    border: 0;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.15s ease;
}

.norman-header__actions button:hover {
    background: rgba(255, 255, 255, 0.18);
}

.norman-header__actions button:focus-visible {
    outline: 2px solid var(--accent-line);
    outline-offset: 2px;
}

.norman-disclaimer {
    margin: 0;
    padding: 10px 16px;
    font-size: 0.72rem;
    line-height: 1.45;
    color: var(--text-secondary);
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
}

.norman-messages {
    overflow-y: auto;
    padding: 14px 14px 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-height: 180px;
    background: var(--bg-white);
}

.norman-msg {
    max-width: 90%;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.875rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.norman-msg.bot {
    align-self: flex-start;
    background: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.norman-msg.user {
    align-self: flex-end;
    background: var(--gradient-accent);
    color: #fff;
    border: 1px solid transparent;
}

.norman-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 14px 12px;
    background: var(--bg-white);
}

.norman-chip {
    border: 1px solid var(--border-color);
    background: var(--bg-white);
    color: var(--secondary-color);
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.norman-chip:hover {
    border-color: var(--secondary-color);
    background: var(--bg-light);
}

.norman-chip:focus-visible {
    outline: 2px solid var(--accent-line);
    outline-offset: 2px;
}

.norman-input-wrap {
    display: flex;
    gap: 8px;
    padding: 12px 14px 14px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-white);
}

.norman-input-wrap input {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-white);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.norman-input-wrap input::placeholder {
    color: var(--text-light);
}

.norman-input-wrap input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(30, 73, 118, 0.12);
}

.norman-input-wrap button[type="submit"] {
    border: 0;
    border-radius: 8px;
    background: var(--gradient-primary);
    color: #fff;
    padding: 10px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: "IBM Plex Sans", "Inter", sans-serif;
    cursor: pointer;
    transition: opacity 0.15s ease, transform 0.15s ease;
    flex-shrink: 0;
}

.norman-input-wrap button[type="submit"]:hover {
    opacity: 0.95;
}

.norman-input-wrap button[type="submit"]:focus-visible {
    outline: 2px solid var(--accent-line);
    outline-offset: 2px;
}

.norman-typing {
    font-size: 0.75rem;
    color: var(--text-secondary);
    padding: 0 14px 6px;
    min-height: 1.25rem;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.norman-typing-label {
    font-weight: 500;
}

.norman-typing-dots {
    display: inline-flex;
    gap: 4px;
}

.norman-typing-dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--secondary-color);
    opacity: 0.35;
    animation: norman-dot 1.2s ease-in-out infinite;
}

.norman-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.norman-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes norman-dot {
    0%, 80%, 100% {
        opacity: 0.25;
        transform: scale(0.9);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .norman-launcher {
        transition: none;
    }

    .norman-launcher:hover {
        transform: none;
    }

    .norman-typing-dots span {
        animation: none;
        opacity: 0.5;
    }
}

@media (max-width: 768px) {
    .norman-launcher {
        right: 12px;
        bottom: 12px;
        padding: 0.55rem 1rem 0.55rem 0.7rem;
    }

    .norman-launcher__hint {
        display: none;
    }

    .norman-panel {
        right: 12px;
        bottom: 72px;
        width: calc(100vw - 24px);
        max-height: min(75vh, 560px);
    }
}
