* {
    box-sizing: border-box
}

:root {
    --ink: #21372e;
    --muted: #737c73;
    --line: #dfe4db;
    --green: #296148;
    --paper: #fafaf6;
    --soft: #edf1e9
}

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif
}

button,
input,
textarea {
    font: inherit
}

button,
a,
input,
textarea {
    outline-offset: 4px
}

button {
    cursor: pointer;
    border: 1px solid var(--line);
    border-radius: 9px;
    padding: 10px 16px;
    background: white;
    color: var(--ink)
}

button:disabled {
    opacity: .5;
    cursor: wait
}

button:hover {
    filter: brightness(.96)
}

a {
    color: var(--green)
}

header {
    height: 84px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    background: #fff
}

.brand {
    color: var(--ink);
    text-decoration: none;
    font-size: 28px;
    font-weight: 750;
    letter-spacing: -1.2px
}

.brand span {
    color: var(--green)
}

.brand small {
    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0;
    margin-left: 24px;
    color: var(--muted)
}

.account {
    display: flex;
    gap: 18px;
    align-items: center
}

.account form {
    margin: 0
}

.quiet {
    background: transparent;
    font-size: 13px
}

.tag,
.eyebrow {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: var(--muted)
}

.tag {
    border: 1px solid var(--line);
    border-radius: 30px;
    padding: 7px 12px
}

.primary {
    background: var(--green);
    border-color: var(--green);
    color: white;
    font-weight: 600
}

.login {
    max-width: 1100px;
    margin: 100px auto;
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 90px;
    padding: 20px
}

.intro h1 {
    font-size: 46px;
    font-weight: 550;
    line-height: 1.17;
    letter-spacing: -1.7px;
    margin: 20px 0
}

.intro p {
    color: var(--muted);
    max-width: 440px;
    font-size: 17px
}

.login-card {
    background: white;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 30px;
    box-shadow: 0 14px 40px #21372e08
}

.login-card h2 {
    font-size: 19px;
    margin: 0 0 8px
}

.login-card p {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 24px
}

.login-card label {
    display: block;
    font-size: 13px;
    margin: 18px 0
}

.login-card input {
    display: block;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px;
    margin-top: 6px;
    background: var(--paper)
}

.login-card button {
    width: 100%;
    margin-top: 10px
}

.error,
#notice {
    color: #ad442e
}

.workspace {
    height: calc(100dvh - 84px);
    display: grid;
    grid-template-columns: 290px 1fr;
    max-width: 1600px;
    margin: auto
}

aside {
    border-right: 1px solid var(--line);
    padding: 30px 24px;
    overflow: auto
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between
}

h2 {
    font-size: 17px;
    margin: 0
}

.count {
    border-radius: 7px;
    background: var(--soft);
    padding: 2px 8px;
    font-size: 12px
}

.muted,
.aside-note {
    color: var(--muted);
    font-size: 13px
}

.upload {
    display: flex;
    flex-direction: column;
    text-align: center;
    border: 1px dashed #9cafa0;
    border-radius: 10px;
    padding: 20px 10px;
    margin: 22px 0;
    cursor: pointer;
    background: #f0f4ec
}

.upload strong {
    font-size: 14px;
    font-weight: 600
}

.upload small {
    color: var(--muted);
    margin-top: 3px
}

.upload input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0
}

.upload:focus-within {
    outline: 2px solid var(--green)
}

.file-list {
    display: grid;
    gap: 10px
}

.file-item {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: white;
    overflow-wrap: anywhere
}

.file-item a {
    display: block;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600
}

.file-item small {
    font-size: 11px;
    color: var(--muted)
}

.aside-note {
    margin-top: 28px;
    font-size: 12px
}

.chat {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    background: white
}

.chat-header {
    padding: 25px 34px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center
}

.chat-header h1 {
    font-size: 23px;
    letter-spacing: -.6px;
    margin: 3px 0 0;
    font-weight: 600
}

.agent-bar {
    padding: 0 34px 18px;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 10px;
    flex-wrap: wrap
}

.agent-status {
    font-size: 11px;
    color: var(--muted);
    padding: 5px 9px;
    border-radius: 30px;
    background: var(--paper);
    border: 1px solid var(--line)
}

.agent-status.busy {
    color: var(--green);
    background: #edf6ea
}

.agent-status.busy:before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border: 2px solid #b4c9b2;
    border-top-color: var(--green);
    border-radius: 50%;
    margin-right: 6px;
    animation: spin 1s linear infinite
}

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

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 30px 34px;
    display: flex;
    flex-direction: column;
    gap: 22px
}

.welcome {
    margin: auto;
    max-width: 450px;
    text-align: center;
    padding: 24px;
    color: var(--muted)
}

.welcome h2 {
    font-size: 25px;
    color: var(--ink);
    font-weight: 550;
    letter-spacing: -.5px
}

.welcome p {
    font-size: 14px
}

.bubble {
    max-width: 82%;
    padding: 15px 19px;
    border-radius: 12px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 14px
}

.bubble.user {
    align-self: flex-end;
    background: #edf3e9
}

.bubble.assistant {
    align-self: flex-start;
    background: #f6f7f3
}

.bubble-label {
    display: block;
    font-size: 10px;
    letter-spacing: .8px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 7px
}

.composer-area {
    padding: 12px 34px 22px;
    border-top: 1px solid var(--line)
}

#notice {
    font-size: 12px;
    min-height: 0;
    margin: 0 0 8px
}

.composer {
    display: flex;
    align-items: flex-end;
    border: 1px solid #ccd7ca;
    border-radius: 12px;
    padding: 10px;
    gap: 10px;
    background: var(--paper)
}

.composer textarea {
    flex: 1;
    resize: vertical;
    min-height: 54px;
    max-height: 160px;
    border: 0;
    background: transparent;
    padding: 8px;
    color: var(--ink);
    font-size: 14px;
    min-width: 0
}

.composer button {
    white-space: nowrap;
    font-size: 13px
}

.composer-hint {
    display: block;
    color: var(--muted);
    font-size: 10px;
    margin-top: 10px
}

@media(max-width:850px) {
    header {
        padding: 0 20px;
        height: 70px
    }

    .brand small,
    .tag {
        display: none
    }

    .workspace {
        height: auto;
        min-height: calc(100dvh - 70px);
        grid-template-columns: 1fr
    }

    aside {
        border-right: 0;
        border-bottom: 1px solid var(--line);
        padding: 18px 20px
    }

    .upload {
        margin: 12px 0;
        padding: 12px
    }

    .aside-note {
        display: none
    }

    .file-list {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr))
    }

    .chat {
        height: 72dvh;
        min-height: 520px
    }

    .chat-header,
    .agent-bar,
    .messages,
    .composer-area {
        padding-left: 20px;
        padding-right: 20px
    }

    .chat-header h1 {
        font-size: 19px
    }

    .bubble {
        max-width: 94%
    }

    .login {
        display: block;
        margin: 30px auto;
        max-width: 500px
    }

    .intro h1 {
        font-size: 36px
    }

    .login-card {
        margin-top: 30px
    }
}