/* MADD chat assistant */
.madd-chat { --c-navy: #273444; --c-gold: #F4B940; --c-gold-d: #D9981C; --c-line: #E4E9F0; --c-muted: #5B6878; position: fixed; right: 20px; bottom: 20px; z-index: 9990; font-size: 14.5px; }
.madd-chat-fab { display: inline-flex; align-items: center; gap: 10px; height: 54px; margin: 0; padding: 0 20px 0 8px !important; border: 0 !important; border-radius: 40px !important; background: var(--c-navy) !important; color: #fff !important; box-shadow: 0 16px 34px -12px rgba(39,52,68,.65) !important; font: inherit; font-size: 15px !important; font-weight: 800 !important; letter-spacing: 0 !important; text-transform: none !important; cursor: pointer; transition: transform .2s; }
.madd-chat-fab:hover { transform: translateY(-2px); }
.madd-chat-fab-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--c-gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23273444' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 11.5a8.4 8.4 0 0 1-9 8.4 9 9 0 0 1-3.8-.9L3 21l1.9-5.2A8.4 8.4 0 1 1 21 11.5z'/%3E%3Cpath d='M8.5 11.5h.01M12 11.5h.01M15.5 11.5h.01' stroke-width='3'/%3E%3C/svg%3E") center / 22px no-repeat; }
.madd-chat.is-open .madd-chat-fab { display: none; }

.madd-chat-panel { position: absolute; right: 0; bottom: 0; display: flex; flex-direction: column; width: 380px; height: min(620px, calc(100vh - 40px)); overflow: hidden; background: #fff; border-radius: 22px; box-shadow: 0 30px 70px -20px rgba(39,52,68,.55), 0 0 0 1px var(--c-line); animation: madd-chat-in .25s ease; }
.madd-chat-panel[hidden] { display: none; }
@keyframes madd-chat-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.madd-chat-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; background: var(--c-navy); color: #fff; }
.madd-chat-head strong { display: block; font-size: 15.5px; }
.madd-chat-head small { display: block; font-size: 12px; color: #AEB7C2; }
.madd-chat-head > div { flex: 1; min-width: 0; }
.madd-chat-avatar { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--c-gold); font-weight: 800; color: var(--c-navy); }
.madd-chat-close, .madd-chat-reset { flex: none; width: 34px; height: 34px; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 50% !important; background: rgba(255,255,255,.1) center / 16px no-repeat !important; box-shadow: none !important; cursor: pointer; }
.madd-chat-close { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E") !important; }
.madd-chat-reset { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 3-6.7L3 8'/%3E%3Cpath d='M3 3v5h5'/%3E%3C/svg%3E") !important; }
.madd-chat-close:hover, .madd-chat-reset:hover { background-color: rgba(255,255,255,.22) !important; }

.madd-chat-log { flex: 1; overflow-y: auto; padding: 16px 14px 8px; background: #F5F7FA; overscroll-behavior: contain; }
.madd-chat-msg { max-width: 88%; margin: 0 0 10px; padding: 10px 14px; border-radius: 16px; line-height: 1.6; color: var(--c-navy); word-wrap: break-word; }
.madd-chat-msg p { margin: 0 0 6px; }
.madd-chat-msg p:last-child { margin-bottom: 0; }
.madd-chat-msg ul { margin: 4px 0 6px; padding-left: 18px; }
.madd-chat-msg li { margin: 0 0 2px; }
.madd-chat-msg a { font-weight: 700; color: var(--c-gold-d); }
.madd-chat-msg.is-assistant { background: #fff; border: 1px solid var(--c-line); border-bottom-left-radius: 4px; }
.madd-chat-msg.is-user { margin-left: auto; background: var(--c-navy); color: #fff; border-bottom-right-radius: 4px; }
.madd-chat-msg.is-typing { display: inline-flex; gap: 5px; padding: 14px 16px; }
.madd-chat-msg.is-typing span { width: 7px; height: 7px; border-radius: 50%; background: #B9C2CD; animation: madd-chat-dot 1s infinite; }
.madd-chat-msg.is-typing span:nth-child(2) { animation-delay: .15s; }
.madd-chat-msg.is-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes madd-chat-dot { 0%, 80%, 100% { opacity: .3; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }

.madd-chat-card { margin: 10px 0 4px; padding: 10px 12px; border-radius: 12px; background: #F8FAFC; border: 1px solid var(--c-line); }
.madd-chat-card-head { margin-bottom: 6px; font-size: 12.5px; color: var(--c-muted); }
.madd-chat-card-head strong { color: var(--c-navy); }
.madd-chat-opt { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px dashed var(--c-line); }
.madd-chat-opt:first-of-type { border-top: 0; }
.madd-chat-carrier { flex: none; min-width: 40px; padding: 3px 6px; border-radius: 6px; background: #351C15; text-align: center; font-size: 11px; font-weight: 800; color: #FFB500; }
.madd-chat-carrier.is-dhl { background: #FFCC00; color: #D40511; }
.madd-chat-svc { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.35; }
.madd-chat-svc small, .madd-chat-event small { display: block; font-size: 11.5px; color: var(--c-muted); }
.madd-chat-price { flex: none; font-weight: 800; font-size: 15px; }
.madd-chat-price small { font-size: 11px; font-weight: 600; color: var(--c-muted); }
.madd-chat-opt.is-best .madd-chat-price { color: #0F7A3A; }
.madd-chat-status { margin: 0 0 4px !important; font-weight: 800; }
.madd-chat-event { margin: 0 0 4px !important; font-size: 13px; }
.madd-chat-card-link { display: inline-block; margin-top: 6px; font-size: 12.5px; }
.madd-chat-card-empty { margin: 0 !important; font-size: 13px; color: var(--c-muted); }

.madd-chat-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px 4px; background: #F5F7FA; }
.madd-chat-chips[hidden] { display: none; }
.madd-chat-chips button { margin: 0 !important; padding: 7px 12px !important; border: 1px solid var(--c-line) !important; border-radius: 30px !important; background: #fff !important; box-shadow: none !important; color: var(--c-navy) !important; font: inherit; font-size: 12.5px !important; font-weight: 600 !important; text-transform: none !important; letter-spacing: 0 !important; line-height: 1.3 !important; cursor: pointer; }
.madd-chat-chips button:hover { border-color: var(--c-gold) !important; background: #FFF7E5 !important; }

.madd-chat-form { display: flex; align-items: flex-end; gap: 8px; margin: 0; padding: 10px 12px; border-top: 1px solid var(--c-line); background: #fff; }
.madd-chat-form textarea { flex: 1; min-height: 42px; max-height: 120px; margin: 0; padding: 10px 14px !important; resize: none; border: 1.5px solid #D9E0E8 !important; border-radius: 21px !important; background: #fff; font: inherit; font-size: 16px; line-height: 1.4; color: var(--c-navy); box-shadow: none !important; }
.madd-chat-form textarea:focus { outline: 0; border-color: var(--c-gold) !important; }
.madd-chat-form button { flex: none; width: 42px; height: 42px; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 50% !important; background: var(--c-gold) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23273444' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 2 11 13M22 2l-7 20-4-9-9-4z'/%3E%3C/svg%3E") center / 18px no-repeat !important; box-shadow: none !important; cursor: pointer; }
.madd-chat-form button:disabled { opacity: .5; cursor: wait; }
.madd-chat-foot { margin: 0; padding: 0 14px 10px; background: #fff; font-size: 11px; text-align: center; color: var(--c-muted); }
.madd-chat-foot a { font-weight: 700; color: #06A84B; }

@media (max-width: 600px) {
  .madd-chat { right: 14px; bottom: 14px; }
  .madd-chat-fab { height: 50px; padding: 0 8px !important; }
  .madd-chat-fab-text { display: none; }
  .madd-chat-fab-icon { width: 34px; height: 34px; }
  .madd-chat.is-open { inset: 0; right: 0; bottom: 0; }
  .madd-chat-panel { position: fixed; inset: 0; width: auto; height: 100%; height: 100dvh; border-radius: 0; animation: none; }
  html.madd-chat-lock, html.madd-chat-lock body { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .madd-chat-panel { animation: none; } .madd-chat-msg.is-typing span { animation: none; } }
.madd-chat-carrier.is-sagawa { background: #0B4EA2; color: #fff; font-size: 9.5px; }