:root {
    color-scheme: dark;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    color: #ffffff;
    background: #0f172a;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    background: #0f172a;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
}

.app-shell {
    display: flex;
    width: 100%;
    max-width: 28rem;
    height: 100%;
    flex-direction: column;
    overflow: hidden;
    background: #1e293b;
    box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

.app-header {
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #2c6bed;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.chat-identity,
.header-actions,
.message-row,
.message-composer,
.message-input-wrapper {
    display: flex;
    align-items: center;
}

.chat-identity {
    min-width: 0;
    gap: 0.75rem;
}

.chat-avatar,
.sender-avatar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    font-weight: 700;
}

.chat-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border: 1px solid #64748b;
    background: #475569;
    font-size: 0.875rem;
}

.chat-details {
    min-width: 0;
}

.chat-details h1 {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25;
}

.chat-details span {
    color: #bfdbfe;
    font-size: 0.75rem;
}

.header-actions {
    gap: 1rem;
    color: #ffffff;
}

.icon-button,
.composer-action,
.input-action,
.send-button {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    padding: 0;
    color: inherit;
    background: transparent;
    cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible {
    color: #bfdbfe;
}

.icon {
    display: block;
}

.message-list {
    display: flex;
    min-height: 0;
    flex: 1 1 0%;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    padding: 1rem;
    background: #0f172a;
}

.prototype-notice {
    display: flex;
    justify-content: center;
}

.prototype-notice span {
    max-width: 80%;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    color: #94a3b8;
    background: #1e293b;
    font-size: 0.6875rem;
    text-align: center;
}

.notice-icon,
.delivery-icon {
    display: inline-block;
    vertical-align: -0.125em;
}

.notice-icon {
    margin-right: 0.25rem;
    color: #60a5fa;
}

.message-row {
    max-width: 85%;
    align-items: flex-end;
    gap: 0.5rem;
}

.message-row--incoming {
    justify-content: flex-start;
}

.message-row--outgoing {
    justify-content: flex-end;
    margin-left: auto;
}

.sender-avatar {
    width: 1.75rem;
    height: 1.75rem;
    background: #9333ea;
    font-size: 0.625rem;
}

.message-bubble {
    padding: 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

.message-bubble--incoming {
    border-bottom-left-radius: 0;
    color: #f1f5f9;
    background: #1e293b;
}

.message-bubble--outgoing {
    border-bottom-right-radius: 0;
    color: #ffffff;
    background: #2c6bed;
}

.sender-name,
.message-text {
    margin: 0;
}

.sender-name {
    margin-bottom: 0.25rem;
    color: #c084fc;
    font-size: 0.75rem;
    font-weight: 600;
}

.message-time {
    display: block;
    margin-top: 0.25rem;
    color: #94a3b8;
    font-size: 0.625rem;
    text-align: right;
}

.message-time--outgoing {
    color: #bfdbfe;
}

.delivery-icon {
    margin-left: 0.25rem;
}

.message-composer {
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid #334155;
    background: #1e293b;
}

.composer-action,
.input-action {
    color: #94a3b8;
}

.composer-action {
    padding: 0.5rem;
}

.composer-action:hover,
.composer-action:focus-visible,
.input-action:hover,
.input-action:focus-visible {
    color: #ffffff;
}

.message-input-wrapper {
    min-width: 0;
    flex: 1 1 0%;
    padding: 0.5rem 1rem;
    border: 1px solid #334155;
    border-radius: 9999px;
    background: #0f172a;
}

.message-input {
    min-width: 0;
    width: 100%;
    padding: 0;
    border: 0;
    outline: 0;
    color: #ffffff;
    background: transparent;
    font-size: 0.875rem;
}

.message-input::placeholder {
    color: #64748b;
}

.input-action {
    margin-left: 0.5rem;
}

.send-button {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    color: #ffffff;
    background: #2c6bed;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    transition: background-color 150ms ease;
}

.send-button:hover,
.send-button:focus-visible {
    background: #2563eb;
}

.send-icon {
    display: block;
    margin-left: 2px;
}

@media (min-width: 48rem) {
    .app-shell {
        height: 85vh;
        border-radius: 1rem;
    }

    .back-button {
        display: none;
    }
}
