/* Mount Rangers AI Trip Planner */
.mrtp, .mrtp * { box-sizing: border-box; }
.mrtp {
	--mrtp-accent: #F04E10; --mrtp-btn: #C2410C; --mrtp-ink: #1E1514; --mrtp-muted: #6b625f;
	--mrtp-bg: #fff; --mrtp-soft: #FFF4EE; --mrtp-line: #EDE6E3; --mrtp-bot: #F6F3F1;
	font-family: inherit; font-size: 15px; line-height: 1.5; color: var(--mrtp-ink);
	display: flex; flex-direction: column; background: var(--mrtp-bg); overflow: hidden;
}

.mrtp[hidden], .mrtp-lead [hidden] { display: none !important; }

/* floating launcher (bottom-left; WhatsApp is bottom-right) */
.mrtp-launch {
	position: fixed; left: 20px; bottom: 20px; z-index: 9998; display: flex; align-items: center; gap: 10px;
	border: 0; cursor: pointer; border-radius: 999px; padding: 12px 20px 12px 14px; color: #fff; font: inherit; font-weight: 700;
	background: linear-gradient(135deg, #F04E10, #C2410C); box-shadow: 0 10px 25px rgba(194,65,12,.35); transition: transform .2s;
}
.mrtp-launch:hover { transform: translateY(-3px); }
.mrtp-launch:focus-visible { outline: 3px solid #1E1514; outline-offset: 3px; }
.mrtp-launch__spark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.2); font-size: 15px; animation: mrtp-pulse 2.4s infinite; }
.mrtp-launch small { font-size: 11px; background: #fff; color: #C2410C; border-radius: 6px; padding: 1px 5px; margin-left: 4px; vertical-align: 2px; }
@keyframes mrtp-pulse { 0%,100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.18); opacity: .8; } }
body.mrtp-open .mrtp-launch { display: none; }

/* popup */
.mrtp--popup {
	position: fixed; left: 20px; bottom: 20px; z-index: 99999; width: 420px; height: min(680px, calc(100vh - 40px));
	border-radius: 18px; box-shadow: 0 25px 60px rgba(0,0,0,.3); animation: mrtp-in .25s ease-out;
}
@keyframes mrtp-in { from { opacity: 0; transform: translateY(20px) scale(.98); } }
.mrtp-inline .mrtp { height: min(760px, 85vh); border: 1px solid var(--mrtp-line); border-radius: 18px; box-shadow: 0 10px 40px rgba(0,0,0,.08); }

/* header */
.mrtp__head { display: flex; align-items: center; gap: 10px; padding: 14px 14px 14px 16px; background: var(--mrtp-ink); color: #fff; }
/* cartoon traveller in the header (SVG in planner.js): idle = namaste → points at the title (3 s loop),
   listen = visitor is typing, think = waiting for the AI reply */
.mrtp__avatar { width: 50px; height: 50px; flex: none; display: block; margin: -6px 0 -6px -4px; }
.mrtp-boy { width: 100%; height: 100%; display: block; overflow: visible; }
.mrtp-boy .pose { opacity: 0; }
.mrtp-boy .b-head { transform-box: view-box; transform-origin: 32px 36px; transition: transform .35s ease; }
.mrtp-boy .b-look { transition: transform .35s ease; }
.mrtp-boy .b-eyes { transform-box: fill-box; transform-origin: center; animation: mrtp-blink 3.6s infinite; }
@keyframes mrtp-blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.mrtp[data-mood="idle"] .p-namaste { animation: mrtp-pose-a 3s infinite; }
.mrtp[data-mood="idle"] .p-point { animation: mrtp-pose-b 3s infinite; }
.mrtp[data-mood="idle"] .b-head { animation: mrtp-bow 3s infinite; }
.mrtp[data-mood="idle"] .b-reach { animation: mrtp-reach 3s infinite; }
@keyframes mrtp-pose-a { 0%, 47% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes mrtp-pose-b { 0%, 47% { opacity: 0; } 50%, 100% { opacity: 1; } }
@keyframes mrtp-bow { 0%, 45%, 100% { transform: none; } 12%, 32% { transform: rotate(7deg) translateY(1.5px); } 62%, 85% { transform: rotate(-4deg); } }
@keyframes mrtp-reach { 0%, 55%, 70%, 100% { transform: translateX(0); } 62%, 78% { transform: translateX(2.5px); } }
.mrtp[data-mood="listen"] .p-listen { opacity: 1; }
.mrtp[data-mood="listen"] .b-head { transform: rotate(9deg); }
.mrtp[data-mood="listen"] .b-wave { animation: mrtp-wave 1.2s infinite; }
.mrtp[data-mood="listen"] .b-wave2 { animation-delay: .25s; }
@keyframes mrtp-wave { 0%, 100% { opacity: .2; } 50% { opacity: 1; } }
.mrtp[data-mood="think"] .p-think { opacity: 1; }
.mrtp[data-mood="think"] .b-head { transform: rotate(-6deg); }
.mrtp[data-mood="think"] .b-look { transform: translate(1px, -1.4px); }
.mrtp[data-mood="think"] .b-dot { animation: mrtp-think 1.4s infinite; }
.mrtp[data-mood="think"] .b-dot2 { animation-delay: .2s; } .mrtp[data-mood="think"] .b-dot3 { animation-delay: .4s; }
@keyframes mrtp-think { 0%, 100% { opacity: .15; transform: translateY(1px); } 50% { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
	.mrtp-boy *, .mrtp[data-mood] .b-head { animation: none !important; }
	.mrtp[data-mood="idle"] .p-namaste { opacity: 0; } .mrtp[data-mood="idle"] .p-point { opacity: 1; }
}
.mrtp__title { flex: 1; min-width: 0; }
.mrtp__title b { display: block; font-size: 15px; }
.mrtp__title span { font-size: 12px; opacity: .75; }
.mrtp__hbtn { background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 8px; padding: 6px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.mrtp__hbtn:hover { background: rgba(255,255,255,.22); }
.mrtp__hbtn--x { font-size: 18px; line-height: 1; padding: 4px 10px; }

/* messages */
.mrtp__log { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; background: #fff; }
.mrtp__log > * { flex-shrink: 0; }
.mrtp__msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; word-wrap: break-word; }
.mrtp__msg--bot { background: var(--mrtp-bot); border-bottom-left-radius: 4px; align-self: flex-start; }
.mrtp__msg--me { background: var(--mrtp-btn); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
.mrtp__msg--err { background: #FDECEC; color: #8a1f1f; align-self: flex-start; }
.mrtp__msg p { margin: 0 0 6px; } .mrtp__msg p:last-child { margin: 0; }
.mrtp__msg ul { margin: 4px 0 6px 18px; padding: 0; }
.mrtp__msg a { color: var(--mrtp-btn); font-weight: 600; }
.mrtp__msg--me a { color: #fff; }
.mrtp__typing { display: inline-flex; gap: 4px; align-items: center; }
.mrtp__typing i { width: 7px; height: 7px; border-radius: 50%; background: #b9aca7; animation: mrtp-dot 1.2s infinite; }
.mrtp__typing i:nth-child(2) { animation-delay: .15s; } .mrtp__typing i:nth-child(3) { animation-delay: .3s; }
.mrtp__typing small { margin-left: 8px; color: var(--mrtp-muted); font-size: 12px; }
@keyframes mrtp-dot { 0%,80%,100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.mrtp__search { align-self: flex-start; max-width: 100%; overflow-x: auto; }
.mrtp__chips { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-start; max-width: 100%; }
.mrtp__chip { border: 1.5px solid var(--mrtp-btn); color: var(--mrtp-btn); background: #fff; border-radius: 999px; padding: 6px 13px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.mrtp__chip:hover, .mrtp__chip:focus-visible { background: var(--mrtp-soft); }

/* composer */
.mrtp__form { display: flex; gap: 8px; padding: 10px 12px 12px; border-top: 1px solid var(--mrtp-line); background: #fff; }
.mrtp .mrtp__input { flex: 1; resize: none; height: 44px; line-height: 1.4; box-shadow: none; border: 1.5px solid var(--mrtp-line); border-radius: 12px; padding: 10px 12px; font: inherit; max-height: 110px; min-height: 44px; color: var(--mrtp-ink); background: #fff; }
.mrtp__input:focus { outline: none; border-color: var(--mrtp-btn); }
.mrtp__send { border: 0; border-radius: 12px; width: 46px; background: var(--mrtp-btn); color: #fff; font-size: 18px; cursor: pointer; flex: none; }
.mrtp__send:disabled { opacity: .5; cursor: default; }
.mrtp__foot { font-size: 11px; color: var(--mrtp-muted); text-align: center; padding: 0 12px 8px; background: #fff; }

/* itinerary card */
.mrtp-itin { align-self: stretch; border: 1px solid var(--mrtp-line); border-radius: 16px; overflow: hidden; background: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.06); }
.mrtp-itin__top { padding: 14px 16px; background: linear-gradient(135deg, #1E1514, #3a2a26); color: #fff; }
.mrtp-itin__top h3 { margin: 0 0 4px; font-size: 17px; line-height: 1.3; color: #fff; }
.mrtp-itin__meta { font-size: 12px; opacity: .85; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.mrtp-itin__body { padding: 12px 16px 16px; font-size: 14px; }
.mrtp-itin__body h4 { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--mrtp-btn); }
.mrtp-itin__pkg { background: var(--mrtp-soft); border: 1px solid #FBD5C2; border-radius: 12px; padding: 10px 12px; margin: 8px 0; }
.mrtp-itin__pkg a { display: inline-block; margin-top: 6px; background: var(--mrtp-btn); color: #fff !important; text-decoration: none; border-radius: 8px; padding: 6px 12px; font-weight: 700; font-size: 13px; }
.mrtp-day { border-left: 3px solid var(--mrtp-accent); padding: 2px 0 2px 12px; margin: 10px 0; }
.mrtp-day b { display: block; }
.mrtp-day__plan { white-space: pre-line; color: #3d3533; }
.mrtp-day__sub { font-size: 12px; color: var(--mrtp-muted); }
.mrtp-itin ul { margin: 0 0 0 18px; padding: 0; }
.mrtp-itin li { margin: 3px 0; }
.mrtp-cost { background: #F3FAF5; border: 1px solid #CDEBD7; border-radius: 12px; padding: 10px 12px; }
.mrtp-cost b { font-size: 16px; }
.mrtp-locked { position: relative; }
.mrtp-locked__days { filter: blur(0); }
.mrtp-locked__fade { height: 60px; margin-top: -60px; position: relative; background: linear-gradient(transparent, #fff); }
.mrtp-lead { background: var(--mrtp-soft); border-top: 1px solid #FBD5C2; padding: 14px 16px; }
.mrtp-lead p { margin: 0 0 8px; font-weight: 700; }
.mrtp-lead input { width: 100%; border: 1.5px solid #F2C9B5; border-radius: 10px; padding: 9px 12px; font: inherit; margin-bottom: 8px; background: #fff; color: var(--mrtp-ink); }
.mrtp-lead input:focus { outline: none; border-color: var(--mrtp-btn); }
.mrtp-lead small { display: block; color: var(--mrtp-muted); font-size: 11px; margin-top: 6px; }
.mrtp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; border-radius: 10px; padding: 10px 14px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none !important; background: var(--mrtp-btn); color: #fff !important; }
.mrtp-btn--full { width: 100%; }
.mrtp-btn--wa { background: #1F8F4E; }
.mrtp-btn--ghost { background: #fff; color: var(--mrtp-ink) !important; border: 1.5px solid var(--mrtp-line); }
.mrtp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0 16px 16px; }
.mrtp-actions .mrtp-btn:first-child { grid-column: 1 / -1; }
.mrtp-err { color: #b32d2e; font-size: 13px; margin: 0 0 8px; }

@media (max-width: 600px) {
	.mrtp--popup { left: 0; right: 0; bottom: 0; top: 0; width: 100%; height: 100%; height: 100dvh; border-radius: 0; }
	.mrtp-launch { left: 14px; bottom: 16px; padding: 12px 16px 12px 12px; }
	.mrtp-inline .mrtp { height: 80vh; border-radius: 14px; }
	.mrtp__msg { max-width: 92%; }
	.single-trip .mrtp-launch { bottom: 170px; } /* clear the sticky "Check Availability" bar */
	.mrtp__title span { display: none; }
	.mrtp__title b { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
	.mrtp-launch, .mrtp-launch__spark, .mrtp--popup, .mrtp__typing i { animation: none; transition: none; }
}
@media print {
	body.mrtp-print > *:not(.mrtp-printarea) { display: none !important; }
}

/* leave-chat question + welcome-back note */
.mrtp-leave { position: absolute; inset: 0; z-index: 5; background: rgba(30,21,20,.55); display: flex; align-items: center; justify-content: center; padding: 16px; animation: mrtp-in .2s ease-out; }
.mrtp { position: relative; }
.mrtp--popup { position: fixed; }
.mrtp-leave__card { width: 100%; max-width: 340px; background: #fff; border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.mrtp-leave__t { margin: 0; font-weight: 800; font-size: 18px; color: var(--mrtp-ink); }
.mrtp-leave__s { margin: 0 0 4px; font-size: 13px; color: var(--mrtp-muted); line-height: 1.45; }
.mrtp-leave input { width: 100%; border: 1.5px solid #F2C9B5; border-radius: 10px; padding: 9px 12px; font: inherit; background: #fff; color: var(--mrtp-ink); }
.mrtp-leave input:focus { outline: none; border-color: var(--mrtp-btn); }
.mrtp-leave__keep { border: 0; background: none; color: var(--mrtp-btn); font: inherit; font-weight: 700; padding: 6px; cursor: pointer; }
.mrtp-resume { align-self: stretch; background: var(--mrtp-soft); border: 1px solid #FBD5C2; border-radius: 12px; padding: 8px 12px; font-size: 13px; color: var(--mrtp-ink); }
.mrtp-resume button { border: 0; background: none; color: var(--mrtp-btn); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 0; margin-left: 4px; }
.mrtp-leave__or { display: flex; align-items: center; gap: 8px; margin: 6px 0 2px; font-size: 12px; color: var(--mrtp-muted); }
.mrtp-leave__or::before, .mrtp-leave__or::after { content: ''; flex: 1; height: 1px; background: var(--mrtp-line); }
.mrtp-leave [data-exit] { color: var(--mrtp-muted); font-weight: 600; text-decoration: underline; }

/* Big traveller: half inside the header, half popping out above the planner box (desktop / tablet) */
.mrtp { overflow: visible; }
.mrtp > .mrtp__head { position: relative; border-top-left-radius: inherit; border-top-right-radius: inherit; padding-left: 138px; min-height: 70px; }
.mrtp > :last-child, .mrtp-leave { border-bottom-left-radius: inherit; border-bottom-right-radius: inherit; }
.mrtp-leave { border-radius: inherit; }
.mrtp__avatar { position: absolute; left: 4px; bottom: 0; width: 136px; height: 136px; margin: 0; z-index: 2; filter: drop-shadow(0 6px 10px rgba(0,0,0,.25)); }
.mrtp--popup { height: min(680px, calc(100vh - 110px)); width: 440px; }
.mrtp--popup > .mrtp__head { padding-left: 116px; }
.mrtp--popup .mrtp__avatar { left: -8px; }
.mrtp__title b { white-space: nowrap; }
.mrtp-inline { padding-top: 66px; }
@media (max-width: 600px) {
	/* full-screen chat on phones: no room above, so the traveller sits inside the header */
	.mrtp--popup > .mrtp__head { padding-left: 74px; }
	.mrtp--popup .mrtp__avatar { left: 6px; bottom: 4px; width: 64px; height: 64px; }
	.mrtp--popup { height: 100%; height: 100dvh; }
	.mrtp-inline { padding-top: 40px; }
	.mrtp-inline .mrtp__avatar { width: 92px; height: 92px; }
	.mrtp-inline .mrtp > .mrtp__head { padding-left: 100px; }
}
