/* 로드플래너 AI 비서 (로디) — 아래 메뉴 '로드톡'과 '긴급' 사이 */
.rpai {
  position: fixed; left: 50%; transform: translateX(-50%);
  top: var(--header-h); bottom: calc(var(--bottom-nav-h, 64px) + var(--nav-safe));
  width: 100%; max-width: var(--app-w);
  display: flex; flex-direction: column; background: #f8fafc; z-index: 40;
  color: #14161A;
}
body.ai-typing .rpai { bottom: 0; }
body.ai-typing #bottom-nav { display: none !important; }

.rpai-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; background: #fff; border-bottom: 1px solid #e2e8f0; }
.rpai-head-l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rpai-ava { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, #3B45C4, #0ea5e9); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 20px; flex: 0 0 auto; }
.rpai-title { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.rpai-badge { font-size: 12px; font-weight: 800; color: #3B45C4; background: #EEF0FD; border-radius: 6px; padding: 2px 6px; }
.rpai-sub { font-size: 13px; color: #5B616E; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rpai-iconbtn { width: 44px; height: 44px; border: 0; border-radius: 12px; background: #f1f5f9; color: #475569; display: flex; align-items: center; justify-content: center; cursor: pointer; flex: 0 0 auto; }

.rpai-body { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 12px 8px; display: flex; flex-direction: column; gap: 12px; overscroll-behavior: contain; }
.rpai-row { display: flex; gap: 8px; align-items: flex-start; max-width: 100%; }
.rpai-row.user { justify-content: flex-end; }
.rpai-row .rpai-mini { width: 32px; height: 32px; border-radius: 10px; background: #3B45C4; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; flex: 0 0 auto; }
.rpai-col { display: flex; flex-direction: column; min-width: 0; max-width: calc(100% - 40px); }
.rpai-row.user .rpai-col { align-items: flex-end; max-width: 85%; }
.rpai-bubble { background: #fff; border: 1px solid #e2e8f0; border-radius: 4px 16px 16px 16px; padding: 10px 12px; font-size: 15px; line-height: 1.55; word-break: keep-all; overflow-wrap: anywhere; }
.rpai-row.user .rpai-bubble { background: #3B45C4; color: #fff; border-color: #3B45C4; border-radius: 16px 4px 16px 16px; }
.rpai-time { font-size: 12px; color: #94a3b8; margin-top: 4px; }
.rpai-photo { max-width: 200px; max-height: 240px; border-radius: 12px; border: 1px solid #e2e8f0; margin-bottom: 4px; object-fit: cover; }
.rpai-photo-note { font-size: 13px; color: #5B616E; margin-bottom: 4px; }

.rpai-chips-label { font-size: 13px; color: #5B616E; font-weight: 700; margin: 10px 0 6px; }
.rpai-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rpai-chip { min-height: 44px; padding: 8px 12px; border-radius: 12px; border: 1px solid #D5D9F7; background: #EEF0FD; color: #2B338F; font-size: 14px; font-weight: 700; cursor: pointer; text-align: left; }

.rpai-typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.rpai-typing span { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; animation: rpaiDot 1.2s infinite ease-in-out; }
.rpai-typing span:nth-child(2) { animation-delay: .15s; }
.rpai-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes rpaiDot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* 확인 카드 · 장소 카드 */
.rpai-card { margin-top: 10px; border: 1px solid #D5D9F7; background: #f8faff; border-radius: 12px; padding: 12px; color: #14161A; }
.rpai-card-title { font-size: 15px; font-weight: 800; color: #2B338F; margin-bottom: 8px; }
.rpai-kv { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 8px; font-size: 14px; }
.rpai-kv span { color: #5B616E; }
.rpai-kv b { font-weight: 700; overflow-wrap: anywhere; }
.rpai-note { font-size: 13px; color: #5B616E; margin: 8px 0 0; }
.rpai-btns { display: flex; gap: 6px; margin-top: 10px; }
.rpai-btn { flex: 1; min-height: 44px; border-radius: 10px; border: 0; background: #3B45C4; color: #fff; font-size: 15px; font-weight: 800; cursor: pointer; }
.rpai-btn.ghost { flex: 0 0 auto; padding: 0 14px; background: #fff; color: #475569; border: 1px solid #cbd5e1; }
.rpai-btn.done { background: #e2e8f0; color: #5B616E; cursor: default; }
.rpai-place { margin-top: 8px; border: 1px solid #e2e8f0; background: #fff; border-radius: 12px; padding: 10px 12px; }
.rpai-place-head { display: flex; justify-content: space-between; gap: 8px; font-size: 15px; }
.rpai-place-head small { color: #0ea5e9; font-weight: 700; white-space: nowrap; }
.rpai-place-meta { font-size: 13px; color: #5B616E; margin-top: 2px; overflow-wrap: anywhere; }
.rpai-place .rpai-btns button { min-height: 40px; font-size: 14px; flex: 1; border-radius: 9px; border: 1px solid #cbd5e1; background: #fff; color: #334155; font-weight: 700; cursor: pointer; }
.rpai-report { border: 0; background: none; color: #94a3b8; font-size: 12px; text-decoration: underline; cursor: pointer; padding: 0 2px; }

/* 입력 */
.rpai-inputwrap { background: #fff; border-top: 1px solid #e2e8f0; padding: 8px 10px; padding-bottom: calc(8px + (var(--rpai-safe, 0px))); }
body.ai-typing .rpai-inputwrap { --rpai-safe: env(safe-area-inset-bottom); }
.rpai-listening { display: none; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; color: #3B45C4; font-weight: 700; padding: 4px 4px 8px; }
.rpai-listening.on { display: flex; }
.rpai-listening button { border: 0; background: none; color: #5B616E; text-decoration: underline; font-size: 14px; min-height: 36px; }
.rpai-bar { display: flex; align-items: center; gap: 6px; }
.rpai-bar .rpai-iconbtn.on { background: #fee2e2; color: #dc2626; }
.rpai-input { flex: 1 1 auto; min-width: 0; height: 44px; border: 1px solid #cbd5e1; border-radius: 22px; padding: 0 14px; font-size: 16px; background: #f8fafc; color: #14161A; }
.rpai-input:focus { outline: 2px solid #D5D9F7; background: #fff; }
.rpai-send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: #3B45C4; color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; flex: 0 0 auto; }
.rpai-send:disabled { opacity: .5; }
.rpai-lock { text-align: center; padding: 12px 8px; display: flex; flex-direction: column; gap: 6px; align-items: center; font-size: 14px; color: #475569; }
.rpai-lock b { font-size: 15px; color: #14161A; }
.rpai-lock button { min-height: 44px; padding: 0 18px; border-radius: 10px; border: 0; background: #3B45C4; color: #fff; font-weight: 800; font-size: 15px; }
.rpai-left { font-size: 12px; color: #94a3b8; text-align: right; padding: 4px 6px 0; }

/* 아래 메뉴의 AI 버튼 */
.bnav-ai .bnav-ai-ico { width: 30px; height: 30px; border-radius: 10px; background: linear-gradient(135deg, #3B45C4, #0ea5e9); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 900; letter-spacing: -0.5px; }
.bnav-ai.active .bnav-ai-ico { box-shadow: 0 0 0 3px #D5D9F7; }

.rpai-chips.off .rpai-chip, .rpai-chip:disabled { opacity: .5; cursor: default; background: #F1F2F5; border-color: #E2E4EA; color: #5B616E; }
