:root {
    --bg: #eef4ef;
    --surface: #ffffff;
    --surface-soft: #f7faf7;
    --ink: #17211c;
    --muted: #67736d;
    --brand: #0b7a55;
    --brand-strong: #075f43;
    --accent: #e7b33f;
    --border: #d9e3dd;
    --bot: #ffffff;
    --user: #d9f8df;
    --shadow: 0 24px 70px rgba(16, 42, 29, 0.16);
}

* { box-sizing: border-box; }

html,
body {
    height: 100%;
    margin: 0;
}

body {
    font-family: "DM Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 8%, rgba(231, 179, 63, 0.22), transparent 28%),
        linear-gradient(135deg, #f5f8f3 0%, #e5f0e9 48%, #d8e9df 100%);
    overflow: hidden;
}

button,
textarea {
    font: inherit;
}

.app-shell {
    width: min(1180px, calc(100vw - 32px));
    height: min(820px, calc(100vh - 32px));
    margin: 16px auto;
    display: grid;
    grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 28px;
    box-shadow: var(--shadow);
    overflow: hidden;
    backdrop-filter: blur(18px);
}

.sales-panel {
    padding: 28px;
    background:
        linear-gradient(180deg, rgba(9, 95, 67, 0.96), rgba(8, 72, 52, 0.96)),
        url("../images/ice-logo-mark.svg") center 86% / 260px no-repeat;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.brand-lockup,
.agent {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-lockup img,
.agent-avatar {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #fff;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
}

.brand-lockup strong,
.agent h2 {
    display: block;
    font-family: "Outfit", sans-serif;
    font-size: 20px;
    line-height: 1;
}

.brand-lockup span,
.agent p,
.seller-card p,
.deal-strip span,
.summary-card p {
    color: rgba(255, 255, 255, 0.74);
}

.seller-card {
    margin-top: 18px;
}

.eyebrow {
    color: var(--accent);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 12px;
}

.seller-card h1 {
    font-family: "Outfit", sans-serif;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.02;
    margin: 12px 0 14px;
    letter-spacing: 0;
}

.seller-card p {
    font-size: 16px;
    line-height: 1.55;
    margin: 0;
}

.deal-strip {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.deal-strip div,
.summary-card {
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    padding: 14px;
}

.deal-strip strong {
    display: block;
    margin-bottom: 3px;
}

.summary-card {
    margin-top: auto;
}

.summary-card h2 {
    font-size: 16px;
    margin: 0 0 12px;
}

.summary-card p {
    margin: 0;
    color: rgba(255, 255, 255, 0.74);
    line-height: 1.5;
}

.chat-app {
    display: grid;
    grid-template-rows: auto 1fr auto auto;
    min-width: 0;
    background: rgba(247, 250, 247, 0.96);
}

.chat-header {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.86);
}

.agent-avatar img {
    width: 34px;
    height: 34px;
}

.agent h2 {
    color: var(--ink);
    margin: 0 0 4px;
}

.agent p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.agent p span {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #20bf6b;
    margin-right: 6px;
}

.icon-button {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 12px;
    color: var(--brand);
    display: grid;
    place-items: center;
    cursor: pointer;
}

.icon-button svg,
.composer button svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.messages {
    overflow-y: auto;
    padding: 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    display: flex;
}

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

.bubble {
    max-width: min(560px, 86%);
    padding: 12px 14px;
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(16, 42, 29, 0.08);
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.message.bot .bubble {
    background: var(--bot);
    border-top-left-radius: 6px;
}

.message.user .bubble {
    background: var(--user);
    border-top-right-radius: 6px;
}

.time {
    display: block;
    color: var(--muted);
    font-size: 11px;
    text-align: right;
    margin-top: 5px;
}

.typing .bubble {
    display: flex;
    gap: 5px;
    align-items: center;
}

.dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #9aa8a0;
    animation: bounce 900ms infinite ease-in-out;
}

.dot:nth-child(2) { animation-delay: 120ms; }
.dot:nth-child(3) { animation-delay: 240ms; }

@keyframes bounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.45; }
    40% { transform: translateY(-4px); opacity: 1; }
}

.choice-bar,
.tool-zone {
    padding: 0 20px 10px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.choice-bar:empty,
.tool-zone:empty {
    display: none;
}

.choice {
    border: 1px solid #c9ddd0;
    background: #fff;
    color: var(--brand-strong);
    border-radius: 999px;
    padding: 9px 13px;
    font-weight: 700;
    cursor: pointer;
}

.choice.ghost {
    font-weight: 600;
    color: var(--muted);
    background: #f8fbf9;
}

.flavor-grid {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(5, minmax(92px, 1fr));
    gap: 8px;
}

.flavor {
    border: 1px solid var(--border);
    background: var(--surface);
    border-radius: 14px;
    padding: 10px;
    text-align: left;
    cursor: pointer;
}

.flavor.selected {
    border-color: var(--brand);
    background: #e8f7ee;
}

.flavor strong,
.flavor span {
    display: block;
}

.flavor span {
    color: var(--muted);
    font-size: 12px;
    margin-top: 3px;
}

.date-tool {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.date-tool input {
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0 12px;
    background: #fff;
    color: var(--ink);
}

.date-tool button,
.confirm-flavors {
    height: 44px;
    border: 0;
    border-radius: 12px;
    padding: 0 14px;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.confirm-flavors:disabled {
    background: #9ca8a0;
    cursor: not-allowed;
}

.composer {
    padding: 12px 16px 16px;
    display: grid;
    grid-template-columns: 1fr 48px;
    gap: 10px;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.composer textarea {
    min-height: 48px;
    max-height: 120px;
    resize: none;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 13px 14px;
    outline: none;
    background: var(--surface-soft);
    color: var(--ink);
}

.composer textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(11, 122, 85, 0.12);
}

.composer button {
    border: 0;
    border-radius: 16px;
    background: var(--brand);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
}

@media (max-width: 880px) {
    body { overflow: hidden; }

    .app-shell {
        width: 100vw;
        height: 100dvh;
        margin: 0;
        border-radius: 0;
        grid-template-columns: 1fr;
    }

    .sales-panel {
        display: none;
    }

    .chat-app {
        min-height: 100dvh;
    }

    .flavor-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bubble {
        max-width: 92%;
    }
}
