.inbox-body .app-main { padding: 0; overflow: hidden; }
.inbox-shell { height: calc(100vh - 57px); display: flex; background: #fff; position: relative; }
.inbox-list { width: 360px; min-width: 280px; border-right: 1px solid #e9edef; display: flex; flex-direction: column; background: #fff; }
.inbox-list-head { padding: 12px 14px; background: #f0f2f5; border-bottom: 1px solid #e9edef; }
.inbox-contacts { overflow-y: auto; flex: 1; }
.chat-row { display: flex; gap: 10px; width: 100%; text-align: left; border: 0; border-bottom: 1px solid #f0f2f5; background: #fff; padding: 10px 12px; align-items: center; }
.chat-row.active { background: #f0f2f5; }
.chat-avatar { width: 42px; height: 42px; border-radius: 50%; background: #dfe5e7; display: grid; place-items: center; font-weight: 600; flex: none; }
.chat-main { min-width: 0; flex: 1; }
.chat-top, .chat-bottom { display: flex; justify-content: space-between; gap: 8px; }
.chat-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-preview { color: #667781; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-time { color: #667781; font-size: 12px; flex: none; }
.unread-pill { background: #25d366; color: #fff; border-radius: 999px; min-width: 20px; text-align: center; font-size: 12px; padding: 0 6px; }
.inbox-thread { flex: 1; display: flex; flex-direction: column; min-width: 0; background: #efeae2; position: relative; }
.inbox-thread-head { min-height: 60px; background: #f0f2f5; border-bottom: 1px solid #e9edef; display: flex; align-items: center; gap: 10px; padding: 8px 14px; }
.inbox-messages { flex: 1; overflow-y: auto; padding: 16px 8%; }
.day-chip { text-align: center; margin: 10px 0; }
.day-chip span { background: #fff; border-radius: 8px; padding: 4px 10px; font-size: 12px; color: #54656f; box-shadow: 0 1px 1px rgba(0,0,0,.08); }
.bubble-row { display: flex; margin-bottom: 6px; }
.bubble-row.out { justify-content: flex-end; }
.bubble { max-width: min(480px, 80%); border-radius: 8px; padding: 6px 8px 4px; box-shadow: 0 1px 1px rgba(0,0,0,.08); position: relative; }
.bubble-row.in .bubble { background: #fff; }
.bubble-row.out .bubble { background: #d9fdd3; }
.bubble-text { white-space: pre-wrap; word-break: break-word; padding-right: 52px; }
.bubble-meta { display: flex; justify-content: flex-end; gap: 4px; align-items: center; color: #667781; font-size: 11px; margin-top: -4px; }
.bubble-meta.read { color: #53bdeb; }
.bubble-image, .bubble video { max-width: 280px; border-radius: 6px; display: block; cursor: pointer; }
.bubble audio { width: 240px; }
.doc-link { display: flex; gap: 8px; align-items: center; text-decoration: none; color: inherit; padding-right: 48px; }
.map-preview { width: 260px; height: 140px; object-fit: cover; border-radius: 6px; background: #d7e3dc; display: block; }
.map-fallback { width: 260px; height: 100px; border-radius: 6px; background: #d7e3dc; display: grid; place-items: center; color: #3b4a54; }
.bubble-reply { border-left: 3px solid #25d366; background: rgba(0,0,0,.04); padding: 4px 8px; margin-bottom: 4px; font-size: 13px; color: #54656f; }
.bubble-error { color: #c0392b; font-size: 12px; }
.agent-name { font-size: 11px; color: #1fa855; }
.inbox-composer { background: #f0f2f5; padding: 8px 12px; border-top: 1px solid #e9edef; }
.composer-bar { display: flex; gap: 8px; align-items: flex-end; }
.composer-bar textarea { resize: none; max-height: 120px; }
.attach-menu { position: absolute; bottom: 62px; left: 12px; background: #fff; border-radius: 8px; box-shadow: 0 2px 12px rgba(0,0,0,.15); padding: 6px; display: flex; flex-direction: column; min-width: 180px; z-index: 5; }
.attach-menu button { text-align: left; border: 0; background: transparent; padding: 8px 10px; border-radius: 6px; }
.attach-menu button:hover { background: #f0f2f5; }
.inbox-empty { margin: auto; text-align: center; color: #54656f; max-width: 360px; padding: 24px; }
.inbox-jump { position: absolute; bottom: 76px; left: 50%; transform: translateX(-50%); border: 0; background: #fff; border-radius: 999px; padding: 6px 12px; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.inbox-dialog { border: 0; border-radius: 12px; padding: 16px; width: min(520px, 94vw); }
.inbox-dialog::backdrop { background: rgba(0,0,0,.45); }
#viewer-image { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; }
#map-canvas, #send-map-canvas { height: 280px; border-radius: 8px; }
#attach-preview img, #attach-preview video { max-width: 100%; max-height: 240px; }
.window-banner { background: #fff3cd; color: #664d03; border-radius: 8px; padding: 8px 10px; font-size: 14px; }
@media (max-width: 768px) {
    .inbox-list { width: 100%; }
    .inbox-shell.has-thread .inbox-list { display: none; }
    .inbox-shell:not(.has-thread) .inbox-thread { display: none; }
    .inbox-messages { padding: 12px; }
}
