.assistant-shell {
    --brand: #081b54;
    --brand-dark: #1a1a1a;
    --accent: #f4ac10;
    --accent-dark: #d79508;
    --gold: #f4ac10;
    --ink: #171717;
    --muted: #636b75;
    --paper: #ffffff;
    --soft: #f6f7fb;
    --line: #dde1ea;
    --shadow: 0 24px 60px rgba(0, 0, 0, .16);
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(380px, 1.1fr);
    gap: clamp(24px, 5vw, 64px);
    width: min(1180px, calc(100% - 32px));
    /* min-height: calc(100vh - 86px); */
    margin: 21px auto -21px 0px;
    padding: clamp(28px, 5vw, 72px) 0;
    padding-top: 3px;
    align-items: center;
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
}

.assistant-shell,
.assistant-shell * {
    box-sizing: border-box;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    margin: 0 0 14px;
    border: 1px solid rgba(15, 59, 95, .14);
    border-radius: 999px;
    padding: 0 12px;
    background: rgba(255, 255, 255, .82);
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.assistant-shell h1 {
    max-width: 680px;
    margin: 0 0 16px;
    color: var(--brand-dark);
    font-size: clamp(34px, 5vw, 54px);
    line-height: 1.07;
}

.assistant-shell p {
    color: var(--muted);
    line-height: 1.65;
}

.assistant-intro > p:not(.eyebrow) {
    max-width: 640px;
    margin-top: 0;
    font-size: 17px;
}

.value-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 24px;
}

.value-grid article {
    min-height: 92px;
    border: 1px solid rgba(15, 59, 95, .13);
    border-radius: 8px;
    padding: 15px;
    background: rgba(255, 255, 255, .84);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .06);
}

.value-grid article::before {
    content: "";
    display: block;
    width: 34px;
    height: 3px;
    margin-bottom: 12px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--gold), var(--brand));
}

.value-grid strong,
.value-grid span {
    display: block;
}

.value-grid strong {
    margin-bottom: 6px;
    color: var(--ink);
}

.value-grid span {
    color: var(--muted);
    font-size: 14px;
    line-height: 1.4;
}

.chat-card {
    overflow: hidden;
    border: 3px solid rgba(15, 59, 95, .14);
    border-radius: 27px;
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow);
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 66px;
    padding: 0 18px;
    background: linear-gradient(135deg, #111111, var(--brand));
    color: #ffffff;
    border-bottom: 1px solid rgba(244, 172, 16, .42);
}

.chat-header strong,
.chat-header span {
    display: block;
}

.chat-header strong {
    color: #ffffff;
    font-size: 21px;
}

.chat-header span {
    color: rgba(255, 255, 255, .78);
    font-size: 13px;
}

.chat-header a,
.chat-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    border: 1px solid rgba(244, 172, 16, .62);
    border-radius: 999px;
    padding: 0 12px;
    background: rgba(244, 172, 16, .12);
    color: #081b54;
    text-decoration: none;
    font-size: 12px;
    font-weight: 800;
}

.chat-header a {
    color: #fff6dd;
}

.chat-header a.online-status::before {
    content: "";
    width: 8px;
    height: 8px;
    margin-right: 7px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, .18);
}

.chat-messages {
    display: grid;
    align-content: start;
    gap: 10px;
    height: 350px;
    overflow-y: auto;
    padding: 16px;
    background:
        linear-gradient(180deg, #f8fbfc, #ffffff 54%, #f8fbfc);
}

.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(15, 59, 95, .20);
}

.message {
    width: fit-content;
    max-width: min(88%, 560px);
    border-radius: 8px;
    padding: 11px 13px;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.5;
}

.message.assistant {
    border: 1px solid rgba(15, 59, 95, .12);
    border-left: 4px solid var(--gold);
    background:
        linear-gradient(90deg, rgba(244, 172, 16, .08), transparent 44%),
        #ffffff;
    box-shadow: 0 10px 24px rgba(24, 36, 43, .07);
}

.message-content {
    display: grid;
    gap: 9px;
}

.message-content p {
    margin: 0;
    color: var(--ink);
    line-height: 1.55;
}

.message-content p + p {
    padding-top: 8px;
    border-top: 1px solid rgba(8, 27, 84, .08);
}

.message-fact {
    border: 1px solid rgba(244, 172, 16, .32);
    border-radius: 8px;
    padding: 8px 10px !important;
    background: #fffaf0;
    font-weight: 700;
}

.message-heading {
    display: block;
    margin-bottom: 1px;
    color: var(--brand);
    font-size: 13px;
    line-height: 1.35;
}

.message-list {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.message-list li {
    position: relative;
    padding-left: 18px;
    color: var(--ink);
    line-height: 1.45;
}

.message-list li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: .66em;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--gold);
    box-shadow: 0 0 0 3px rgba(244, 172, 16, .15);
}

.message.assistant a {
    color: var(--brand);
    font-weight: 800;
    text-decoration-color: rgba(8, 27, 84, .32);
    text-underline-offset: 2px;
    overflow-wrap: anywhere;
}

.message.user {
    justify-self: end;
    background: var(--brand);
    color: #ffffff;
}

.chat-routes,
.chat-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px 0;
}

.assistant-shell button {
    min-height: 40px;
    border: 1px solid var(--brand);
    border-radius: 999px;
    padding: 0 15px;
    background: var(--brand);
    color: #ffffff;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.assistant-shell button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 59, 95, .18);
}

.chat-routes button {
    flex: 1 1 calc(50% - 8px);
    justify-content: center;
    min-width: 0;
    min-height: 44px;
    border-color: rgba(8, 27, 84, .18);
    border-radius: 8px;
    padding: 9px 12px;
    background: #ffffff;
    color: var(--brand);
    line-height: 1.2;
    white-space: normal;
    text-align: center;
}

.chat-routes button:hover {
    border-color: var(--gold);
    background: #fff8e6;
    color: #1d3140;
}

.chat-routes button:first-child {
    border-color: var(--accent);
    background: var(--accent);
    color: #171717;
}

.chat-routes button:first-child:hover {
    border-color: var(--accent-dark);
    background: var(--accent-dark);
    color: #171717;
}

.lead-details {
    margin: 8px 16px 0;
    border: 1px solid rgba(15, 59, 95, .12);
    border-radius: 8px;
    background: #fbfdfe;
}

.lead-details summary {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0 12px;
    color: var(--brand);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.lead-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 0 12px 12px;
}

.assistant-shell label {
    display: grid;
    gap: 5px;
    color: var(--ink);
    font-size: 12px;
    font-weight: 800;
}

.assistant-shell input {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0 12px;
    background: #ffffff;
    color: var(--ink);
    font: inherit;
}

.assistant-shell input:focus {
    outline: 2px solid rgba(244, 172, 16, .24);
    border-color: var(--accent);
}

.chat-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 12px 16px 8px;
}

.chat-form button,
.save-contact-button {
    background: var(--accent);
    border-color: var(--accent);
    color: #171717;
}

.chat-form button:hover,
.save-contact-button:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    color: #171717;
}

.chat-status {
    margin: 0;
    padding: 0 16px 16px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.typing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 54px;
}

.typing span {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: var(--muted);
    opacity: .4;
    animation: typing-pulse 1s infinite ease-in-out;
}

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

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

@keyframes typing-pulse {
    0%, 100% {
        opacity: .3;
        transform: translateY(0);
    }

    50% {
        opacity: .9;
        transform: translateY(-2px);
    }
}

.save-contact-button {
    width: calc(100% - 24px);
    margin: 0 12px 12px;
}

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

    .assistant-shell {
        width: min(100% - 20px, 620px);
        min-height: auto;
        align-items: start;
        padding: 10px 0 26px;
    }

    .chat-card {
        order: 1;
    }

    .assistant-intro {
        order: 2;
        padding: 4px 2px 0;
    }

    .assistant-shell h1 {
        font-size: 32px;
    }

    .assistant-intro > p:not(.eyebrow) {
        font-size: 15px;
    }

    .chat-messages {
        height: min(48vh, 360px);
        min-height: 280px;
    }

    .chat-routes button {
        flex: 1 1 calc(50% - 8px);
        padding: 0 10px;
    }

    .chat-form {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {
    .chat-header {
        min-height: 60px;
        padding: 0 14px;
    }

    .chat-routes,
    .chat-actions {
        padding-left: 12px;
        padding-right: 12px;
    }

    .chat-form {
        padding-left: 12px;
        padding-right: 12px;
    }

    .lead-details {
        margin-left: 12px;
        margin-right: 12px;
    }

    .chat-routes button {
        flex-basis: 100%;
    }
}
