/* Trợ lý du lịch AI – widget nổi (desktop) / bottom sheet (di động) */
.aic { --aic-teal: #00695f; --aic-ink: #0c1930; --aic-muted: #64748b; --aic-line: #e2e8f0; font-family: "Be Vietnam Pro", sans-serif; }
.aic[hidden] { display: none; }
.aic-fab {
  position: fixed; right: 20px; bottom: 20px; z-index: 900;
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px 12px 14px;
  border: 0; border-radius: 999px; background: var(--aic-teal); color: #fff; font: 600 14px/1 "Be Vietnam Pro", sans-serif;
  box-shadow: 0 8px 24px #00695f55; cursor: pointer;
}
.aic-fab .icon { width: 22px; height: 22px; filter: brightness(0) invert(1); }
.aic-fab:hover, .aic-fab:focus-visible { background: #004c46; outline: 3px solid #b5eee4; }
.aic.open .aic-fab { display: none; }
.aic-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 950;
  width: min(410px, calc(100vw - 32px)); height: min(640px, calc(100vh - 110px));
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid #d6e4e1; border-radius: 18px; box-shadow: 0 18px 50px #0a2a2540;
}
.aic-panel[hidden] { display: none; }
.aic-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; background: #0f766e; color: #fff; }
.aic-avatar { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #ffffff26; }
.aic-avatar .icon { width: 20px; height: 20px; filter: brightness(0) invert(1); }
.aic-title { flex: 1; min-width: 0; }
.aic-title strong { display: block; font-size: 14px; }
.aic-title small { font-size: 11px; opacity: 0.85; }
.aic-icon { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
.aic-icon:hover, .aic-icon:focus-visible { background: #ffffff26; }
.aic-icon .icon { width: 18px; height: 18px; filter: brightness(0) invert(1); }
.aic-log { flex: 1; overflow-y: auto; padding: 14px 12px 6px; background: #f6faf9; scroll-behavior: smooth; }
.aic-msg { margin: 0 0 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.aic-msg.user { align-items: flex-end; }
.aic-bubble { max-width: 88%; padding: 9px 12px; border-radius: 14px; font-size: 13.5px; line-height: 1.55; color: var(--aic-ink); background: #fff; border: 1px solid var(--aic-line); overflow-wrap: anywhere; }
.aic-msg.user .aic-bubble { background: var(--aic-teal); color: #fff; border-color: var(--aic-teal); border-bottom-right-radius: 4px; }
.aic-msg.assistant .aic-bubble { border-bottom-left-radius: 4px; }
.aic-msg.error .aic-bubble { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.aic-msg.typing .aic-bubble { display: flex; gap: 4px; padding: 12px 14px; }
.aic-msg.typing span { width: 7px; height: 7px; border-radius: 50%; background: #94a3b8; animation: aic-dot 1s infinite ease-in-out; }
.aic-msg.typing span:nth-child(2) { animation-delay: 0.15s; }
.aic-msg.typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes aic-dot { 0%, 80%, 100% { opacity: 0.3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .aic-msg.typing span { animation: none; } }
.aic-card { width: 100%; max-width: 100%; box-sizing: border-box; padding: 10px 11px; border-radius: 12px; background: #fff; border: 1px solid var(--aic-line); font-size: 12.5px; color: var(--aic-ink); display: grid; gap: 6px; }
.aic-card .icon { width: 16px; height: 16px; vertical-align: -3px; }
.aic-card small { color: var(--aic-muted); font-size: 11px; line-height: 1.45; }
.aic-src { display: block; font-size: 10.5px !important; }
.aic-notice { grid-template-columns: auto 1fr; align-items: start; background: #fffbeb; border-color: #fde68a; }
.aic-item { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--aic-line); }
.aic-item:last-of-type { border-bottom: 0; }
.aic-item > div { flex: 1; min-width: 0; display: grid; gap: 1px; }
.aic-item strong { font-size: 12.5px; }
.aic-item-act { display: flex; gap: 4px; }
.aic-num { flex: none; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #7c3aed; color: #fff; font-size: 11px; font-weight: 700; }
.aic-mini { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--aic-line); border-radius: 8px; background: #fff; cursor: pointer; }
.aic-mini:hover, .aic-mini:focus-visible { border-color: var(--aic-teal); background: #ecfdf5; }
.aic-link { display: inline-flex; align-items: center; gap: 6px; justify-self: start; padding: 6px 10px; border: 1px solid #b7dcd5; border-radius: 8px; background: #f0fdfa; color: var(--aic-teal); font: 600 12px "Be Vietnam Pro", sans-serif; cursor: pointer; text-decoration: none; }
.aic-link:hover { background: #ccfbf1; }
.aic-wx { display: flex; align-items: center; gap: 10px; }
.aic-wx > .icon { width: 28px; height: 28px; }
.aic-wx div { flex: 1; display: grid; }
.aic-wx span { color: var(--aic-muted); font-size: 12px; }
.aic-wx b { font-size: 16px; }
.aic-bar { height: 6px; border-radius: 3px; background: #e2e8f0; overflow: hidden; }
.aic-bar i { display: block; height: 100%; background: #3b82f6; border-radius: 3px; }
.aic-kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; }
.aic-kv span { color: var(--aic-muted); }
.aic-kv b { text-align: right; }
.aic-warn { display: block; padding: 6px 8px; border-radius: 8px; background: #fff7ed; color: #9a3412 !important; font-size: 11.5px; line-height: 1.5; }
.aic-it-title { font-size: 13.5px; }
.aic-day { border-left: 3px solid #9333ea; padding: 4px 0 4px 10px; display: grid; gap: 4px; }
.aic-day-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: 11.5px; color: var(--aic-muted); }
.aic-day-head b { color: #7e22ce; font-size: 12.5px; }
.aic-day ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.aic-day li { display: grid; grid-template-columns: 42px 1fr; column-gap: 6px; font-size: 12.5px; }
.aic-day li time { font-weight: 700; color: var(--aic-teal); }
.aic-day li a { color: var(--aic-ink); font-weight: 600; text-decoration: none; }
.aic-day li a:hover { text-decoration: underline; }
.aic-day li em { grid-column: 2; font-style: normal; font-size: 10.5px; color: #c2410c; }
.aic-day li small { grid-column: 2; }
.aic-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.aic-btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 11px; border: 1px solid var(--aic-line); border-radius: 9px; background: #fff; color: var(--aic-ink); font: 600 12px "Be Vietnam Pro", sans-serif; cursor: pointer; text-decoration: none; }
.aic-btn:hover { border-color: var(--aic-teal); }
.aic-btn.primary { background: var(--aic-teal); border-color: var(--aic-teal); color: #fff; }
.aic-btn.primary .icon { filter: brightness(0) invert(1); }
.aic-btn:disabled { opacity: 0.6; cursor: wait; }
.aic-field { display: grid; gap: 4px; font-size: 11.5px; color: var(--aic-muted); }
.aic-field input { padding: 7px 9px; border: 1px solid #cbd5e1; border-radius: 8px; font: inherit; color: var(--aic-ink); }
.aic-confirm_save { border-color: #99f6e4; background: #f0fdfa; }
.aic-sources { font-size: 10.5px; color: var(--aic-muted); max-width: 92%; }
.aic-sources a { color: var(--aic-teal); }
.aic-fb { display: flex; gap: 4px; }
.aic-fb button { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid transparent; border-radius: 7px; background: transparent; cursor: pointer; opacity: 0.55; }
.aic-fb button:hover, .aic-fb button.on { opacity: 1; border-color: var(--aic-line); background: #fff; }
.aic-fb .icon { width: 14px; height: 14px; }
.aic-chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px 2px; scrollbar-width: none; }
.aic-chips:empty { display: none; }
.aic-chips button { flex: none; padding: 6px 11px; border: 1px solid #b7dcd5; border-radius: 999px; background: #fff; color: var(--aic-teal); font: 500 12px "Be Vietnam Pro", sans-serif; cursor: pointer; white-space: nowrap; }
.aic-chips button:hover, .aic-chips button:focus-visible { background: #f0fdfa; }
.aic-form { display: flex; align-items: flex-end; gap: 8px; padding: 8px 12px; }
.aic-form textarea { flex: 1; resize: none; max-height: 120px; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 12px; font: 13.5px/1.45 "Be Vietnam Pro", sans-serif; color: var(--aic-ink); }
.aic-form textarea:focus { outline: 2px solid #99f6e4; border-color: var(--aic-teal); }
.aic-send { display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 12px; background: var(--aic-teal); cursor: pointer; }
.aic-send .icon { width: 18px; height: 18px; filter: brightness(0) invert(1); }
.aic-send:disabled { opacity: 0.5; }
.aic-foot { margin: 0; padding: 0 12px 8px; font-size: 10px; color: var(--aic-muted); text-align: center; }
@media (max-width: 760px) {
  .aic-fab { right: 12px; bottom: 12px; padding: 12px; }
  .aic-fab span { display: none; }
  .aic-panel { right: 0; left: 0; bottom: 0; width: 100%; height: 82vh; border-radius: 18px 18px 0 0; }
}
@media print { .aic { display: none; } }
#aic-restore[hidden] { display: none !important; }

/* ===== Thiết kế lại khung chat (11/2026) ===== */
.aic-panel { width: min(420px, calc(100vw - 32px)); height: min(680px, calc(100vh - 100px)); border-radius: 20px; border-color: #d3e6e2; box-shadow: 0 24px 60px #0a2a2547, 0 2px 8px #0a2a2514; }
.aic-head { padding: 14px 12px 14px 16px; background: #0f766e; }
.aic-avatar { width: 38px; height: 38px; background: #ffffff2e; box-shadow: inset 0 0 0 1px #ffffff40; }
.aic-title strong { font-size: 14.5px; letter-spacing: 0.01em; }
.aic-title small { display: flex; align-items: center; gap: 5px; }
.aic-title small::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #5eead4; box-shadow: 0 0 0 3px #5eead433; }
.aic-log { padding: 16px 14px 8px; background: #f5f9f8; }
.aic-bubble { font-size: 13.5px; box-shadow: 0 1px 2px #0f172a0d; }
.aic-msg.assistant .aic-bubble { background: #fff; border-color: #e3ece9; }
.aic-msg.user .aic-bubble { background: #0f766e; border: 0; }
.aic-card { border-radius: 14px; border-color: #e3ece9; box-shadow: 0 1px 3px #0f172a0f; }
/* Gợi ý: xuống dòng, tối đa ~2 hàng, cuộn dọc khi nhiều. */
.aic-chips {
  flex-wrap: wrap; overflow-x: hidden; overflow-y: auto; max-height: 76px; gap: 6px;
  padding: 8px 14px 6px; border-top: 1px solid #e8efed; background: #fff; scrollbar-width: thin;
}
.aic-chips button { max-width: 100%; overflow: hidden; text-overflow: ellipsis; padding: 6px 12px; border-color: #c9e4de; background: #f3fbf9; font-size: 12px; }
.aic-chips button:hover, .aic-chips button:focus-visible { background: #e0f5f0; border-color: #0f766e; outline: none; }
.aic-chips:empty + .aic-form { border-top: 1px solid #e8efed; }
/* Ô nhập: một khối bo tròn, nút gửi nằm trong. */
.aic-form { gap: 0; padding: 8px 12px 6px; background: #fff; }
.aic-form textarea {
  min-height: 44px; padding: 12px 50px 12px 16px; border: 1px solid #cfdfdb; border-radius: 22px; background: #f8fbfa;
  font-size: 13.5px; line-height: 1.4; transition: border-color 0.15s, background 0.15s;
}
.aic-form textarea:focus { outline: none; border-color: #0f766e; background: #fff; box-shadow: 0 0 0 3px #99f6e44d; }
.aic-form { position: relative; }
.aic-send { position: absolute; right: 18px; bottom: 12px; width: 34px; height: 34px; border-radius: 50%; transition: transform 0.1s, opacity 0.15s; }
.aic-send:hover:not(:disabled) { transform: scale(1.06); }
.aic-send .icon { width: 16px; height: 16px; }
.aic-foot { padding: 2px 14px 10px; background: #fff; font-size: 10px; color: #94a3b8; }
.aic-fab { padding: 13px 20px 13px 15px; background: #0f766e; box-shadow: 0 8px 22px #0f766e4d; }
@media (max-width: 760px) {
  .aic-panel { height: 86vh; border-radius: 20px 20px 0 0; }
  .aic-chips { max-height: 70px; }
}

/* ===== Thẻ thời tiết mới + hiệu ứng tương tác ===== */
.aic-weather { background: #f3f9ff; border-color: #d6e8f7; }
.aic-wx2 { display: flex; align-items: center; gap: 10px; }
.aic-wx-emoji { font-size: 38px; line-height: 1; filter: drop-shadow(0 3px 6px #0f172a26); animation: aic-float 3.2s ease-in-out infinite; }
.aic-wx-main { flex: 1; min-width: 0; display: grid; }
.aic-wx-main small { color: var(--aic-muted); font-size: 11px; }
.aic-wx-main b { font-size: 24px; line-height: 1.1; color: #0c1930; }
.aic-wx-main span { font-size: 12px; color: #475569; }
.aic-wx-meta { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 11.5px; color: #334155; white-space: nowrap; }
.aic-rain { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; font-size: 11.5px; color: #334155; }
.aic-rain .aic-bar { height: 6px; }
.aic-days { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.aic-day-wx { display: grid; justify-items: center; gap: 1px; padding: 6px 4px; border-radius: 10px; background: #ffffffcc; border: 1px solid #e3eef7; transition: transform 0.15s, box-shadow 0.15s; }
.aic-day-wx:hover { transform: translateY(-2px); box-shadow: 0 4px 10px #0f172a14; }
.aic-day-wx > span { font-size: 22px; line-height: 1.2; }
.aic-day-wx b { font-size: 13px; }
.aic-day-wx small { font-size: 10.5px; color: var(--aic-muted); }
.aic-day-wx em { font-style: normal; font-size: 10px; color: #2563eb; }
@keyframes aic-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
/* Tin nhắn, thẻ và gợi ý xuất hiện mượt. */
@keyframes aic-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes aic-pop { from { opacity: 0; transform: scale(0.9); } to { opacity: 1; transform: none; } }
.aic-msg { animation: aic-in 0.28s ease-out both; }
.aic-msg .aic-card { animation: aic-in 0.32s ease-out both; animation-delay: 0.08s; }
.aic-msg .aic-card + .aic-card { animation-delay: 0.16s; }
.aic-chips button { animation: aic-pop 0.22s ease-out both; }
.aic-chips button:nth-child(2) { animation-delay: 0.04s; }
.aic-chips button:nth-child(3) { animation-delay: 0.08s; }
.aic-chips button:nth-child(4) { animation-delay: 0.12s; }
.aic-chips button:nth-child(5) { animation-delay: 0.16s; }
.aic-chips button:hover { transform: translateY(-1px); }
.aic-item { transition: background 0.15s; border-radius: 8px; }
.aic-item:hover { background: #f5faf9; }
.aic-bubble strong { color: #0f766e; }
.aic-msg.user .aic-bubble strong { color: #fff; }
.aic-msg.typing .aic-bubble::before { content: "Đang tìm thông tin"; font-size: 12px; color: var(--aic-muted); margin-right: 4px; }
.aic-fab { animation: aic-pop 0.3s ease-out both; }
.aic-fab::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: 0 0 0 0 #14b8a666; animation: aic-ring 2.8s ease-out 1s 3; }
@keyframes aic-ring { 0% { box-shadow: 0 0 0 0 #14b8a666; } 100% { box-shadow: 0 0 0 16px #14b8a600; } }
@media (prefers-reduced-motion: reduce) {
  .aic-msg, .aic-msg .aic-card, .aic-chips button, .aic-fab, .aic-wx-emoji, .aic-fab::after { animation: none !important; }
}

/* ===== Nội dung câu trả lời: cảnh báo đỏ, gợi ý, tô nổi ===== */
.aic-bubble .aic-line { display: block; }
.aic-bubble .aic-line + .aic-line { margin-top: 4px; }
.aic-bubble .aic-alert, .aic-bubble .aic-tip { display: flex; gap: 7px; align-items: flex-start; padding: 7px 10px; border-radius: 10px; font-size: 12.5px; line-height: 1.45; }
.aic-bubble .aic-alert { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; font-weight: 500; animation: aic-shake 0.5s ease-in-out 0.35s 1; }
.aic-bubble .aic-alert .aic-hl { color: #991b1b; background: #fee2e2; }
.aic-bubble .aic-tip { background: #f0fdfa; border: 1px solid #ccfbf1; color: #115e59; }
.aic-bubble .aic-line-ico { flex: none; font-size: 14px; line-height: 1.3; }
.aic-bubble .aic-info { font-size: 11.5px; color: #64748b; }
.aic-bubble .aic-hl { color: #0f766e; background: #ccfbf1; padding: 0 3px; border-radius: 2px; font-weight: 700; }
.aic-msg.user .aic-bubble .aic-hl { color: #fff; background: none; }
@keyframes aic-shake { 0%, 100% { transform: none; } 20% { transform: translateX(-3px); } 40% { transform: translateX(3px); } 60% { transform: translateX(-2px); } 80% { transform: translateX(1px); } }
@media (prefers-reduced-motion: reduce) { .aic-bubble .aic-alert { animation: none; } }
/* Thẻ nguồn của câu hỏi thường gặp */
.aic-faq { background: #fbfaf5; border-color: #ece6cf; gap: 4px; }
.aic-faq-head { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.aic-faq-head b { flex: 1; color: #57534e; }
.aic-badge { font-style: normal; font-size: 10.5px; padding: 1px 7px; border-radius: 999px; }
.aic-badge.ok { background: #dcfce7; color: #166534; }
.aic-badge.warn { background: #fef3c7; color: #92400e; }
.aic-faq-q { font-style: italic; }
.aic-faq-src { font-size: 11px; color: #64748b; line-height: 1.5; }
.aic-faq-src a { color: #0f766e; }
/* Thẻ công cụ dưới câu trả lời và thẻ thống kê */
.aic-toolchips { display: flex; flex-wrap: wrap; gap: 4px; max-width: 92%; }
.aic-toolchips span { padding: 2px 8px; border-radius: 999px; background: #eef6f4; border: 1px solid #d6ebe6; color: #0f5f57; font-size: 10.5px; }
.aic-stats { gap: 5px; }
.aic-stat { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto; align-items: center; gap: 8px; font-size: 12px; }
.aic-stat span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aic-stat i { display: block; height: 6px; border-radius: 3px; background: #14b8a6; }
.aic-stat b { min-width: 28px; text-align: right; }

/* Chỉ dẫn từng đoạn rẽ trong thẻ tuyến đường */
.aic-steps{margin:8px 0 2px;padding:0 0 0 20px;font-size:12.5px;line-height:1.5;color:#334155}
.aic-steps li{margin:2px 0}
.aic-steps small{color:#64748b;margin-left:4px}

/* Dòng danh sách bấm được → zoom tới vị trí trên bản đồ */
.aic-item.aic-clickable { cursor: pointer; padding-left: 4px; padding-right: 4px; }
.aic-item.aic-clickable:hover, .aic-item.aic-clickable:focus-visible { background: #f0fdfa; outline: none; }
