:root {
    color-scheme: dark;
    --page: #000000;
    --surface: #212121;
    --surface-raised: #2f2f2f;
    --border: #2b2b2b;
    --border-strong: #4d4d4d;
    --text: #ffffff;
    --text-muted: #b4b4b4;
    --accent: #2b4388;
    --accent-hover: #34519f;
    --focus-ring: #8ca4ff;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    background: var(--page);
}

body {
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    overflow-x: hidden;
    background: linear-gradient(to bottom, #000000, #19081b);
    color: var(--text);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button,
textarea,
input {
    font: inherit;
}

button {
    color: inherit;
}

.landing {
    display: flex;
    min-height: 100vh;
    min-height: 100svh;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
}

.hero {
    width: 100%;
    max-width: 1150px;
    text-align: center;
    transform: translateY(-27px);
}

.hero h1 {
    position: relative;
    top: -4px;
    margin: 0 0 43px;
    color: var(--text);
    font-size: 36px;
    font-weight: 400;
    line-height: 44px;
    letter-spacing: 0;
}

.composer {
    display: flex;
    width: 100%;
    min-height: 78px;
    align-items: center;
    gap: 17px;
    padding: 10px 16px 10px 18px;
    border: 1px solid var(--border);
    border-radius: 39px;
    background: var(--surface);
    text-align: left;
    transition: border-color 160ms ease, border-radius 160ms ease;
}

.composer.is-multiline {
    border-radius: 28px;
}

.icon-button,
.send-button {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.icon-button {
    width: 48px;
    height: 48px;
    color: #f2f2f2;
    transition: background-color 150ms ease, color 150ms ease;
}

.icon-button svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.add-button svg {
    width: 36px;
    height: 36px;
    stroke-width: 2;
}

.add-button.has-file {
    color: #a9c2ff;
}

.add-button.is-hidden {
    display: none;
}

.mic-button svg {
    width: 36px;
    height: 36px;
    stroke-width: 1.6;
}

.mic-button.is-listening {
    color: #a9c2ff;
    background: rgba(140, 164, 255, 0.14);
}

.mic-button.is-hidden {
    display: none;
}

.icon-button:hover,
.icon-button:focus-visible {
    background: rgba(255, 255, 255, 0.08);
}

#prompt {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    height: 35px;
    max-height: 150px;
    margin: 0 0 0 20px;
    padding: 0 0 0 2px;
    overflow-y: hidden;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    caret-color: var(--text);
    font-size: 24px;
    font-weight: 400;
    line-height: 35px;
    resize: none;
}

#prompt::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.send-button {
    width: 50px;
    height: 50px;
    background: var(--accent);
    color: #ffffff;
    transition: background-color 150ms ease, transform 150ms ease;
}

.send-button svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.1;
}

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

.send-button:active {
    transform: scale(0.96);
}

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

.send-button:disabled:hover {
    background: var(--accent);
}

.landing.is-chatting {
    align-items: stretch;
    padding: 26px 0 22px;
}

.landing.is-chatting .hero {
    display: flex;
    width: 100%;
    height: calc(100vh - 48px);
    height: calc(100dvh - 48px);
    max-width: none;
    flex-direction: column;
    text-align: left;
    transform: none;
}

.landing.is-chatting .composer {
    width: min(920px, calc(100% - 40px));
    margin-inline: auto;
}

.landing.is-chatting .hero h1,
.landing.is-chatting .suggestions {
    display: none;
}

.conversation {
    display: flex;
    width: 100%;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 18px;
    padding: 8px clamp(18px, 4vw, 56px) 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
    text-align: left;
    scrollbar-color: #3a3a3a transparent;
    scrollbar-width: thin;
}

.conversation[hidden] {
    display: none;
}

.conversation::-webkit-scrollbar {
    width: 8px;
}

.conversation::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: #3a3a3a;
}

.message {
    display: flex;
    max-width: min(84%, 760px);
    flex-direction: column;
    gap: 6px;
    animation: message-in 180ms ease both;
}

.message-user {
    align-self: flex-end;
    align-items: flex-end;
}

.message-assistant {
    align-self: flex-start;
    align-items: flex-start;
}

.message-label {
    padding: 0 6px;
    color: #9a9a9a;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.03em;
    line-height: 1.2;
}

.message-assistant .message-label {
    color: #a9c2ff;
}

.message-body {
    padding: 13px 17px;
    border-radius: 20px;
    font-size: 16px;
    line-height: 1.65;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.message-user .message-body {
    border-bottom-right-radius: 7px;
    background: #2f2f2f;
    color: var(--text);
}

.message-assistant .message-body {
    border: 1px solid #2b2b2b;
    border-bottom-left-radius: 7px;
    background: #171717;
    color: #ededed;
}

.message-error .message-body {
    border-color: #5d2e2e;
    background: #1e1414;
    color: #ffc1c1;
}

.markdown-body {
    white-space: normal;
}

.markdown-body > :first-child {
    margin-top: 0;
}

.markdown-body > :last-child {
    margin-bottom: 0;
}

.markdown-body p {
    margin: 0 0 0.85em;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    margin: 1.2em 0 0.55em;
    color: #ffffff;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.markdown-body h1 {
    font-size: 1.35em;
}

.markdown-body h2 {
    font-size: 1.25em;
}

.markdown-body h3 {
    font-size: 1.15em;
}

.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    font-size: 1em;
}

.markdown-body ul,
.markdown-body ol {
    margin: 0.55em 0 0.9em;
    padding-left: 1.4em;
}

.markdown-body li {
    margin: 0.25em 0;
}

.markdown-body li > p {
    margin: 0.25em 0;
}

.markdown-body li::marker {
    color: #8f8f8f;
}

.markdown-body strong {
    color: #ffffff;
    font-weight: 600;
}

.markdown-body em {
    color: #dcdcdc;
}

.markdown-body a {
    color: #a9c2ff;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.markdown-body a:hover {
    color: #cfdcff;
}

.markdown-body a:focus-visible {
    border-radius: 2px;
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

.markdown-body code,
.markdown-body kbd,
.markdown-body samp {
    padding: 0.16em 0.38em;
    border: 1px solid #353535;
    border-radius: 5px;
    background: #242424;
    color: #f1f1f1;
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 0.88em;
}

.markdown-body pre {
    max-width: 100%;
    margin: 0.8em 0;
    padding: 13px 15px;
    overflow-x: auto;
    border: 1px solid #303030;
    border-radius: 12px;
    background: #0e0e0e;
    scrollbar-color: #3a3a3a transparent;
    scrollbar-width: thin;
}

.markdown-body pre code {
    padding: 0;
    border: 0;
    background: transparent;
    color: #e8e8e8;
    font-size: 0.86em;
    line-height: 1.6;
    white-space: pre;
}

.markdown-body blockquote {
    margin: 0.85em 0;
    padding: 0.1em 0 0.1em 14px;
    border-left: 3px solid #53669e;
    color: #c9c9c9;
}

.markdown-body blockquote p:last-child {
    margin-bottom: 0;
}

.markdown-body hr {
    height: 1px;
    margin: 1.25em 0;
    border: 0;
    background: #353535;
}

.markdown-body table {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0.9em 0;
    overflow-x: auto;
    border-collapse: collapse;
    font-size: 0.92em;
    -webkit-overflow-scrolling: touch;
}

.markdown-body th,
.markdown-body td {
    padding: 8px 11px;
    border: 1px solid #363636;
    text-align: left;
    vertical-align: top;
}

.markdown-body th {
    background: #242424;
    color: #ffffff;
    font-weight: 600;
}

.markdown-body tbody tr:nth-child(even) {
    background: #1d1d1d;
}

.markdown-body img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.message-typing .message-body {
    display: flex;
    min-height: 49px;
    align-items: center;
    gap: 10px;
}

.thinking-text {
    color: #d7d7d7;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.01em;
    line-height: 1;
}

.thinking-spinner {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
    border: 2px solid rgba(169, 194, 255, 0.24);
    border-top-color: #a9c2ff;
    border-radius: 50%;
    animation: thinking-spin 700ms linear infinite;
}

@keyframes thinking-spin {
    to {
        transform: rotate(360deg);
    }
}

.message-text {
    min-width: 0;
}

.message-progress {
    display: none;
    min-height: 7px;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
}

.message-progress.is-visible {
    display: flex;
}

.stream-dots {
    display: inline-flex;
    height: 7px;
    align-items: center;
    gap: 5px;
    line-height: 0;
}

.stream-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #a9c2ff;
    opacity: 0.28;
    animation: stream-dot-blink 900ms infinite step-end;
}

.stream-dot:nth-child(2) {
    animation-delay: 300ms;
}

.stream-dot:nth-child(3) {
    animation-delay: 600ms;
}

@keyframes stream-dot-blink {
    0%,
    33.33% {
        opacity: 1;
    }

    33.34%,
    100% {
        opacity: 0.28;
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.suggestions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 18px;
}

.suggestion {
    display: inline-flex;
    min-height: 66px;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: 20.5px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: background-color 150ms ease, border-color 150ms ease;
}

.suggestion:hover {
    border-color: #626262;
    background: #292929;
}

.suggestion:active {
    background: var(--surface-raised);
}

.icon-button:focus-visible,
.send-button:focus-visible,
.suggestion:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 3px;
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    border: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    clip-path: inset(50%) !important;
    white-space: nowrap !important;
}

.welcome-dialog {
    width: min(540px, calc(100vw - 32px));
    max-width: 540px;
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 30px;
    overflow-y: auto;
    border: 1px solid #343434;
    border-radius: 24px;
    background: #171717;
    box-shadow: 0 32px 100px rgba(0, 0, 0, 0.72);
    color: #f1f1f1;
    text-align: left;
    animation: dialog-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.welcome-dialog::backdrop {
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(5px);
    animation: backdrop-in 180ms ease-out both;
}

.welcome-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.welcome-mark {
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    border-radius: 12px;
}

.welcome-eyebrow {
    color: #a9c2ff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    line-height: 1.3;
    text-transform: uppercase;
}

.welcome-dialog h2 {
    margin: 0 0 12px;
    color: #ffffff;
    font-size: 26px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.welcome-dialog p {
    margin: 0 0 26px;
    color: #b9b9b9;
    font-size: 15.5px;
    line-height: 1.65;
}

.welcome-dialog form {
    margin: 0;
}

.welcome-start {
    display: inline-flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    border: 0;
    border-radius: 13px;
    background: var(--accent);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 150ms ease, transform 150ms ease;
}

.welcome-start:hover {
    background: var(--accent-hover);
}

.welcome-start:active {
    transform: scale(0.99);
}

.welcome-start:focus-visible {
    outline: 2px solid var(--focus-ring);
    outline-offset: 3px;
}

@keyframes dialog-in {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes backdrop-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.toast {
    position: fixed;
    z-index: 10;
    right: 50%;
    bottom: 28px;
    max-width: min(92vw, 540px);
    padding: 13px 20px;
    border: 1px solid #3b3b3b;
    border-radius: 14px;
    background: #1f1f1f;
    box-shadow: 0 12px 42px rgba(0, 0, 0, 0.48);
    color: #ededed;
    font-size: 15px;
    line-height: 1.4;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transform: translate(50%, 12px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translate(50%, 0);
}

@media (max-width: 720px) {
    .landing {
        align-items: flex-start;
        padding: max(18vh, 110px) 14px 28px;
    }

    .hero {
        transform: none;
    }

    .hero h1 {
        margin-bottom: 28px;
        font-size: 28px;
        line-height: 35px;
        letter-spacing: -0.3px;
    }

    .composer {
        min-height: 66px;
        gap: 6px;
        padding: 8px 9px 8px 10px;
        border-radius: 33px;
    }

    .composer.is-multiline {
        border-radius: 24px;
    }

    .icon-button {
        width: 42px;
        height: 42px;
    }

    .add-button svg {
        width: 32px;
        height: 32px;
    }

    .mic-button svg {
        width: 32px;
        height: 32px;
    }

    #prompt {
        height: 30px;
        max-height: 120px;
        font-size: 17px;
        line-height: 30px;
    }

    .send-button {
        width: 44px;
        height: 44px;
    }

    .send-button svg {
        width: 23px;
        height: 23px;
    }

    .suggestions {
        gap: 10px;
        margin-top: 14px;
    }

    .suggestion {
        min-height: 48px;
        padding: 10px 18px;
        font-size: 16px;
    }

    .landing.is-chatting {
        padding: 12px 0;
    }

    .landing.is-chatting .hero {
        height: calc(100vh - 24px);
        height: calc(100dvh - 24px);
    }

    .landing.is-chatting .composer {
        width: 95%;
    }

    .conversation {
        gap: 14px;
        margin-bottom: 12px;
        padding: 4px 14px 12px;
    }

    .message {
        max-width: 92%;
    }

    .message-body {
        padding: 11px 14px;
        font-size: 15px;
        line-height: 1.6;
    }

    .message-label {
        font-size: 11px;
    }

    .welcome-dialog {
        padding: 24px;
        border-radius: 20px;
    }

    .welcome-heading {
        gap: 12px;
        margin-bottom: 18px;
    }

    .welcome-dialog h2 {
        font-size: 23px;
    }

    .welcome-dialog p {
        font-size: 15px;
    }
}

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

    /*
     * Keep the thinking indicator moving: it communicates that a request is
     * still active, and it is the only animation shown while waiting.
     */
    .thinking-spinner {
        animation-duration: 700ms !important;
        animation-iteration-count: infinite !important;
    }

    .stream-dot {
        animation-duration: 900ms !important;
        animation-iteration-count: infinite !important;
    }
}
