.nobibot-card {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    height: clamp(430px, calc(100vh - 300px), 560px);
    max-width: 560px;
    margin-left: auto;
    background: var(--white, #ffffff);
    border: 1px solid var(--light-gray, #e2e8f0);
    border-radius: 18px;
    box-shadow: 0 24px 48px -12px rgba(26, 54, 93, 0.25);
    overflow: hidden;
    text-align: left;
    animation: nobibot-rise 0.5s ease both;
}

@keyframes nobibot-rise {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .nobibot-card,
    .nobibot-typing span { animation: none !important; }
}

.nobibot-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--primary, #1a365d), var(--primary-light, #2a4a7f));
    color: #fff;
}

.nobibot-avatar {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    font-size: 1.05rem;
}

.nobibot-headtext {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}

.nobibot-headtext strong {
    font-size: 1.02rem;
    letter-spacing: 0.01em;
}

.nobibot-headtext span {
    font-size: 0.72rem;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nobibot-badge {
    margin-left: auto;
    flex: 0 0 auto;
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.28);
}

.nobibot-reset {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.nobibot-reset:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.nobibot-messages {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    overflow-y: auto;
    background: var(--off-white, #f8f9fa);
}

.nobibot-messages::-webkit-scrollbar { width: 6px; }
.nobibot-messages::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

.nobibot-msg {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.88rem;
    line-height: 1.55;
    word-wrap: break-word;
    white-space: normal;
}

.nobibot-msg--bot {
    align-self: flex-start;
    background: var(--white, #ffffff);
    border: 1px solid var(--light-gray, #e2e8f0);
    border-top-left-radius: 4px;
    color: var(--dark, #2d3748);
}

.nobibot-msg--user {
    align-self: flex-end;
    background: var(--primary, #1a365d);
    border-top-right-radius: 4px;
    color: #fff;
}

.nobibot-msg strong { font-weight: 700; }

.nobibot-typing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 20px;
}

.nobibot-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gray, #718096);
    opacity: 0.4;
    animation: nobibot-blink 1.2s infinite both;
}

.nobibot-typing span:nth-child(2) { animation-delay: 0.2s; }
.nobibot-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes nobibot-blink {
    0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
    40%           { opacity: 1;    transform: translateY(-2px); }
}

.nobibot-chips {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    overflow-x: auto;
    overflow-y: hidden;
    border-top: 1px solid var(--light-gray, #e2e8f0);
    background: var(--white, #ffffff);
    scrollbar-width: thin;
}

.nobibot-chips::-webkit-scrollbar { height: 5px; }
.nobibot-chips::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

.nobibot-chip {
    flex: 0 0 auto;
    padding: 6px 12px;
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--primary, #1a365d);
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.nobibot-chip:hover {
    background: var(--primary, #1a365d);
    border-color: var(--primary, #1a365d);
    color: #fff;
}

.nobibot-inputrow {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--light-gray, #e2e8f0);
    background: var(--white, #ffffff);
    margin: 0;
}

.nobibot-inputrow input {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 16px;
    font-size: 0.88rem;
    color: var(--dark, #2d3748);
    background: var(--off-white, #f8f9fa);
    border: 1px solid var(--light-gray, #e2e8f0);
    border-radius: 999px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nobibot-inputrow input:focus {
    border-color: var(--secondary, #3182ce);
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.15);
    background: #fff;
}

.nobibot-send {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary, #1a365d);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;
}

.nobibot-send:hover { background: var(--primary-light, #2a4a7f); transform: scale(1.05); }

.nobibot-busy .nobibot-send,
.nobibot-busy .nobibot-chip,
.nobibot-busy .nobibot-inputrow input {
    opacity: 0.55;
    pointer-events: none;
}

.nobibot-disclaimer {
    flex: 0 0 auto;
    padding: 8px 14px;
    font-size: 0.7rem;
    line-height: 1.45;
    text-align: center;
    color: #8a6d3b;
    background: #fff8ed;
    border-top: 1px solid #f3e3c3;
}

.nobibot-disclaimer .fa-circle-info { margin-right: 4px; }

.nobibot-linklike {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}

.nobibot-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.nobibot-modal[hidden] { display: none !important; }

.nobibot-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
}

.nobibot-modal-card {
    position: relative;
    max-width: 560px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 16px;
    padding: 26px 28px;
    box-shadow: 0 32px 64px -16px rgba(15, 23, 42, 0.45);
    animation: nobibot-rise 0.3s ease both;
}

.nobibot-modal-card h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary, #1a365d);
    margin-bottom: 14px;
}

.nobibot-modal-card h3 .fas { margin-right: 6px; }

.nobibot-modal-card ul {
    margin: 0 0 18px;
    padding-left: 20px;
}

.nobibot-modal-card ul li {
    font-size: 0.86rem;
    line-height: 1.55;
    color: var(--dark, #2d3748);
    margin-bottom: 9px;
}

.nobibot-modal-card a { color: var(--secondary, #3182ce); }

.nobibot-modal-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.nobibot-btn-primary {
    padding: 10px 18px;
    font-size: 0.86rem;
    font-weight: 600;
    color: #fff;
    background: var(--primary, #1a365d);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.nobibot-btn-primary:hover { background: var(--primary-dark, #132948); }

.nobibot-btn-secondary {
    padding: 10px 18px;
    font-size: 0.86rem;
    font-weight: 500;
    color: var(--gray, #718096);
    background: transparent;
    border: 1px solid var(--light-gray, #e2e8f0);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.nobibot-btn-secondary:hover {
    border-color: var(--gray, #718096);
    color: var(--dark, #2d3748);
}

@media (max-width: 991.98px) {
    .hero { padding-top: 13rem; }

    .nobibot-card {
        height: 480px;
        max-width: 100%;
        margin-left: 0;
    }
}

@media (max-width: 575.98px) {
    .nobibot-card { height: 440px; border-radius: 14px; }
    .nobibot-headtext span { font-size: 0.66rem; }
    .nobibot-badge { display: none; }
}
