/* Medobal Green chat assistant */
.mgc-btn, .mgc-panel, .mgc-teaser { --c-deep: #0c1f14; --c-green: #1c5a2b; --c-bright: #6ee09a; --c-gold: #c2a45a; font-family: inherit; }

/* launcher */
.mgc-btn { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; align-items: center; gap: 12px; padding: 8px 20px 8px 8px; border: 1px solid rgba(194,164,90,.55); border-radius: 40px; background: linear-gradient(135deg, #0c1f14, #1c5a2b); color: #fff; cursor: pointer; box-shadow: 0 12px 32px rgba(12,31,20,.45), 0 0 0 0 rgba(110,224,154,.5); animation: mgc-pulse 2.8s infinite; transition: transform .2s; }
.mgc-btn:hover { transform: translateY(-2px); }
.mgc-btn.is-open { display: none; }
.mgc-av { position: relative; width: 46px; height: 46px; flex: none; border-radius: 50%; background: #fff; display: grid; place-items: center; overflow: hidden; border: 2px solid var(--c-gold); }
.mgc-av img { width: 30px; height: 30px; object-fit: contain; display: block; }
.mgc-btn-txt { text-align: left; line-height: 1.2; }
.mgc-btn-txt b { display: block; font-size: 15px; font-weight: 700; }
.mgc-btn-txt small { display: block; font-size: 12px; color: #cfe8d6; }
.mgc-dot { position: absolute; left: 44px; top: 8px; width: 12px; height: 12px; border-radius: 50%; background: #4ade80; border: 2px solid #0c1f14; }
@keyframes mgc-pulse { 0%,100% { box-shadow: 0 12px 32px rgba(12,31,20,.45), 0 0 0 0 rgba(110,224,154,.45); } 60% { box-shadow: 0 12px 32px rgba(12,31,20,.45), 0 0 0 12px rgba(110,224,154,0); } }

/* teaser */
.mgc-teaser { position: fixed; right: 24px; bottom: 90px; z-index: 59; max-width: 250px; padding: 12px 34px 12px 14px; background: #fff; color: #1b1b16; border-radius: 16px 16px 4px 16px; box-shadow: 0 12px 30px rgba(0,0,0,.22); font-size: 14px; line-height: 1.4; cursor: pointer; animation: mgc-pop .35s ease both; }
.mgc-teaser b { display: block; color: var(--c-green); margin-bottom: 2px; }
.mgc-teaser[hidden] { display: none; }
.mgc-teaser-x { position: absolute; top: 6px; right: 8px; border: 0; background: transparent; font-size: 18px; color: #77735f; cursor: pointer; line-height: 1; }
@keyframes mgc-pop { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }

/* panel */
.mgc-panel { position: fixed; right: 20px; bottom: 20px; z-index: 61; width: min(390px, calc(100vw - 24px)); height: min(600px, calc(100vh - 40px)); display: flex; flex-direction: column; background: #fff; color: #1b1b16; border-radius: 22px; box-shadow: 0 24px 64px rgba(0,0,0,.4); overflow: hidden; animation: mgc-pop .3s ease both; }
.mgc-panel[hidden] { display: none; }
.mgc-head { display: flex; align-items: center; gap: 12px; padding: 16px; background: linear-gradient(135deg, #0c1f14 0%, #1c5a2b 100%); color: #fff; border-bottom: 3px solid var(--c-gold); }
.mgc-head .mgc-av { width: 44px; height: 44px; }
.mgc-title { flex: 1; min-width: 0; }
.mgc-title b { display: block; font-size: 16px; font-weight: 700; }
.mgc-title small { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #cfe8d6; }
.mgc-title small::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 3px rgba(74,222,128,.25); }
.mgc-close { width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 22px; line-height: 1; cursor: pointer; }
.mgc-close:hover { background: rgba(255,255,255,.26); }

.mgc-log { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 12px; background: #f6f4ec; scroll-behavior: smooth; }
.mgc-row { display: flex; align-items: flex-end; gap: 8px; align-self: flex-start; max-width: 92%; }
.mgc-row .mgc-av { width: 28px; height: 28px; border-width: 1.5px; }
.mgc-row .mgc-av img { width: 18px; height: 18px; }
.mgc-msg { padding: 10px 13px; border-radius: 16px; font-size: 14px; line-height: 1.5; max-width: 100%; }
.mgc-msg p { margin: 0 0 6px; }
.mgc-msg p:last-child { margin-bottom: 0; }
.mgc-msg.bot { background: #fff; border-radius: 16px 16px 16px 4px; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.mgc-msg.user { align-self: flex-end; max-width: 85%; background: linear-gradient(135deg, #1c5a2b, #247a3a); color: #fff; border-radius: 16px 16px 4px 16px; }
.mgc-msg.typing { display: flex; gap: 5px; padding: 14px 16px; }
.mgc-msg.typing i { width: 7px; height: 7px; border-radius: 50%; background: #9a967f; animation: mgc-bounce 1.2s infinite; }
.mgc-msg.typing i:nth-child(2) { animation-delay: .15s; }
.mgc-msg.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes mgc-bounce { 0%,60%,100% { transform: none; opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

.mgc-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 14px 12px; background: #f6f4ec; }
.mgc-chips[hidden] { display: none; }
.mgc-chip { border: 1px solid #1c5a2b; color: #1c5a2b; background: #fff; border-radius: 18px; padding: 7px 13px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.mgc-chip:hover { background: #1c5a2b; color: #fff; }

.mgc-rep { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px; background: #e6f6ec; color: #0f5a2c; font-size: 13px; font-weight: 700; text-decoration: none; border-top: 1px solid #cfe9d8; }
.mgc-rep::before { content: ""; width: 16px; height: 16px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 0 0-8.6 15.1L2 22l5-1.3A10 10 0 1 0 12 2zm5.2 14.2c-.2.6-1.300 1.200-1.800 1.200-.5.100-1 .2-3.200-.7-2.700-1.100-4.400-3.800-4.500-4-.1-.2-1.100-1.400-1.100-2.700s.7-1.900.9-2.200c.2-.2.5-.3.700-.3h.5c.2 0 .4 0 .6.500l.8 2c.1.200.1.300 0 .500l-.3.400-.4.500c-.1.100-.3.300-.1.600.2.300.7 1.200 1.600 1.900 1.100 1 2 1.300 2.300 1.400.3.100.5.100.600-.1l.9-1.100c.2-.2.400-.2.600-.1l1.900.9c.2.100.4.200.500.300.100.200.1.700-.1 1.300z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 0 0-8.6 15.1L2 22l5-1.3A10 10 0 1 0 12 2zm5.2 14.2c-.2.6-1.300 1.200-1.800 1.200-.5.100-1 .2-3.200-.7-2.700-1.100-4.400-3.800-4.500-4-.1-.2-1.100-1.400-1.100-2.700s.7-1.900.9-2.200c.2-.2.5-.3.700-.3h.5c.2 0 .4 0 .6.500l.8 2c.1.200.1.300 0 .500l-.3.400-.4.500c-.1.100-.3.300-.1.600.2.300.7 1.200 1.600 1.900 1.100 1 2 1.300 2.300 1.400.3.100.5.100.600-.1l.9-1.100c.2-.2.400-.2.600-.1l1.900.9c.2.100.4.200.500.300.100.200.1.700-.1 1.300z'/%3E%3C/svg%3E") center / contain no-repeat; }
.mgc-rep:hover { background: #d9f0e2; }

.mgc-form { display: flex; gap: 8px; padding: 10px 12px; background: #fff; border-top: 1px solid #ebe7d8; }
.mgc-input { flex: 1; min-width: 0; height: 44px; border: 1px solid #d6d1be; border-radius: 22px; padding: 0 16px; font-size: 15px; background: #faf9f4; }
.mgc-input:focus { outline: 2px solid #6ee09a; border-color: transparent; background: #fff; }
.mgc-send { height: 44px; padding: 0 18px; border: 0; border-radius: 22px; background: linear-gradient(135deg, #1c5a2b, #247a3a); color: #fff; font-weight: 700; cursor: pointer; }
.mgc-note { margin: 0; padding: 0 16px 10px; font-size: 11px; color: #7a7664; background: #fff; }

.mgc-lead { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.mgc-lead b, .mgc-lead p { flex-basis: 100%; margin: 0; }
.mgc-lead b { color: var(--c-green); }
.mgc-cta { display: inline-block; padding: 8px 14px; border-radius: 18px; border: 1px solid #1c5a2b; color: #1c5a2b; font-size: 13px; font-weight: 700; text-decoration: none; background: #fff; cursor: pointer; }
.mgc-cta.green { background: var(--c-bright); border-color: var(--c-bright); color: #0c1f14; }
.mgc-cta.big { flex-basis: 100%; text-align: center; padding: 12px 14px; font-size: 14px; border-radius: 22px; box-shadow: 0 6px 16px rgba(110,224,154,.4); }

@media (max-width: 768px) {
  .mgc-btn { bottom: 84px; right: 12px; padding-right: 16px; }
  .mgc-teaser { right: 16px; bottom: 150px; }
  .mgc-panel { right: 8px; bottom: 8px; width: calc(100vw - 16px); height: calc(100vh - 16px); max-height: 680px; }
}
@media (prefers-reduced-motion: reduce) { .mgc-btn, .mgc-teaser, .mgc-panel { animation: none; } .mgc-msg.typing i { animation: none; } }
