:root {
    --bg-1: #0b1020;
    --bg-2: #11182d;
    --panel: rgba(17, 24, 39, 0.78);
    --panel-strong: #111827;
    --panel-soft: rgba(30, 41, 59, 0.72);
    --border: rgba(148, 163, 184, 0.18);
    --border-strong: rgba(96, 165, 250, 0.35);
    --text-main: #e5eefc;
    --text-soft: #a9b7d0;
    --text-muted: #7f8ca7;
    --accent: #60a5fa;
    --accent-strong: #3b82f6;
    --accent-soft: rgba(96, 165, 250, 0.14);
    --user-bubble: linear-gradient(135deg, #2563eb, #1d4ed8);
    --bot-bubble: rgba(15, 23, 42, 0.92);
    --danger-bg: rgba(127, 29, 29, 0.18);
    --danger-border: rgba(248, 113, 113, 0.28);
    --danger-text: #fecaca;
    --shadow-lg: 0 24px 60px rgba(2, 6, 23, 0.45);
    --shadow-md: 0 14px 30px rgba(2, 6, 23, 0.28);
}

html, body {
    margin: 0;
    padding: 0;
}

body.app-body {
    min-height: 100vh;
    color: var(--text-main);
    background:
        radial-gradient(circle at top left, rgba(59, 130, 246, 0.22), transparent 26%),
        radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.18), transparent 24%),
        linear-gradient(180deg, var(--bg-1) 0%, var(--bg-2) 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tracking-wide {
    letter-spacing: 0.08em;
}

.hero-banner {
    border: 1px solid var(--border);
    border-radius: 28px;
    background:
        linear-gradient(135deg, rgba(96, 165, 250, 0.12), rgba(15, 23, 42, 0.88)),
        rgba(17, 24, 39, 0.85);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(14px);
}

.hero-copy {
    max-width: 56rem;
}

.card {
    background: var(--panel);
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(14px);
}

.form-control {
    border-radius: 16px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.65);
    color: var(--text-main);
    padding: 0.95rem 1rem;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus {
    background: rgba(15, 23, 42, 0.82);
    color: var(--text-main);
    border-color: var(--border-strong);
    box-shadow: 0 0 0 0.25rem rgba(59, 130, 246, 0.14);
}

.form-label,
h1, h2, h3, h4, h5, h6,
.fw-semibold,
.fw-bold {
    color: var(--text-main) !important;
}

.text-secondary,
.lead,
p,
dt {
    color: var(--text-soft) !important;
}

.badge.text-bg-light {
    background: rgba(96, 165, 250, 0.14) !important;
    color: #dbeafe !important;
    border-color: rgba(96, 165, 250, 0.18) !important;
}

.btn-success {
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    border: none;
    color: white;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.28);
}

.btn-success:hover,
.btn-success:focus {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    transform: translateY(-1px);
}

.btn-outline-success {
    border-color: rgba(96, 165, 250, 0.45);
    color: #dbeafe;
}

.btn-outline-success:hover,
.btn-outline-success:focus {
    background: rgba(96, 165, 250, 0.14);
    border-color: rgba(96, 165, 250, 0.55);
    color: white;
}

.alert-danger {
    background: var(--danger-bg) !important;
    color: var(--danger-text) !important;
    border: 1px solid var(--danger-border) !important;
}

.assistant-shell {
    border: 1px solid var(--border);
    border-radius: 30px;
    background: rgba(15, 23, 42, 0.66);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(18px);
    overflow: hidden;
}

.assistant-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem 1.6rem 1.2rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    background:
        linear-gradient(135deg, rgba(96, 165, 250, 0.12), rgba(15, 23, 42, 0.45));
}

.assistant-eyebrow {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #93c5fd;
}

.assistant-title {
    font-size: clamp(1.75rem, 2vw, 2.3rem);
    line-height: 1.1;
    margin: 0;
    color: #f8fbff;
}

.assistant-subtitle {
    max-width: 34rem;
    color: var(--text-soft);
    line-height: 1.6;
    margin-top: 0.55rem;
}

.assistant-user-pill {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 14rem;
    padding: 1rem 1.05rem;
    border: 1px solid rgba(96, 165, 250, 0.18);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.74);
    box-shadow: var(--shadow-md);
}

.assistant-user-name {
    font-weight: 700;
    color: #f8fbff;
}

.assistant-user-email {
    font-size: 0.95rem;
    color: var(--text-soft);
    word-break: break-word;
}

.assistant-thread {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 40rem;
    padding: 1.4rem 1.5rem 1.2rem;
    overflow-y: auto;
    background:
        linear-gradient(180deg, rgba(15, 23, 42, 0.08), rgba(15, 23, 42, 0.18));
}

.assistant-thread::-webkit-scrollbar {
    width: 10px;
}

.assistant-thread::-webkit-scrollbar-thumb {
    background: rgba(96, 165, 250, 0.22);
    border-radius: 999px;
}

.turn {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
}

.turn-bot {
    justify-content: flex-start;
}

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

.assistant-avatar {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 2.45rem;
    height: 2.45rem;
    flex: 0 0 2.45rem;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.22), rgba(59, 130, 246, 0.08));
    border: 1px solid rgba(96, 165, 250, 0.16);
    color: #bfdbfe;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.bubble {
    max-width: min(42rem, 78%);
    padding: 0.95rem 1.15rem;
    border-radius: 20px;
    line-height: 1.65;
    font-size: 1rem;
}

.bubble-bot {
    border-top-left-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.12);
    background: var(--bot-bubble);
    color: var(--text-main);
    box-shadow: var(--shadow-md);
}

.bubble-user {
    border-top-right-radius: 8px;
    background: var(--user-bubble);
    color: white;
    box-shadow: 0 16px 32px rgba(37, 99, 235, 0.25);
}

.bubble-error {
    border-top-left-radius: 8px;
    border: 1px solid var(--danger-border);
    background: var(--danger-bg);
    color: var(--danger-text);
}

.turn-bot-latest {
    margin-top: 0.2rem;
}

.assistant-response {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    max-width: min(44rem, 82%);
}

.suggestion-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    padding-left: 0.1rem;
}

.suggestion-row form {
    margin: 0;
}

.suggestion-chip {
    border: 1px solid rgba(96, 165, 250, 0.24);
    border-radius: 999px;
    padding: 0.72rem 1rem;
    background: rgba(15, 23, 42, 0.82);
    color: #dbeafe;
    font-size: 0.96rem;
    line-height: 1.35;
    transition: 0.18s ease;
    box-shadow: var(--shadow-md);
}

.suggestion-chip:hover,
.suggestion-chip:focus {
    border-color: rgba(96, 165, 250, 0.48);
    background: rgba(37, 99, 235, 0.16);
    color: white;
    transform: translateY(-1px);
}

.assistant-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem 1.35rem;
    border-top: 1px solid rgba(148, 163, 184, 0.1);
    background: rgba(15, 23, 42, 0.55);
}

.assistant-footer-text {
    max-width: 34rem;
    color: var(--text-soft);
    line-height: 1.55;
    margin: 0;
}

.summary-list {
    display: grid;
    gap: 1rem;
}

.summary-row {
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.summary-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.summary-row dt {
    margin-bottom: 0.35rem;
    color: var(--text-soft);
    font-weight: 700;
}

.summary-row dd {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: #f8fbff;
}

.text-break {
    word-break: break-word;
}

@media (max-width: 991.98px) {
    .assistant-header,
    .assistant-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .assistant-user-pill {
        width: 100%;
    }
}

@media (max-width: 767.98px) {
    .assistant-shell {
        border-radius: 22px;
    }

    .assistant-header,
    .assistant-thread,
    .assistant-footer {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .turn {
        gap: 0.6rem;
    }

    .assistant-avatar {
        width: 2.1rem;
        height: 2.1rem;
        flex-basis: 2.1rem;
    }

    .bubble,
    .assistant-response {
        max-width: 100%;
    }

    .suggestion-row {
        flex-direction: column;
    }

    .suggestion-row form,
    .suggestion-chip {
        width: 100%;
    }
}