/* Site chat «Консультант Kilim»: Telegram-style messages, photos, voice messages. */
#ai-chat-window.mc{position:relative;display:flex;flex-direction:column;width:min(400px,calc(100vw - 24px));height:min(620px,calc(100dvh - 120px));max-height:none;background:#efe7da;border:1px solid rgba(212,182,120,.5);border-radius:18px;box-shadow:0 24px 60px -12px rgba(21,15,13,.45);overflow:hidden;font-family:Inter,system-ui,sans-serif;color:#1C1614}
#ai-chat-window.mc.hidden{display:none!important}
.mc *{box-sizing:border-box}
.mc button{font:inherit;color:inherit;background:none;border:0;cursor:pointer;padding:0;min-height:0}
.mc-head{display:flex;align-items:center;gap:10px;padding:10px 12px;background:#150F0D;color:#fff;flex-shrink:0}
.mc-ava{width:38px;height:38px;border-radius:50%;color:#150F0D;font-family:Georgia,serif;background:linear-gradient(135deg,#E8D9BC,#BFA05E);display:flex;align-items:center;justify-content:center;font-weight:700;font-size:16px;position:relative;flex-shrink:0}
.mc-ava img{width:38px;height:38px;border-radius:50%;object-fit:cover;display:block}
.mc-ava::after{content:"";position:absolute;right:0;bottom:0;width:10px;height:10px;border-radius:50%;background:#8ef0b8;border:2px solid #150F0D}
.mc-title{flex:1;min-width:0;line-height:1.2}
.mc-title b{display:block;font-size:15px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mc-title small{font-size:12px;color:#9fd9b9}
.mc-title small.typing{color:#E8D9BC}
.mc-hbtn{width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#E8D9BC!important}
.mc-hbtn:hover{background:rgba(255,255,255,.1)}
.mc-hbtn svg{width:20px;height:20px}
.mc-body{flex:1;overflow-y:auto;overscroll-behavior:contain;padding:10px 10px 6px;display:flex;flex-direction:column;gap:3px;background-color:#efe7da;background-image:radial-gradient(rgba(154,124,62,.10) 1px,transparent 1px);background-size:18px 18px;-webkit-overflow-scrolling:touch}
.mc-day{align-self:center;margin:8px 0 4px;padding:3px 10px;border-radius:12px;background:rgba(21,15,13,.35);color:#fff;font-size:12px;font-weight:500}
.mc-row{display:flex;margin-top:2px}
.mc-row.me{justify-content:flex-end}
.mc-row.gap{margin-top:8px}
.mc-b{position:relative;max-width:82%;padding:6px 9px 6px 10px;border-radius:14px;font-size:15px;line-height:1.35;word-wrap:break-word;overflow-wrap:anywhere;box-shadow:0 1px 1px rgba(21,15,13,.12);-webkit-touch-callout:none}
.mc-row.bot .mc-b{background:#fff;border-bottom-left-radius:4px}
.mc-row.me .mc-b{background:#f6ecd6;border-bottom-right-radius:4px}
.mc-b a{color:#1f6aa5;text-decoration:underline}
.mc-p{margin:0}.mc-p+.mc-p{margin-top:.55em}.mc-p b{font-weight:700;color:#150F0D}
.mc-ul{margin:.2em 0;padding:0;list-style:none}.mc-ul li{position:relative;padding-left:1em}.mc-ul li+li{margin-top:.2em}.mc-ul li:before{content:"";position:absolute;left:.2em;top:.6em;width:5px;height:5px;border-radius:50%;background:#C9A96A}
.mc-ol{counter-reset:mc}.mc-ol li{counter-increment:mc;padding-left:1.3em}.mc-ol li:before{content:counter(mc) ".";width:auto;height:auto;background:none;border-radius:0;top:0;left:0;color:#9A7C3E;font-weight:700}
.mc-q{margin:.3em 0;padding:4px 9px;border-left:3px solid #C9A96A;background:#f6efe1;border-radius:0 8px 8px 0;color:#5a4a33;font-size:.93em}
.mc-b a.mc-lnk{display:inline-block;margin:2px 0;padding:2px 9px;border-radius:999px;background:#f3ead8;border:1px solid #e3d3b0;color:#7a5f2a;font-weight:600;font-size:.9em;text-decoration:none;white-space:nowrap}.mc-b a.mc-lnk:hover{background:#ead9b8}
.mc-b.media{padding:3px}
.mc-b.media .mc-txt{padding:4px 6px 0}
.mc-meta{float:right;margin:6px 0 -4px 10px;font-size:11px;color:#7A6E66;display:inline-flex;align-items:center;gap:3px;white-space:nowrap;user-select:none}
.mc-row.me .mc-meta{color:#9A7C3E}
.mc-b.media .mc-meta.over{position:absolute;right:8px;bottom:8px;margin:0;padding:1px 6px;border-radius:10px;background:rgba(0,0,0,.45);color:#fff}
.mc-tick{width:16px;height:11px}
.mc-meta .err{color:#c0392b;font-weight:700}
.mc-quote{border-left:3px solid #BFA05E;padding:2px 8px;margin:0 0 4px;border-radius:4px;background:rgba(191,160,94,.1);font-size:13px;color:#493F3A;overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}
.mc-quote b{display:block;color:#7a5f28;font-size:12px}
.mc-act{display:block;text-align:center;margin-top:6px;padding:8px 10px;border-radius:10px;background:#1f6aa5;color:#fff!important;text-decoration:none!important;font-weight:600;font-size:14px}
.mc-grid{display:grid;gap:2px;border-radius:11px;overflow:hidden;min-width:220px}
.mc-grid.n2,.mc-grid.n3,.mc-grid.n4{grid-template-columns:1fr 1fr}
.mc-grid.n3 img:first-child{grid-column:span 2}
.mc-grid img{display:block;width:100%;height:100%;max-height:300px;object-fit:cover;cursor:zoom-in;background:#ddd}
.mc-grid.n2 img,.mc-grid.n3 img,.mc-grid.n4 img{aspect-ratio:1;max-height:160px}
.mc-grid .gone{display:flex;align-items:center;justify-content:center;min-height:90px;background:#e7dec9;color:#7A6E66;font-size:12px}
.mc-voice{display:flex;align-items:center;gap:8px;min-width:210px;padding:2px 0}
.mc-play{width:40px;height:40px;border-radius:50%;background:#150F0D!important;color:#E8D9BC!important;color:#fff!important;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.mc-play svg{width:18px;height:18px}
.mc-play[disabled]{opacity:.45;cursor:default}
.mc-wave{flex:1;display:flex;align-items:center;gap:2px;height:26px;cursor:pointer}
.mc-wave i{flex:1;min-width:2px;max-width:3px;border-radius:2px;background:rgba(154,124,62,.35)}
.mc-wave i.on{background:#9A7C3E}
.mc-vinfo{display:flex;align-items:center;gap:6px;height:20px;font-size:12px;color:#9A7C3E;margin-top:2px}
.mc-speed,.mc-trbtn{height:18px;line-height:18px!important;font-size:11px!important;font-weight:700;padding:0 6px!important;border-radius:9px;background:rgba(154,124,62,.15)!important;color:#7a5f28!important}
.mc-tr{margin-top:4px;padding-top:4px;border-top:1px dashed rgba(154,124,62,.4);font-size:14px;color:#3a2f22}
.mc-tr.wait{color:#7A6E66;font-style:italic}
.mc-typing{display:inline-flex;gap:4px;padding:6px 2px}
.mc-typing i{width:7px;height:7px;border-radius:50%;background:#9a8f86;animation:mcDot 1.2s infinite}
.mc-typing i:nth-child(2){animation-delay:.15s}.mc-typing i:nth-child(3){animation-delay:.3s}
@keyframes mcDot{0%,60%,100%{opacity:.3;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}
.mc-down{position:absolute;right:12px;bottom:76px;width:42px;height:42px;border-radius:50%;background:#fff!important;box-shadow:0 2px 8px rgba(0,0,0,.25);display:flex;align-items:center;justify-content:center;color:#493F3A!important;z-index:3}
.mc-down[hidden]{display:none}
.mc-down svg{width:20px;height:20px}
.mc-down span{position:absolute;top:-6px;right:-2px;min-width:20px;height:20px;padding:0 5px;border-radius:10px;background:#9A7C3E;color:#fff;font-size:11px;font-weight:700;display:flex;align-items:center;justify-content:center}
.mc-down span:empty{display:none}
.mc-foot{flex-shrink:0;background:#fff;border-top:1px solid #E7DEC9;position:relative}
.mc-reply{display:flex;align-items:center;gap:8px;padding:6px 10px 0}
.mc-reply[hidden],.mc-att[hidden]{display:none}
.mc-reply svg{width:18px;height:18px;color:#9A7C3E;flex-shrink:0}
.mc-reply div{flex:1;min-width:0;border-left:3px solid #BFA05E;padding-left:8px;font-size:13px;line-height:1.25}
.mc-reply div b{display:block;color:#7a5f28;font-size:12px}
.mc-reply div span{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#493F3A}
.mc-att{display:flex;gap:6px;padding:8px 10px 0;overflow-x:auto}
.mc-att figure{position:relative;margin:0;width:64px;height:64px;flex-shrink:0;border-radius:10px;overflow:hidden;background:#eee}
.mc-att figure img{width:100%;height:100%;object-fit:cover}
.mc-att figure button{position:absolute;top:3px;right:3px;width:20px;height:20px;border-radius:50%;background:rgba(0,0,0,.6)!important;color:#fff!important;font-size:13px;line-height:20px;text-align:center}
.mc-att .busy{display:flex;align-items:center;justify-content:center;font-size:11px;color:#7A6E66}
.mc-bar{display:flex;align-items:flex-end;gap:4px;padding:8px}
.mc-ibtn{width:42px;height:42px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#7A6E66!important;flex-shrink:0}
.mc-ibtn:hover{background:#F3EDE3!important}
.mc-ibtn svg{width:24px;height:24px}
.mc-bar textarea{flex:1;min-width:0;resize:none;border:1px solid #D8CCB4;border-radius:21px;padding:10px 14px;font:inherit;font-size:16px;line-height:20px;max-height:140px;min-height:42px;background:#FAF7F2;color:#1C1614;outline:none;overflow-y:auto}
.mc-bar textarea:focus{border-color:#9A7C3E;background:#fff}
.mc-main{width:46px;height:46px;border-radius:50%;background:#150F0D!important;color:#E2BE72!important;display:flex;align-items:center;justify-content:center;flex-shrink:0;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;transition:transform .15s,background .15s}
.mc-main svg{width:22px;height:22px;pointer-events:none}
.mc-main[disabled]{opacity:.5}
.mc-main.rec{transform:scale(1.35);background:#e0452f!important;box-shadow:0 0 0 8px rgba(224,69,47,.18)}
.mc-rec{position:absolute;inset:0;right:62px;display:flex;align-items:center;gap:10px;padding:0 14px;background:#fff;font-size:15px;z-index:2}
.mc-rec[hidden]{display:none}
.mc-rec .dot{width:10px;height:10px;border-radius:50%;background:#e0452f;animation:mcBlink 1s infinite}
@keyframes mcBlink{50%{opacity:.2}}
.mc-rec .time{font-variant-numeric:tabular-nums;min-width:40px}
.mc-rec .hint{flex:1;text-align:center;color:#7A6E66;font-size:14px;white-space:nowrap;overflow:hidden}
.mc-rec .live{flex:1;display:flex;align-items:center;gap:2px;height:28px;overflow:hidden;justify-content:flex-end}
.mc-rec .live i{width:3px;flex-shrink:0;border-radius:2px;background:#e0452f}
.mc-rec .del{width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#e0452f!important}
.mc-rec .del svg{width:22px;height:22px}
.mc-heard{position:absolute;left:0;right:0;bottom:100%;padding:7px 14px;background:rgba(255,255,255,.96);border-top:1px solid #E7DEC9;font-size:14px;line-height:1.35;color:#493F3A;max-height:4.2em;overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;z-index:3}
.mc-heard[hidden]{display:none}
.mc-lock{position:absolute;right:12px;bottom:72px;width:42px;padding:10px 0;border-radius:21px;background:#fff;box-shadow:0 2px 10px rgba(0,0,0,.2);display:flex;flex-direction:column;align-items:center;gap:4px;color:#7A6E66;z-index:4}
.mc-lock[hidden]{display:none}
.mc-lock svg{width:20px;height:20px}
.mc-drop{position:absolute;inset:0;z-index:6;display:flex;align-items:center;justify-content:center;background:rgba(191,160,94,.15);border:3px dashed #BFA05E;border-radius:18px;color:#7a5f28;font-weight:600;font-size:15px;pointer-events:none}
.mc-drop[hidden]{display:none}
.mc-menu{position:absolute;z-index:8;min-width:170px;padding:6px 0;border-radius:12px;background:#fff;box-shadow:0 8px 28px rgba(0,0,0,.25)}
.mc-menu[hidden]{display:none}
.mc-menu button{display:flex!important;align-items:center;gap:10px;width:100%;padding:10px 16px!important;font-size:15px;text-align:left}
.mc-menu button:hover{background:#F3EDE3!important}
.mc-menu svg{width:18px;height:18px;color:#7A6E66}
.mc-viewer{position:fixed;inset:0;z-index:120;background:rgba(0,0,0,.92);display:flex;align-items:center;justify-content:center;touch-action:pan-y}
.mc-viewer[hidden]{display:none}
.mc-viewer img{max-width:100vw;max-height:100dvh;object-fit:contain}
.mc-viewer button{position:absolute;min-height:0;width:46px;height:46px;border-radius:50%;background:rgba(255,255,255,.12)!important;color:#fff!important;font-size:26px;display:flex;align-items:center;justify-content:center}
.mc-viewer .x{top:max(14px,env(safe-area-inset-top));right:14px}
.mc-viewer .p{left:10px;top:50%}.mc-viewer .n{right:10px;top:50%}
.mc-viewer .c{position:absolute;bottom:max(18px,env(safe-area-inset-bottom));color:#fff;font-size:14px}
/* carpet in focus, channels, quick replies, carpet cards, contact form */
.mc-channels{display:flex;gap:6px;padding:7px 10px;background:#fff;border-bottom:1px solid #eee6d6;overflow-x:auto;scrollbar-width:none;flex-shrink:0}
.mc .mc-channels>*{flex:0 0 auto;line-height:1.4;padding:5px 11px!important;border-radius:999px;border:1px solid #e2d8c4!important;font-size:12px;font-weight:600;color:#241c17;background:#fff!important;text-decoration:none}
.mc-channels #mc-tg{color:#1f6aa5;border-color:#bcd5ea!important}.mc-channels #mc-wa{color:#16703c;border-color:#bfe0cb!important}
.mc-channels [hidden]{display:none}
.mc-focus{display:flex;align-items:center;gap:9px;padding:7px 10px;background:#f4ecdc;border-bottom:1px solid #eadfc9;flex-shrink:0}
.mc-focus[hidden]{display:none}
.mc-focus img{width:38px;height:38px;border-radius:8px;object-fit:cover;background:#eee}.mc-focus>div{flex:1;min-width:0}
.mc-focus-k{font-size:10.5px;color:#8a7a5c;text-transform:uppercase;letter-spacing:.06em}.mc-focus-n{font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mc-focus button{font-size:20px;color:#8a7a5c!important;width:30px;height:30px}
.mc-chipbar{display:flex;gap:6px;padding:8px 10px 0;overflow-x:auto;scrollbar-width:none}
.mc-chipbar:empty{display:none}
.mc-chipbar button{flex:0 0 auto;padding:6px 12px!important;border-radius:999px;border:1px solid #d9c59a!important;background:#fff!important;color:#4a3b22!important;font-size:13px;font-weight:600;white-space:nowrap}
.mc-chipbar button:hover{background:#f7efdd!important}
.mc-from{font-size:12px;font-weight:700;color:#9A7C3E;margin-bottom:2px}
.mc-act.dark{background:#150F0D;color:#F7F1E5!important}
.mc-card{display:flex;gap:10px;background:#fff;border:1px solid #e7dcc6;border-radius:14px;padding:8px;max-width:88%;margin-top:4px;box-shadow:0 1px 1px rgba(21,15,13,.08)}
.mc-card img{width:72px;height:72px;border-radius:10px;object-fit:cover;background:#f3eee4;flex:0 0 72px}
.mc-card-body{min-width:0;flex:1}.mc-card-name{font-weight:600;font-size:13px;line-height:1.3;max-height:2.6em;overflow:hidden}
.mc-card-meta{font-size:12px;color:#6d5f4b;margin:2px 0 6px}
.mc-card-btns{display:flex;gap:6px}.mc-card-btns button{flex:1;padding:6px 4px!important;border-radius:9px;border:1px solid #d9ccb2!important;font-size:12px;font-weight:600;background:#fff!important}
.mc .mc-primary{background:#150F0D!important;color:#F7F1E5!important;border-color:#150F0D!important}
.mc-form{background:#fff;border:1px solid #e2d3b2;border-radius:16px;padding:12px;width:88%;display:flex;flex-direction:column;gap:8px;box-shadow:0 6px 18px -12px rgba(21,15,13,.4)}
.mc-form-title{font-weight:700;font-size:14px}
.mc-form input:not([type=radio]){width:100%;font-size:16px;padding:10px 12px;border:1px solid #dccfb6;border-radius:11px;background:#fbf8f2}
.mc-pref{display:flex;gap:6px}.mc-pref label{flex:1;position:relative}.mc-pref input{position:absolute;opacity:0;pointer-events:none}
.mc-pref span{display:block;text-align:center;padding:7px 4px;border:1px solid #dccfb6;border-radius:10px;font-size:12px;cursor:pointer}
.mc-pref input:checked+span{background:#150F0D;color:#F7F1E5;border-color:#150F0D}
.mc-pref input:focus-visible+span{outline:2px solid #BFA05E}
.mc-wide{width:100%;padding:11px!important;border-radius:12px;font-weight:700;font-size:14px}
.mc-note{font-size:11px;color:#8a7a5c}.mc-err{font-size:12px;color:#8b1d2c}
.mc-done{background:#eef8f1;border:1px solid #bfe0cb;color:#14532d;border-radius:14px;padding:10px 12px;max-width:88%;font-size:14px}
@media(max-width:639px){
  #ai-chat-window.mc{position:fixed;left:0;right:0;top:0;width:100vw;height:var(--mc-vh,100dvh);border-radius:0;border:0;z-index:70}
  .mc-head{padding-top:max(10px,env(safe-area-inset-top))}
  .mc-bar{padding-bottom:max(8px,env(safe-area-inset-bottom))}
  .mc-drop{border-radius:0}
}
@media(prefers-reduced-motion:reduce){.mc-typing i,.mc-rec .dot{animation:none}.mc-main{transition:none}}
.mc-media{display:grid;grid-template-columns:repeat(2,1fr);gap:6px;max-width:88%;margin-top:4px}.mc-media a{display:block;color:#3b2f24;text-decoration:none;font-size:11px;line-height:1.3}.mc-media img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:10px;background:#f3eee4;display:block}.mc-media span{display:block;margin-top:2px}.mc-media .mc-video{grid-column:1/-1;padding:8px 10px;border:1px solid #d9ccb2;border-radius:10px;background:#fff;font-weight:600}
