@import url("https://hashpie.pages.dev/misc/classicroboto/style.css");

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    color-scheme: light;
    --background: #f4f6f8;
    --surface: #ffffff;
    --surface2: #e9edf1;
    --border: #cfd7df;
    --accent: #1d9a93;
    --text: #111717;
    --muted: #5a6772;
    --header: linear-gradient(to bottom, #f5f5f5 0%, #dcdcdc 100%);
    font-family: "Classic Roboto Condensed Regular", system-ui, Arial, Helvetica, sans-serif;
}

body {
    width: 100%;
    height: 100dvh;
    overflow: hidden;
    background: var(--background);
    color: var(--text);
    display: flex;
    flex-direction: column;
}

header {
    height: 62px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    background: var(--header);
}

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

.logo {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    overflow: hidden;
    flex-shrink: 0;
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.brand-name {
    font-size: 18px;
    font-weight: bold;
}

.brand-subtitle {
    font-size: 11px;
    color: var(--muted);
    margin-top: 3px;
}

.status {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 7px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e0a644;
}

.status.ready .status-dot {
    background: #48c98a;
}

.status.error .status-dot {
    background: #e45d5d;
}

main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#chat {
    flex: 1;
    overflow-y: auto;
    padding: 24px max(18px, calc((100% - 850px) / 2));
    display: flex;
    flex-direction: column;
    gap: 22px;
    scroll-behavior: smooth;
}

.message {
    display: flex;
    gap: 12px;
    max-width: 100%;
    animation: appear .2s ease;
}

@keyframes appear {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    flex-direction: row-reverse;
}

.avatar {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: 10px;
    background: var(--surface2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--accent);
    font-size: 14px;
}

.user .avatar {
    background: url(/profile.png);
    background-size: 100% 100%;
    color: white;
}

.content {
    max-width: 80%;
    min-width: 0;
}

.sender {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 7px;
}

.user .sender {
    text-align: right;
}

.bubble {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 12px 15px;
    border-radius: 4px 14px 14px 14px;
    line-height: 1.6;
    font-size: 14px;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.user .bubble {
    background: var(--surface);
    border-color: 1px solid var(--border);
    border-radius: 14px 4px 14px 14px;
}

.typing {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 4px 14px 14px 14px;
    width: fit-content;
}

.typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: bounce .8s infinite alternate;
}

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

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

@keyframes bounce {
    to {
        opacity: .3;
        transform: translateY(-5px);
    }
}

footer {
    flex-shrink: 0;
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 15px 18px;
}

.composer {
    max-width: 850px;
    margin: auto;
    display: flex;
    align-items: flex-end;
    gap: 10px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 8px;
}

#messageInput {
    flex: 1;
    min-width: 0;
    min-height: 42px;
    max-height: 160px;
    resize: none;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 14px;
    line-height: 1.5;
    padding: 11px 9px;
}

#messageInput::placeholder {
    color: #84929a;
}

#sendButton {
    min-width: 42px;
    height: 42px;
    
    border-radius: 2px;
    border: 1px solid #BDBDBD;
    border-bottom-color: #9E9E9E;
    
    background: linear-gradient(to bottom, #F5F5F5 0%, #E0E0E0 100%);
    color: #333333;
    font-family: "Classic Roboto Regular", "Droid Sans", sans-serif;
    font-size: 20px;
    font-weight: normal;
    cursor: pointer;
    flex-shrink: 0;
    
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 1px 1px rgba(0, 0, 0, 0.08);
    transition: background 0.1s ease, border-color 0.1s ease;
}


#sendButton:hover,
#sendButton:focus {
    border-color: #33B5E5;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 0 3px rgba(51, 181, 229, 0.5);
    outline: none;
}


#sendButton:active {
    background: #33B5E5;
    border-color: #0099CC;
    color: #FFFFFF;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.2);
}


#sendButton:disabled {
    background: #EAEAEA;
    border-color: #D6D6D6;
    color: #A0A0A0;
    box-shadow: none;
    cursor: default;
}

.bottom-info {
    max-width: 850px;
    margin: 10px auto 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    color: var(--muted);
}

.actions {
    display: flex;
    gap: 14px;
}

.actions button {
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 11px;
}

.actions button:hover {
    color: var(--accent);
}

@media(max-width: 600px) {
    header {
        height: 56px;
        padding: 0 13px;
    }

    #chat {
        padding: 18px 12px;
    }

    .content {
        max-width: 88%;
    }

    footer {
        padding: 10px;
    }

    .bottom-info {
        padding: 0 4px;
    }
}