/* ===== SHENGMILO – Milo chat (styles v1.1) ===== */
#milo { --m-c1: #ff6b3d; --m-c2: #b71c3c; --m-red: #e53935; --m-red-d: #c62828; --m-ink: #15151a; --m-text: #33333a; --m-muted: #8a8a94;
	--m-line: #ececf0; --m-soft: #f6f6f9; --m-grad: linear-gradient(135deg, var(--m-c1) 0%, var(--m-red) 45%, var(--m-c2) 100%);
	position: fixed; right: 22px; bottom: 22px; z-index: 99990; font-family: inherit; font-size: 15px; line-height: 1.45; color: var(--m-text);
	-webkit-font-smoothing: antialiased; }
#milo *, #milo *::before, #milo *::after { box-sizing: border-box; }
#milo [hidden] { display: none !important; }
#milo .milo-panel, #milo .milo-head, #milo .milo-body, #milo .milo-form, #milo h2, #milo p { margin: 0; }

/* launcher */
#milo .milo-bubble { position: relative; width: 62px; height: 62px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; margin-left: auto;
	background: var(--m-grad); color: #fff; display: flex; align-items: center; justify-content: center;
	box-shadow: 0 10px 28px rgba(183,28,60,.38), 0 2px 6px rgba(0,0,0,.12); transition: transform .2s cubic-bezier(.3,1.4,.6,1), box-shadow .2s; }
#milo .milo-bubble:hover { transform: scale(1.07); box-shadow: 0 14px 34px rgba(183,28,60,.45); }
#milo .milo-bubble svg { transition: transform .25s, opacity .2s; }
#milo .milo-i-close { position: absolute; opacity: 0; transform: rotate(-90deg); }
#milo[data-state="open"] .milo-i-chat { opacity: 0; transform: rotate(90deg) scale(.6); }
#milo[data-state="open"] .milo-i-close { opacity: 1; transform: none; }
#milo .milo-dot { position: absolute; top: 3px; right: 3px; width: 15px; height: 15px; border-radius: 50%; background: #22c55e; border: 2.5px solid #fff; animation: milo-pulse 2s infinite; }
@keyframes milo-pulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.55); } 70% { box-shadow: 0 0 0 9px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }

/* teaser */
#milo .milo-teaser { position: absolute; right: 0; bottom: 78px; width: 300px; background: #fff; border-radius: 18px 18px 6px 18px; padding: 15px 36px 15px 17px;
	box-shadow: 0 14px 40px rgba(20,20,30,.18); color: var(--m-ink); cursor: pointer; animation: milo-up .3s cubic-bezier(.2,.9,.3,1.2); }
#milo .milo-teaser-x { position: absolute; top: 7px; right: 9px; border: 0; background: none; font-size: 20px; line-height: 1; color: #aaa; cursor: pointer; padding: 4px; }
#milo .milo-teaser-b { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 11px; }

/* panel */
#milo .milo-panel { position: absolute; right: 0; bottom: 80px; width: 380px; height: min(580px, calc(100vh - 140px)); display: flex; flex-direction: column; padding: 0;
	background: var(--m-soft); border-radius: 22px; overflow: hidden; box-shadow: 0 24px 60px rgba(20,20,30,.24), 0 4px 12px rgba(20,20,30,.08);
	transform-origin: bottom right; animation: milo-pop .28s cubic-bezier(.2,.9,.3,1.1); }
@keyframes milo-pop { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes milo-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* header: big hero at start, compact while chatting */
#milo .milo-head { position: relative; flex: none; color: #fff; background: var(--m-grad); padding: 12px 12px 0; overflow: hidden; }
#milo .milo-head::after { content: ""; position: absolute; right: -60px; top: -70px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.22), rgba(255,255,255,0) 70%); pointer-events: none; }
#milo .milo-head-bar { position: relative; z-index: 1; display: flex; align-items: center; gap: 6px; min-height: 36px; }
#milo .milo-mini { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; opacity: 0; transform: translateY(-4px); transition: opacity .25s, transform .25s; pointer-events: none; }
#milo .milo-mini > div > strong { display: block; font-size: 15.5px; line-height: 1.2; }
#milo .milo-mini > div > span { display: block; font-size: 12.5px; opacity: .85; }
#milo .milo-head button { background: rgba(255,255,255,.14); border: 0; color: #fff; cursor: pointer; width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 0; transition: background .15s; flex: none; }
#milo .milo-head button:hover { background: rgba(255,255,255,.26); }
#milo .milo-hero { position: relative; z-index: 1; margin-top: -36px; padding: 0 6px 16px; max-height: 200px; transition: max-height .35s ease, padding .35s ease, opacity .25s; }
#milo .milo-team { display: flex; gap: 12px; margin-bottom: 8px; }
#milo .milo-mem { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 44px; }
#milo .milo-mem b { font-size: 13px; font-weight: 700; line-height: 1.1; }
#milo .milo-mem small { display: none; }
#milo .milo-hero-t { color: #fff; font-size: 21px; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
#milo .milo-hero-s { color: rgba(255,255,255,.9); font-size: 13.5px; margin-top: 3px; max-width: 300px; line-height: 1.4; }
#milo.milo-compact .milo-hero { max-height: 0; margin-top: 0; padding-top: 0; padding-bottom: 12px; opacity: 0; }
#milo.milo-compact .milo-mini { opacity: 1; transform: none; pointer-events: auto; }

/* avatars */
#milo .milo-av { position: relative; width: 46px; height: 46px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
	background: rgba(255,255,255,.22); color: #fff; font-weight: 800; font-size: 19px; border: 2px solid rgba(255,255,255,.7); }
#milo .milo-av img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
#milo .milo-av i { position: absolute; right: -1px; bottom: -1px; width: 13px; height: 13px; border-radius: 50%; border: 2.5px solid #fff; }
#milo .milo-av i.on { background: #22c55e; }
#milo .milo-av i.off { background: #b4b4bd; }
#milo .milo-hero .milo-av { width: 40px; height: 40px; font-size: 17px; }
#milo .milo-av-sm { width: 36px; height: 36px; font-size: 15px; }
#milo .milo-av-sm i { width: 11px; height: 11px; }
#milo .milo-av-msg { width: 30px; height: 30px; font-size: 13px; background: var(--m-grad); border: 0; align-self: flex-end; }
#milo .milo-av-msg i { display: none; }
#milo .milo-cont .milo-av-msg { visibility: hidden; }

/* messages */
#milo .milo-body { flex: 1; overflow-y: auto; padding: 18px 14px 8px; overscroll-behavior: contain; scroll-behavior: smooth; }
#milo .milo-m { display: flex; gap: 8px; margin: 0 0 12px; animation: milo-up .25s ease-out; }
#milo .milo-m.milo-cont { margin-top: -7px; }
#milo .milo-mb { max-width: 84%; padding: 11px 14px; border-radius: 18px; word-wrap: break-word; font-size: 15px; }
#milo .milo-bot .milo-mb { background: #fff; color: var(--m-ink); border-bottom-left-radius: 6px; box-shadow: 0 1px 2px rgba(20,20,30,.06), 0 4px 14px rgba(20,20,30,.04); }
#milo .milo-user { justify-content: flex-end; }
#milo .milo-user .milo-mb { background: var(--m-grad); color: #fff; border-bottom-right-radius: 6px; box-shadow: 0 4px 14px rgba(183,28,60,.22); }
#milo .milo-mb a { color: var(--m-red-d); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
#milo .milo-user .milo-mb a { color: #fff; }
#milo .milo-typing .milo-mb { display: flex; gap: 5px; padding: 15px 16px; }
#milo .milo-typing .milo-mb span { width: 7px; height: 7px; border-radius: 50%; background: #c4c4cc; animation: milo-dots 1.1s infinite; }
#milo .milo-typing .milo-mb span:nth-child(2) { animation-delay: .15s; } #milo .milo-typing .milo-mb span:nth-child(3) { animation-delay: .3s; }
@keyframes milo-dots { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-4px); } }

/* quick replies */
#milo .milo-btns { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: 0 0 14px 38px; }
#milo .milo-b { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--m-line); background: #fff; color: var(--m-ink); border-radius: 14px;
	padding: 10px 15px; font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer; text-decoration: none; text-align: left; line-height: 1.3;
	box-shadow: 0 1px 2px rgba(20,20,30,.05); transition: border-color .15s, transform .15s, box-shadow .15s, background .15s; }
#milo .milo-b:hover { border-color: var(--m-red); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(229,57,53,.14); color: var(--m-ink); }
#milo .milo-b-main { background: var(--m-grad); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(183,28,60,.25); }
#milo .milo-b-main:hover { color: #fff; border-color: transparent; box-shadow: 0 8px 20px rgba(183,28,60,.35); }
#milo .milo-b:disabled { opacity: .55; cursor: default; transform: none; }

/* cards (forms, order) */
#milo .milo-card { background: #fff; border-radius: 18px; padding: 14px; margin: 0 0 14px 38px; display: flex; flex-direction: column; gap: 9px;
	box-shadow: 0 1px 2px rgba(20,20,30,.06), 0 6px 18px rgba(20,20,30,.05); animation: milo-up .25s ease-out; }
#milo .milo-card input, #milo .milo-card textarea { width: 100%; border: 1.5px solid var(--m-line); border-radius: 12px; padding: 11px 13px; font: inherit; font-size: 16px;
	background: var(--m-soft); color: var(--m-ink); margin: 0; transition: border-color .15s, background .15s; }
#milo .milo-card input:focus, #milo .milo-card textarea:focus { outline: none; border-color: var(--m-red); background: #fff; }
#milo .milo-card .milo-b { justify-content: center; padding: 12px 15px; }
#milo .milo-wa-line { text-align: center; font-size: 13px; color: var(--m-muted); }
#milo .milo-wa-line a { color: #128c4a; font-weight: 700; }
#milo .milo-hp { position: absolute !important; left: -9999px !important; height: 1px !important; width: 1px !important; }

#milo .milo-ord { min-width: 230px; }
#milo .milo-ord-h { font-weight: 800; margin-bottom: 8px; font-size: 15.5px; }
#milo .milo-ord-h span { font-weight: 500; color: var(--m-muted); font-size: 13px; margin-left: 6px; }
#milo .milo-ord ul { margin: 0 0 8px; padding-left: 18px; }
#milo .milo-ord-r { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; border-top: 1px solid var(--m-line); padding: 7px 0; }
#milo .milo-ord-s { margin: 8px 0 0; padding: 10px 12px; background: #fff5ec; border-radius: 12px; font-size: 14px; color: #7a3b0a; }
#milo .milo-ord-t { margin-top: 8px; padding: 10px 12px; background: #ecfdf3; border-radius: 12px; font-size: 14px; color: #0f5132; }

/* input */
#milo .milo-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 8px; background: #fff; border-top: 1px solid var(--m-line); }
#milo .milo-in { flex: 1; resize: none; border: 1.5px solid var(--m-line); border-radius: 16px; padding: 11px 14px; font: inherit; font-size: 16px; max-height: 110px;
	background: var(--m-soft); color: var(--m-ink); margin: 0; min-height: 0; transition: border-color .15s, background .15s; }
#milo .milo-in:focus { outline: none; border-color: var(--m-red); background: #fff; }
#milo .milo-send { width: 44px; height: 44px; flex: none; border-radius: 14px; border: 0; background: var(--m-grad); color: #fff; display: flex; align-items: center; justify-content: center;
	cursor: pointer; padding: 0; box-shadow: 0 6px 16px rgba(183,28,60,.28); transition: transform .15s; }
#milo .milo-send:hover { transform: scale(1.05); }
#milo .milo-foot { font-size: 11.5px; color: var(--m-muted); text-align: center; padding: 0 12px 9px; background: #fff; }
#milo .milo-foot a { color: var(--m-muted); }

@media (max-width: 767px) {
	#milo { right: 14px; bottom: 14px; }
	#milo .milo-bubble { width: 58px; height: 58px; }
	#milo .milo-panel { position: fixed; inset: 0; width: auto; height: auto; border-radius: 0; bottom: 0; }
	#milo[data-state="open"] .milo-bubble { display: none; }
	html.milo-open, html.milo-open body { overflow: hidden; }
	#milo .milo-teaser { width: calc(100vw - 28px); max-width: 330px; bottom: 72px; }
	#milo .milo-mb { max-width: 88%; }
	#milo .milo-hero-t { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) { #milo *, #milo *::before, #milo *::after { animation: none !important; transition: none !important; } }
@media print { #milo { display: none !important; } }
