:root {
    --ink: #18213d;
    --muted: #707895;
    --purple: #6f43e9;
    --purple-dark: #4c29b8;
    --pink: #ed4f91;
    --panel: #ffffff;
    --line: #e9e9f4;
    --soft: #f7f6fd;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    background: #efeafd;
    color: var(--ink);
    font-family: "Nunito", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
textarea {
    font: inherit;
}

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

.trial-shell {
    display: grid;
    grid-template-columns: minmax(330px, 0.86fr) minmax(520px, 1.14fr);
    width: min(1180px, calc(100% - 48px));
    height: min(780px, calc(100vh - 48px));
    min-height: 620px;
    margin: 24px auto;
    overflow: hidden;
    border: 1px solid rgba(81, 45, 176, 0.12);
    border-radius: 32px;
    background: var(--panel);
    box-shadow: 0 28px 75px rgba(49, 28, 106, 0.2);
}

.intro-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 38px 42px 36px;
    color: #fff;
    background:
        radial-gradient(circle at 82% 13%, rgba(249, 161, 207, 0.5), transparent 25%),
        radial-gradient(circle at 10% 88%, rgba(100, 215, 235, 0.27), transparent 27%),
        linear-gradient(145deg, #4922aa 0%, #6f3ed9 49%, #922d9e 100%);
}

.brand {
    position: relative;
    z-index: 2;
    display: inline-flex;
    width: fit-content;
    padding: 11px 15px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(35, 14, 90, 0.17);
}

.brand img {
    width: 190px;
    height: 30px;
    object-fit: contain;
}

.intro-copy {
    position: relative;
    z-index: 2;
    margin: auto 0;
}

.trial-badge {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 24px;
    padding: 8px 13px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    backdrop-filter: blur(9px);
}

.trial-badge span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #70efbd;
    box-shadow: 0 0 0 5px rgba(112, 239, 189, 0.16);
}

.intro-copy h1 {
    max-width: 490px;
    margin: 0;
    font-size: clamp(38px, 4.1vw, 62px);
    font-weight: 900;
    line-height: 1.03;
    letter-spacing: -0.045em;
}

.intro-copy h1 em {
    color: #ffd364;
    font-style: normal;
}

.intro-copy > p {
    max-width: 450px;
    margin: 23px 0 0;
    color: rgba(255, 255, 255, 0.79);
    font-size: 17px;
    font-weight: 600;
    line-height: 1.62;
}

.knowledge-note {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    background: rgba(30, 10, 81, 0.23);
    backdrop-filter: blur(10px);
}

.knowledge-icon {
    display: grid;
    flex: 0 0 42px;
    height: 42px;
    place-items: center;
    border-radius: 13px;
    color: #5c31c5;
    background: #ffe27d;
    font-size: 22px;
    font-weight: 900;
}

.knowledge-note strong,
.knowledge-note span {
    display: block;
}

.knowledge-note strong {
    margin-bottom: 2px;
    font-size: 14px;
}

.knowledge-note span {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    line-height: 1.4;
}

.orbit {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
}

.orbit::after {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ffcf5c;
    box-shadow: 0 0 22px rgba(255, 207, 92, 0.85);
    content: "";
}

.orbit-one {
    top: 22%;
    right: -120px;
    width: 310px;
    height: 310px;
}

.orbit-one::after {
    top: 24px;
    left: 57px;
}

.orbit-two {
    bottom: -165px;
    left: -130px;
    width: 350px;
    height: 350px;
}

.orbit-two::after {
    top: 18px;
    right: 88px;
    background: #78efdd;
}

.chat-panel {
    display: grid;
    min-width: 0;
    min-height: 0;
    grid-template-rows: auto 1fr auto;
    background:
        linear-gradient(rgba(255, 255, 255, 0.93), rgba(255, 255, 255, 0.93)),
        radial-gradient(circle at center, #ede9fb 1.4px, transparent 1.5px);
    background-size: auto, 21px 21px;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 13px;
    min-height: 92px;
    padding: 18px 28px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
}

.bot-avatar {
    position: relative;
    display: grid;
    flex: 0 0 55px;
    height: 55px;
    overflow: hidden;
    place-items: center;
    border: 3px solid #fff;
    border-radius: 18px;
    background: linear-gradient(145deg, #eee8ff, #dcd1ff);
    box-shadow: 0 5px 16px rgba(91, 58, 178, 0.2);
}

.bot-avatar img {
    width: 51px;
    height: 51px;
    object-fit: cover;
}

.bot-avatar span {
    position: absolute;
    right: 1px;
    bottom: 1px;
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #3bd79b;
}

.chat-header h2,
.chat-header p {
    margin: 0;
}

.chat-header h2 {
    font-size: 19px;
    font-weight: 900;
}

.chat-header p {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.online-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #30c98d;
}

.reset-button,
.mobile-close-button {
    display: grid;
    width: 42px;
    height: 42px;
    margin-left: auto;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 13px;
    color: #776f92;
    background: #fff;
    cursor: pointer;
    transition: 160ms ease;
}

.mobile-close-button {
    display: none;
    margin-left: -5px;
}

.reset-button:hover,
.mobile-close-button:hover {
    color: var(--purple);
    border-color: #cfc4f5;
    background: #f7f4ff;
}

.reset-button svg,
.mobile-close-button svg,
.composer button svg {
    width: 20px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.messages {
    overflow-y: auto;
    min-height: 0;
    padding: 28px clamp(22px, 4vw, 42px);
    scrollbar-color: #d7d0ee transparent;
    scrollbar-width: thin;
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
    animation: message-in 220ms ease both;
}

@keyframes message-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.message-body {
    width: fit-content;
    max-width: min(84%, 530px);
    padding: 14px 17px;
    border-radius: 7px 20px 20px 20px;
    color: #38405c;
    background: #f0eef8;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.55;
    box-shadow: 0 5px 16px rgba(43, 31, 84, 0.06);
}

.message-body p,
.message-body ol,
.message-body ul {
    margin: 0 0 8px;
}

.message-body p:last-child,
.message-body ol:last-child,
.message-body ul:last-child {
    margin-bottom: 0;
}

.message-body ol,
.message-body ul {
    padding-left: 21px;
}

.message-body strong {
    color: #262d4b;
    font-weight: 900;
}

.mini-avatar {
    display: grid;
    flex: 0 0 29px;
    height: 29px;
    margin-top: 2px;
    place-items: center;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(145deg, var(--purple), var(--pink));
    font-size: 12px;
    font-weight: 900;
}

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

.user-message .message-body {
    order: 1;
    color: #fff;
    border-radius: 20px 7px 20px 20px;
    background: linear-gradient(135deg, #7147e5, #8c4cdf);
    box-shadow: 0 7px 20px rgba(103, 66, 211, 0.18);
}

.suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin: 8px 0 0 39px;
}

.suggestions button {
    padding: 10px 13px;
    border: 1px solid #ddd5f5;
    border-radius: 999px;
    color: #6044af;
    background: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: 160ms ease;
}

.suggestions button:hover {
    transform: translateY(-1px);
    border-color: #a894e8;
    background: #f6f2ff;
}

.typing .message-body {
    display: flex;
    gap: 5px;
    padding: 17px 19px;
}

.typing i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #8f83ac;
    animation: bounce 1s infinite ease-in-out;
}

.typing i:nth-child(2) { animation-delay: 0.12s; }
.typing i:nth-child(3) { animation-delay: 0.24s; }

@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.48; }
    30% { transform: translateY(-5px); opacity: 1; }
}

.composer-wrap {
    padding: 16px 28px 20px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.94);
}

.composer {
    display: flex;
    /* align-items: flex-end; */
    max-height: 56px;
    overflow: auto;
    gap: 10px;
    padding: 8px 8px 8px 17px;
    border: 1.5px solid #ded9ef;
    border-radius: 19px;
    background: #fff;
    box-shadow: 0 8px 23px rgba(55, 39, 105, 0.07);
    transition: 160ms ease;
}

.composer:focus-within {
    border-color: #9e86e8;
    box-shadow: 0 0 0 4px rgba(111, 67, 233, 0.08), 0 8px 23px rgba(55, 39, 105, 0.07);
}

.composer textarea {
    width: 100%;
    max-height: 120px;
    resize: none;
    border: 0;
    outline: 0;
    color: var(--ink);
    background: transparent;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.45;
}

.composer textarea::placeholder {
    color: #a09bb1;
}

.composer button {
    display: grid;
    flex: 0 0 42px;
    height: 42px;
    place-items: center;
    border: 0;
    border-radius: 13px;
    color: #fff;
    background: linear-gradient(145deg, var(--purple), #8f48dc);
    box-shadow: 0 7px 16px rgba(102, 62, 213, 0.25);
    cursor: pointer;
    transition: 160ms ease;
}

.composer button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 9px 19px rgba(102, 62, 213, 0.32);
}

.composer button:disabled {
    cursor: wait;
    opacity: 0.55;
}

.chat-disclaimer {
    margin: 9px 0 0;
    color: #9893a8;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
}

.wonderbot-action-btn {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    margin-top: 7px;
    padding: 9px 15px;
    border: 1px solid rgba(111, 67, 233, .16);
    border-radius: 11px;
    color: #fff;
    background: linear-gradient(135deg, var(--purple), #8c4cdf);
    box-shadow: 0 7px 17px rgba(103, 66, 211, .2);
    font-size: 12px;
    font-weight: 900;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: 160ms ease;
}

.wonderbot-action-btn::after {
    margin-left: 8px;
    content: "→";
    font-size: 15px;
    line-height: 1;
}

.wonderbot-action-btn:hover,
.wonderbot-action-btn:focus-visible {
    transform: translateY(-1px);
    color: #fff;
    box-shadow: 0 9px 21px rgba(103, 66, 211, .27);
    outline: none;
}

.wonderbot-action-btn:disabled,
.wonderbot-choice-btn:disabled {
    transform: none;
    cursor: default;
    opacity: .58;
}

.wonderbot-choice-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    width: min(430px, 100%);
    margin-top: 10px;
}

.wonderbot-choice-btn {
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid #d8cff2;
    border-radius: 11px;
    color: #5d42a7;
    background: #fff;
    font-size: 11px;
    font-weight: 850;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
    transition: 150ms ease;
}

.wonderbot-choice-btn:hover:not(:disabled),
.wonderbot-choice-btn:focus-visible {
    transform: translateY(-1px);
    border-color: #9f8bdd;
    background: #f8f5ff;
    outline: none;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

@media (max-width: 860px) {
    body {
        background: #fff;
    }

    .trial-shell {
        display: block;
        width: 100%;
        height: 100dvh;
        min-height: 560px;
        margin: 0;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .intro-panel {
        display: none;
    }

    .chat-panel {
        height: 100%;
    }

    .chat-header {
        min-height: 78px;
        padding: 13px 18px;
    }

    .mobile-close-button {
        display: grid;
    }

    .bot-avatar {
        flex-basis: 49px;
        height: 49px;
        border-radius: 16px;
    }

    .bot-avatar img {
        width: 45px;
        height: 45px;
    }

    .messages {
        padding: 23px 16px;
    }

    .message-body {
        max-width: 85%;
    }

    .suggestions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        margin-left: 39px;
    }

    .suggestions button {
        min-height: 46px;
        border-radius: 15px;
        line-height: 1.25;
        text-align: left;
    }

    .composer-wrap {
        padding: 12px 14px max(12px, env(safe-area-inset-bottom));
    }
}

@media (max-width: 430px) {
    .chat-header {
        gap: 8px;
        padding: 11px 10px;
    }

    .chat-header > div:nth-child(2) {
        min-width: 0;
    }

    .chat-header h2 {
        font-size: 17px;
    }

    .reset-button {
        width: 39px;
        height: 39px;
    }

    .mobile-close-button {
        display: grid;
        width: 37px;
        height: 37px;
        margin-left: -3px;
    }

    .suggestions {
        grid-template-columns: 1fr;
    }

    .message-body {
        max-width: calc(100% - 39px);
        padding: 13px 15px;
        font-size: 13.5px;
    }

    .wonderbot-choice-list {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
