* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(160deg, #1e293b, #0f172a);
    color: #e2e8f0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

.app {
    width: 100%;
    max-width: 640px;
    padding: 24px 16px 32px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1 {
    font-size: 1.5rem;
    margin: 8px 0 4px;
    text-align: center;
}

.hint {
    text-align: center;
    color: #94a3b8;
    margin: 0 0 16px;
    font-size: 0.9rem;
}

.chat {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 8px 0;
}

.msg {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 16px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.msg.user {
    align-self: flex-end;
    background: #2563eb;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.msg.assistant {
    align-self: flex-start;
    background: #334155;
    border-bottom-left-radius: 4px;
}

.controls {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
}

.record-btn {
    flex: 1;
    padding: 16px;
    font-size: 1rem;
    border: none;
    border-radius: 14px;
    background: #2563eb;
    color: #fff;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s, transform 0.05s;
}

.record-btn:active { transform: scale(0.98); }
.record-btn.recording { background: #dc2626; animation: pulse 1s infinite; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.reset-btn {
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 14px;
    background: #334155;
    color: #e2e8f0;
    font-size: 1.3rem;
    cursor: pointer;
}

.status {
    text-align: center;
    color: #94a3b8;
    min-height: 20px;
    margin-top: 10px;
    font-size: 0.85rem;
}
