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

body {
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    background: #0b141a;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

.screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- phone entry screen ---------- */

#phone-screen {
    background: linear-gradient(160deg, #075e54 0%, #0b141a 70%);
}

.phone-card {
    background: #fff;
    border-radius: 16px;
    padding: 36px 32px;
    width: 360px;
    max-width: 92vw;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    text-align: center;
}

.logo {
    font-size: 44px;
}

.phone-card h1 {
    color: #075e54;
    margin: 6px 0 4px;
}

.tagline {
    color: #667781;
    font-size: 13px;
    margin-bottom: 24px;
}

.phone-card label {
    display: block;
    text-align: left;
    font-size: 12px;
    color: #54656f;
    margin: 14px 0 6px;
    font-weight: 600;
}

.phone-row {
    display: flex;
    gap: 8px;
}

.phone-card select,
.phone-card input {
    border: 1px solid #d1d7db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 15px;
    outline: none;
    width: 100%;
    background: #fff;
    color: #111b21;
}

.phone-row select {
    width: 120px;
    flex-shrink: 0;
}

.phone-card input:focus,
.phone-card select:focus {
    border-color: #00a884;
}

#start-btn {
    width: 100%;
    margin-top: 22px;
    background: #00a884;
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

#start-btn:hover {
    background: #008f72;
}

.error {
    color: #d32f2f;
    font-size: 13px;
    margin-top: 12px;
}

/* ---------- chat screen ---------- */

#chat-screen {
    background: #0b141a;
}

.chat-window {
    width: 460px;
    max-width: 100vw;
    height: 92vh;
    max-height: 860px;
    display: flex;
    flex-direction: column;
    background: #efeae2;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
}

.chat-header {
    background: #075e54;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    flex-shrink: 0;
}

#back-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 2px 6px;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #00a884;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}

.chat-title {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    flex: 1;
}

.chat-title span {
    font-size: 12px;
    color: #c5e8e2;
}

.provider-badge {
    font-size: 10px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    padding: 3px 8px;
    letter-spacing: 0.4px;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px 12px;
    background-image: linear-gradient(rgba(229, 221, 213, 0.92), rgba(229, 221, 213, 0.92));
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bubble {
    max-width: 78%;
    padding: 7px 10px 5px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.35;
    white-space: pre-wrap;
    word-wrap: break-word;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
    position: relative;
}

.bubble.user {
    align-self: flex-end;
    background: #d9fdd3;
    border-top-right-radius: 0;
}

.bubble.bot {
    align-self: flex-start;
    background: #fff;
    border-top-left-radius: 0;
}

.bubble .time {
    display: block;
    font-size: 10px;
    color: #8696a0;
    text-align: right;
    margin-top: 2px;
}

.bubble img {
    max-width: 100%;
    border-radius: 6px;
    display: block;
}

.bubble audio {
    max-width: 220px;
    display: block;
}

.bubble b, .bubble strong {
    font-weight: 600;
}

/* ---------- composer ---------- */

.composer {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 8px 10px;
    background: #f0f2f5;
    flex-shrink: 0;
}

#attach-btn,
#send-btn {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #54656f;
    padding: 6px;
}

#send-btn {
    color: #00a884;
}

#text-input {
    flex: 1;
    resize: none;
    border: none;
    border-radius: 20px;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    max-height: 110px;
    background: #fff;
    color: #111b21;
}
