:root {
    --bg: #f4f7f9;
    --surface: #ffffff;
    --surface-soft: #f7f9fb;

    --text: #17212b;
    --text-soft: #66727e;
    --text-light: #89939d;

    --primary: #123f5a;
    --primary-dark: #0b3046;
    --primary-soft: #e9f2f6;

    --accent: #2b7a78;
    --accent-soft: #e9f5f3;

    --border: #e1e7eb;
    --border-dark: #d3dce2;

    --success: #24835b;
    --warning: #a76b17;

    --shadow-sm: 0 8px 24px rgba(20, 39, 52, 0.06);
    --shadow-lg: 0 24px 70px rgba(20, 39, 52, 0.10);

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;

    --container: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(
            circle at 85% 0%,
            rgba(43, 122, 120, 0.08),
            transparent 30%
        ),
        var(--bg);
    color: var(--text);
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button,
textarea {
    font: inherit;
}

button {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: inherit;
}

.container {
    width: min(calc(100% - 40px), var(--container));
    margin: 0 auto;
}


/* Demo notice */

.demo-notice {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 7px 20px;
    background: #fff7e8;
    border-bottom: 1px solid #f0dfbd;
    color: #77531c;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
}

.demo-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #d99225;
}


/* Header */

.site-header {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px);
}

.header-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text);
    text-decoration: none;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 13px;
    background: var(--primary);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-copy strong {
    font-size: 15px;
}

.brand-copy span {
    margin-top: 3px;
    color: var(--text-soft);
    font-size: 12px;
}

.header-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 600;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(36, 131, 91, 0.10);
}


/* Hero */

.hero {
    padding: 58px 0 34px;
}

.hero-inner {
    display: flex;
    justify-content: center;
}

.hero-copy {
    width: min(100%, 790px);
    text-align: center;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 12px;
    border: 1px solid #d7e8e7;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hero h1 {
    margin: 19px 0 14px;
    font-size: clamp(36px, 5vw, 58px);
    line-height: 1.04;
    letter-spacing: -0.045em;
}

.hero h1 span {
    color: var(--primary);
}

.hero-description {
    width: min(100%, 650px);
    margin: 0 auto;
    color: var(--text-soft);
    font-size: 17px;
    line-height: 1.7;
}


/* Main assistant */

.assistant-section {
    padding: 8px 0 70px;
}

.assistant-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 285px;
    align-items: start;
    gap: 24px;
}

.assistant-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}

.assistant-card-header {
    min-height: 78px;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 17px 20px;
    border-bottom: 1px solid var(--border);
}

.assistant-avatar,
.message-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    background: var(--primary);
    color: #fff;
    font-weight: 800;
}

.assistant-avatar {
    width: 43px;
    height: 43px;
    border-radius: 14px;
    font-size: 12px;
}

.assistant-card-header > div:last-child {
    display: flex;
    flex-direction: column;
}

.assistant-card-header strong {
    font-size: 14px;
}

.assistant-card-header span {
    margin-top: 3px;
    color: var(--text-soft);
    font-size: 11px;
}


/* Conversation */

.conversation {
    min-height: 230px;
    max-height: 520px;
    overflow-y: auto;
    padding: 24px 22px 10px;
    scroll-behavior: smooth;
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-bottom: 20px;
}

.message-avatar {
    width: 32px;
    height: 32px;
    margin-top: 2px;
    border-radius: 10px;
    font-size: 9px;
}

.message-content {
    max-width: min(84%, 680px);
    padding: 14px 16px;
    border-radius: 4px 17px 17px 17px;
    background: var(--surface-soft);
    border: 1px solid var(--border);
    color: #33404b;
    font-size: 14px;
    line-height: 1.65;
}

.message-content p {
    margin: 0 0 9px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content strong {
    color: var(--text);
}

.message-content ul,
.message-content ol {
    margin: 9px 0;
    padding-left: 22px;
}

.message-content li {
    margin: 5px 0;
}

.user-message {
    justify-content: flex-end;
}

.user-message .message-content {
    border-color: var(--primary);
    border-radius: 17px 4px 17px 17px;
    background: var(--primary);
    color: #fff;
}

.user-message .message-avatar {
    display: none;
}


/* Sources */

.source-list {
    display: grid;
    gap: 8px;
    margin-top: 13px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.source-label {
    color: var(--text-soft);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.source-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 11px 12px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: #fff;
    color: var(--text);
    text-decoration: none;
    transition:
        border-color 160ms ease,
        transform 160ms ease,
        box-shadow 160ms ease;
}

.source-card:hover {
    border-color: #b8cbd5;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.source-card-copy {
    min-width: 0;
}

.source-card-copy strong {
    display: block;
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.source-card-copy span {
    display: block;
    margin-top: 2px;
    color: var(--text-soft);
    font-size: 10px;
}

.source-arrow {
    flex: 0 0 auto;
    color: var(--primary);
    font-weight: 700;
}


/* Suggestions */

.suggestions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    padding: 10px 22px 20px;
}

.suggestion {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #fff;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition:
        border-color 160ms ease,
        background 160ms ease,
        transform 160ms ease;
}

.suggestion:hover {
    border-color: #b8cbd5;
    background: var(--surface-soft);
    transform: translateY(-1px);
}

.suggestion-icon {
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 9px;
    font-weight: 800;
}

.suggestion > span:last-child {
    min-width: 0;
    color: var(--text-soft);
    font-size: 10px;
    line-height: 1.4;
}

.suggestion strong {
    display: block;
    margin-bottom: 2px;
    color: var(--text);
    font-size: 11px;
}


/* Form */

.chat-form {
    padding: 0 22px 20px;
}

.input-shell {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--border-dark);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 5px 20px rgba(20, 39, 52, 0.04);
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease;
}

.input-shell:focus-within {
    border-color: #8baebf;
    box-shadow: 0 0 0 4px rgba(18, 63, 90, 0.06);
}

#questionInput {
    width: 100%;
    min-height: 44px;
    max-height: 140px;
    resize: none;
    padding: 11px 10px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
}

#questionInput::placeholder {
    color: #98a2ab;
}

.voice-button,
.send-button {
    min-height: 42px;
    border: 0;
    border-radius: 11px;
}

.voice-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 0 11px;
    background: #f0f3f5;
    color: var(--text-light);
    cursor: not-allowed;
}

.microphone-icon {
    font-size: 7px;
}

.voice-label {
    font-size: 10px;
    font-weight: 700;
}

.send-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 0 0 auto;
    padding: 0 17px;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition:
        background 160ms ease,
        transform 160ms ease;
}

.send-button:hover {
    background: var(--primary-dark);
}

.send-button:active {
    transform: translateY(1px);
}

.send-button:disabled {
    opacity: 0.65;
    cursor: wait;
}

.input-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 9px 3px 0;
    color: var(--text-light);
    font-size: 9px;
}

.new-conversation {
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
}


/* Loading */

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

.typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #84929c;
    animation: typing 1.1s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.30s;
}

@keyframes typing {
    0%,
    60%,
    100% {
        opacity: 0.35;
        transform: translateY(0);
    }

    30% {
        opacity: 1;
        transform: translateY(-3px);
    }
}


/* Info panel */

.info-panel {
    display: grid;
    gap: 12px;
}

.info-card,
.privacy-note {
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.78);
}

.info-card {
    padding: 17px;
}

.info-icon {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    margin-bottom: 13px;
    border-radius: 9px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
}

.info-card h2 {
    margin: 0 0 7px;
    font-size: 13px;
    line-height: 1.35;
}

.info-card p {
    margin: 0;
    color: var(--text-soft);
    font-size: 11px;
    line-height: 1.6;
}

.privacy-note {
    padding: 16px;
    background: #fffaf1;
    border-color: #eadfc9;
}

.privacy-note strong {
    display: block;
    margin-bottom: 6px;
    color: #75511c;
    font-size: 11px;
}

.privacy-note p {
    margin: 0;
    color: #826a46;
    font-size: 10px;
    line-height: 1.55;
}


/* Error */

.error-message .message-content {
    border-color: #ecd1d1;
    background: #fff5f5;
    color: #8b3838;
}


/* Footer */

.site-footer {
    border-top: 1px solid var(--border);
    background: #fff;
}

.footer-inner {
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    color: var(--text-light);
    font-size: 10px;
}


/* Responsive */

@media (max-width: 900px) {
    .assistant-layout {
        grid-template-columns: 1fr;
    }

    .info-panel {
        grid-template-columns: repeat(3, 1fr);
    }

    .privacy-note {
        grid-column: 1 / -1;
    }
}

@media (max-width: 700px) {
    .container {
        width: min(calc(100% - 24px), var(--container));
    }

    .demo-notice {
        font-size: 10px;
    }

    .header-inner {
        min-height: 66px;
    }

    .header-status {
        display: none;
    }

    .hero {
        padding: 40px 0 25px;
    }

    .hero h1 {
        font-size: 39px;
    }

    .hero-description {
        font-size: 15px;
    }

    .assistant-section {
        padding-bottom: 40px;
    }

    .assistant-card {
        border-radius: 18px;
    }

    .assistant-card-header {
        padding: 14px;
    }

    .conversation {
        min-height: 210px;
        padding: 18px 14px 8px;
    }

    .message-content {
        max-width: 90%;
        font-size: 13px;
    }

    .suggestions {
        grid-template-columns: 1fr;
        padding: 8px 14px 16px;
    }

    .chat-form {
        padding: 0 14px 15px;
    }

    .voice-button {
        display: none;
    }

    .send-button span:first-child {
        display: none;
    }

    .send-button {
        width: 44px;
        padding: 0;
        font-size: 17px;
    }

    .input-footer > span {
        max-width: 72%;
    }

    .info-panel {
        grid-template-columns: 1fr;
    }

    .privacy-note {
        grid-column: auto;
    }

    .footer-inner {
        min-height: 60px;
        flex-direction: column;
        justify-content: center;
        gap: 3px;
    }
}