* { margin: 0; padding: 0; box-sizing: border-box; }
:root { --green: #06C755; --bg: #7494C0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: #E8ECF0;
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.phone-frame {
    width: 100%; max-width: 420px; height: 100dvh;
    background: var(--bg);
    display: flex; flex-direction: column; overflow: hidden;
}
@media (min-width: 500px) {
    .phone-frame {
        height: 780px; border-radius: 32px;
        box-shadow: 0 20px 60px rgba(0,0,0,0.25);
        border: 8px solid #2C2C2C;
    }
}

.chat-header {
    background: var(--green); color: white;
    padding: 14px 16px; display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
.chat-header .avatar {
    width: 42px; height: 42px; border-radius: 50%; background: white;
    display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.chat-header .info h3 { font-size: 16px; }
.chat-header .info span { font-size: 11px; opacity: 0.85; }

.chat-body {
    flex: 1; overflow-y: auto; padding: 16px;
    display: flex; flex-direction: column; gap: 8px;
    -webkit-overflow-scrolling: touch;
}

.msg-row { display: flex; gap: 8px; max-width: 88%; animation: msgIn 0.25s ease-out; }
.msg-row.bot { align-self: flex-start; }
.msg-row.user { align-self: flex-end; flex-direction: row-reverse; }

.bubble-avatar {
    width: 32px; height: 32px; border-radius: 50%; background: white;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; flex-shrink: 0;
}

.bubble {
    padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.6;
    white-space: pre-wrap; word-break: break-word; position: relative;
}
.bot .bubble { background: white; color: #333; border-bottom-left-radius: 4px; }
.user .bubble { background: var(--green); color: white; border-bottom-right-radius: 4px; }

.copy-btn {
    display: block; margin-top: 6px; background: none; border: 1px solid #CCC;
    border-radius: 8px; padding: 2px 10px; font-size: 11px; color: #999; cursor: pointer;
}
.copy-btn.copied { border-color: var(--green); color: var(--green); }

@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.typing .bubble::after { content: '⋯'; animation: dots 1.2s infinite; }
@keyframes dots { 0%,20%{content:'⋯'} 40%{content:'⋯⋯'} 60%{content:'⋯⋯⋯'} }

.chat-input {
    display: flex; gap: 8px; padding: 10px 12px;
    background: #F7F8FA; flex-shrink: 0; border-top: 1px solid #E0E0E0;
}
.chat-input input {
    flex: 1; border: 1px solid #DDD; border-radius: 20px;
    padding: 10px 16px; font-size: 15px; outline: none; background: white;
}
.chat-input input:focus { border-color: var(--green); }
.chat-input button {
    background: var(--green); color: white; border: none; border-radius: 50%;
    width: 40px; height: 40px; font-size: 18px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.chat-input button:active { transform: scale(0.92); }

.num-row {
    display: flex; gap: 4px; padding: 6px 12px;
    background: #F7F8FA; border-top: 1px solid #E0E0E0; flex-shrink: 0;
}
.num-btn {
    flex: 1; border: 1px solid #DDD; border-radius: 8px;
    background: white; font-size: 16px; font-weight: 500; color: #333;
    padding: 8px 0; cursor: pointer; text-align: center;
}
.num-btn:active { background: var(--green); color: white; }
