/* ALASHLAW — AI «Алаш»: полноэкранный чат. Те же правила, что у сайта:
   слева — назад, по центру — заголовок/режим, справа — действия. Стекло — только у панелей. */
.alc{ position:fixed; inset:0; z-index:120; display:flex; flex-direction:column; background:var(--bg); animation:alc-in .45s var(--ease) both; }
.alc.is-out{ animation:alc-out .25s var(--ease) forwards; }
@keyframes alc-in{ from{ opacity:0; transform:translateY(16px); } }
@keyframes alc-out{ to{ opacity:0; transform:translateY(16px); } }
body.alc-open{ overflow:hidden; }
.alc svg.i{ fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }

.alc-top{ flex:none; display:grid; grid-template-columns:auto 1fr auto; align-items:center; gap:8px; height:calc(var(--bar) + env(safe-area-inset-top)); padding:env(safe-area-inset-top) calc(var(--gut) - 6px) 0; border-bottom:.5px solid var(--line-2); }
.alc-top__r{ display:flex; gap:2px; }
.alc-ib{ display:grid; place-items:center; width:40px; height:40px; border-radius:50%; color:var(--ink); transition:background-color .2s,transform .4s var(--spring); }
.alc-ib:hover{ background:var(--fill); }
.alc-ib:active{ transform:scale(.9); transition-duration:.1s; }
.alc-ib svg{ width:22px; height:22px; }
.alc-mode{ justify-self:center; width:min(220px,100%); }
@media (min-width:960px){ .alc-top [data-alc-hist]{ display:none; } }

.alc-body{ flex:1; min-height:0; display:flex; padding-bottom:var(--kb-h,0px); transition:padding-bottom .4s var(--ease); }
.alc-hist{ display:none; flex-direction:column; width:280px; flex:none; padding:12px; border-right:.5px solid var(--line-2); overflow-y:auto; background:var(--bg); }
@media (min-width:960px){ .alc-hist{ display:flex; } }
.alc-hist.is-sheet{ display:flex; position:fixed; z-index:130; top:0; left:0; bottom:0; width:min(320px,86vw); padding-top:calc(12px + env(safe-area-inset-top)); border:0; box-shadow:0 0 0 100vmax rgba(0,0,0,.25),var(--shadow-float); animation:alc-side .45s var(--ease); }
@keyframes alc-side{ from{ transform:translateX(-100%); } }
.alc-hist__new{ display:flex; align-items:center; gap:8px; height:42px; padding:0 12px; border-radius:12px; font-weight:600; color:var(--ink); background:var(--card); box-shadow:inset 0 0 0 1px var(--line); }
.alc-hist__new svg{ width:18px; height:18px; }
.alc-hist h4{ margin:16px 10px 6px; font-size:12px; font-weight:500; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); }
.alc-hist li button{ width:100%; padding:9px 10px; border-radius:10px; text-align:left; font-size:14.5px; color:var(--ink-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.alc-hist li button.is-on,.alc-hist li button:hover{ background:var(--fill); color:var(--ink); }
.alc-hist li small{ display:block; font-size:12px; color:var(--muted); }
.alc-hist__empty,.alc-hist__acc{ padding:10px; font-size:13.5px; color:var(--muted); }
.alc-hist__acc{ margin-top:auto; } .alc-hist__acc a{ color:var(--link); font-weight:600; }

.alc-main{ flex:1; min-width:0; display:flex; flex-direction:column; }
.alc-log{ flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; }
.alc-col{ width:100%; max-width:760px; min-height:100%; margin:0 auto; padding:12px 16px; display:flex; flex-direction:column; justify-content:flex-end; gap:18px; }

.alc-hello{ flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; padding:24px 8px; }
.alc-orn-big{ width:64px; height:64px; }
.alc-orn-big .ali{ width:40px; height:40px; stroke-width:1.3; }
.alc-hello h2{ margin-top:18px; font-size:clamp(22px,4vw,28px); font-weight:750; letter-spacing:-.02em; }
.alc-hello p{ margin-top:6px; max-width:440px; color:var(--muted); font-size:15.5px; }

.alc-u{ align-self:flex-end; max-width:min(82%,560px); padding:9px 14px; border-radius:20px 20px 6px 20px; background:var(--accent); color:#fff; white-space:pre-wrap; word-wrap:break-word; font-size:16px; line-height:1.45; animation:alc-msg .4s var(--ease) both; }
.alc-u small{ display:flex; align-items:center; gap:4px; margin-bottom:3px; font-size:12.5px; opacity:.85; }
.alc-u small svg{ width:14px; height:14px; }
.alc-a{ display:flex; flex-direction:column; gap:6px; animation:alc-msg .45s var(--ease) both; }
@keyframes alc-msg{ from{ opacity:0; transform:translateY(8px); } }
.alc-a__who{ display:flex; align-items:center; gap:8px; font-size:13px; font-weight:650; color:var(--ink-2); }
.alc-mini{ display:grid; place-items:center; width:24px; height:24px; border-radius:50%; color:#fff; background:#0A2A66; }
:root[data-theme="dark"] .alc-mini{ background:#2F5FD0; }
.alc-mini .ali{ width:17px; height:17px; stroke-width:1.5; }
.alc-md{ font-size:16px; line-height:1.65; color:var(--ink); word-wrap:break-word; }
.alc-md h3{ margin:14px 0 6px; font-size:16.5px; font-weight:700; }
.alc-md p{ margin:0 0 10px; }
.alc-md ul,.alc-md ol{ margin:0 0 10px; padding-left:22px; } .alc-md ul{ list-style:disc; } .alc-md ol{ list-style:decimal; }
.alc-md li{ margin:4px 0; }
.alc-md a{ color:var(--link); text-decoration:underline; text-underline-offset:2px; word-break:break-word; }
.alc-md code{ font-size:14px; padding:1px 5px; border-radius:6px; background:var(--fill); }
.alc-md em{ color:var(--muted); }
.alc-md blockquote{ margin:0 0 10px; padding:8px 14px; border-left:3px solid var(--line-2); color:var(--ink-2); }
.alc-src{ display:flex; flex-wrap:wrap; gap:6px; }
.alc-src a{ display:inline-flex; align-items:center; gap:6px; max-width:100%; height:30px; padding:0 12px; border-radius:999px; font-size:13px; font-weight:500; color:var(--ink-2); background:var(--card); box-shadow:inset 0 0 0 1px var(--line-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.alc-src svg{ width:14px; height:14px; }
.alc-tools{ display:flex; gap:2px; margin-left:-8px; }
.alc-tools button{ display:grid; place-items:center; width:34px; height:34px; border-radius:50%; color:var(--muted); transition:background-color .2s,color .2s; }
.alc-tools button:hover{ background:var(--fill); color:var(--ink); }
.alc-tools button.is-on{ color:var(--accent); }
.alc-tools svg{ width:18px; height:18px; }
.alc-think{ display:inline-flex; align-items:center; gap:8px; font-size:15px; color:var(--muted); }
.alc-think::before,.alc-spin{ content:""; width:16px; height:16px; flex:none; border-radius:50%; border:2px solid var(--line-2); border-top-color:var(--accent); animation:alc-rot .8s linear infinite; }
@keyframes alc-rot{ to{ transform:rotate(360deg); } }

/* нижняя зона */
.alc-bottom{ flex:none; width:100%; max-width:760px; margin:0 auto; padding:6px 12px calc(10px + env(safe-area-inset-bottom)); }
body.al-kb-open .alc-bottom{ padding-bottom:8px; }
.alc-strip{ display:flex; gap:6px; overflow-x:auto; margin:0 -12px 8px; padding:0 12px; scrollbar-width:none; }
.alc-strip::-webkit-scrollbar{ display:none; }
.alc-strip button{ flex:none; height:30px; padding:0 12px; border-radius:999px; font-size:13px; font-weight:500; color:var(--ink-2); background:var(--card); box-shadow:inset 0 0 0 1px var(--line-2); white-space:nowrap; }
.alc-file{ display:flex; align-items:center; gap:8px; margin-bottom:8px; padding:6px 6px 6px 12px; border-radius:12px; font-size:14px; background:var(--card); box-shadow:inset 0 0 0 1px var(--line); }
.alc-file span{ flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.alc-form{ display:flex; align-items:flex-end; gap:4px; padding:5px; border-radius:24px; background:var(--card); box-shadow:inset 0 0 0 1px var(--line-2); }
.alc-form:focus-within{ box-shadow:inset 0 0 0 1.5px var(--accent); }
.alc-form textarea,.alc-form .al-vfield{ flex:1; min-width:0; min-height:40px; max-height:160px; padding:9px 6px; border:0; outline:0; resize:none; background:none; font-size:16.5px; line-height:22px; overflow-y:auto; color:var(--ink); }
.alc-form textarea::placeholder{ color:var(--muted); }
.alc-plus,.alc-act{ display:grid; place-items:center; width:40px; height:40px; flex:none; border-radius:50%; cursor:pointer; transition:transform .4s var(--spring),background-color .2s,color .2s; }
.alc-plus{ color:var(--muted); }
.alc-plus:hover{ background:var(--fill); }
.alc-plus:active,.alc-act:active{ transform:scale(.88); transition-duration:.1s; }
.alc-plus svg,.alc-act svg{ width:22px; height:22px; }
.alc-act{ color:#fff; background:var(--accent); }
.alc-act.is-mic{ color:var(--ink); background:transparent; }
.alc-act.is-mic:hover{ background:var(--fill); }
.alc-act:disabled{ opacity:.35; }
.alc-disc{ margin-top:6px; font-size:11.5px; line-height:1.4; color:var(--muted); text-align:center; display:-webkit-box; -webkit-line-clamp:1; -webkit-box-orient:vertical; overflow:hidden; cursor:pointer; }
.alc-disc.is-open{ display:block; }

/* ---------- голос ---------- */
.alc-bottom.is-voice .alc-form,.alc-bottom.is-voice .alc-strip,.alc-bottom.is-voice .alc-file{ display:none; }
.alc-voice__txt{ margin:0; font-size:16px; font-weight:500; color:var(--ink-2); display:flex; align-items:center; justify-content:center; gap:10px; min-width:0; }
.alc-voice[data-state="conn"] .alc-voice__txt::before,.alc-voice[data-state="dec"] .alc-voice__txt::before{ content:""; width:16px; height:16px; flex:none; border-radius:50%; border:2px solid var(--line-2); border-top-color:var(--accent); animation:alc-rot .8s linear infinite; }
.alc-voice[data-state="msg"] .alc-voice__txt{ color:var(--ink); }
.alc-wave{ display:flex; align-items:center; justify-content:center; gap:3px; height:44px; }
.alc-wave i{ display:block; width:3px; height:100%; border-radius:2px; background:var(--accent); transform:scaleY(.08); transition:transform .08s linear; }
.alc-voice__time{ font-size:13px; font-weight:600; color:var(--muted); font-variant-numeric:tabular-nums; min-width:34px; text-align:center; }
.alc-rec{ position:relative; display:grid; place-items:center; width:44px; height:44px; flex:none; border-radius:50%; color:#fff; background:var(--accent); transition:transform .4s var(--spring); }
.alc-rec::before{ content:""; position:absolute; inset:-5px; border-radius:50%; border:2px solid color-mix(in srgb,var(--accent) 35%,transparent); transform:scale(var(--lvl,1)); transition:transform .08s linear; }
.alc-rec:active{ transform:scale(.9); }
.alc-rec svg{ width:22px; height:22px; }
/* состояния: подключение и распознавание — только текст с загрузкой, без волны и кнопки записи */
.alc-voice[data-state="conn"] .alc-wave,.alc-voice[data-state="dec"] .alc-wave,.alc-voice[data-state="msg"] .alc-wave,
.alc-voice[data-state="conn"] .alc-voice__time,.alc-voice[data-state="dec"] .alc-voice__time,.alc-voice[data-state="msg"] .alc-voice__time,
.alc-voice:not([data-state="rec"]) .alc-rec{ display:none; }
.alc-voice[data-state="dec"] .alc-v-kbd,.alc-voice[data-state="msg"] .alc-v-kbd{ visibility:hidden; }

/* компьютер: голос — прямо в строке ввода */
@media (min-width:768px){
	.alc-voice{ display:flex; align-items:center; gap:8px; height:52px; padding:5px; border-radius:24px; background:var(--card); box-shadow:inset 0 0 0 1.5px var(--accent); animation:alc-msg .35s var(--ease) both; }
	.alc-voice__ctl{ display:contents; }
	.alc-v-kbd{ display:none !important; }
	.alc-v-x{ order:-1; }
	.alc-voice__txt{ flex:1; justify-content:flex-start; font-size:15px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
	.alc-voice[data-state="rec"] .alc-voice__txt{ display:none; }
	.alc-wave{ flex:1; height:30px; }
}
/* телефон: панель снизу вместо клавиатуры */
@media (max-width:767px){
	.alc-voice{ position:fixed; z-index:140; left:0; right:0; bottom:0; display:flex; flex-direction:column; align-items:center; gap:12px; padding:20px 16px calc(16px + env(safe-area-inset-bottom)); border-radius:24px 24px 0 0; background:var(--glass); -webkit-backdrop-filter:var(--blur); backdrop-filter:var(--blur); box-shadow:0 -.5px 0 var(--line-2),var(--shadow-float); animation:alc-up .45s var(--ease) both; }
	.alc-voice.is-out{ animation:alc-down .25s var(--ease) forwards; }
	.alc-voice__txt{ min-height:28px; text-align:center; }
	.alc-wave{ height:56px; width:100%; }
	.alc-voice__ctl{ display:grid; grid-template-columns:1fr auto 1fr; align-items:center; width:100%; max-width:360px; min-height:64px; }
	.alc-v-kbd{ justify-self:start; } .alc-v-x{ justify-self:end; }
	.alc-rec{ width:60px; height:60px; }
	.alc-rec svg{ width:26px; height:26px; }
	.alc-voice[data-state="dec"] .alc-voice__txt,.alc-voice[data-state="conn"] .alc-voice__txt{ min-height:120px; }
}
@keyframes alc-up{ from{ transform:translateY(100%); } }
@keyframes alc-down{ to{ transform:translateY(100%); opacity:0; } }

/* аккаунт в шапке чата: гость — «Кіру», вошёл — аватар (при наведении — имя) */
.alc-accb{ display:inline-flex; align-items:center; gap:6px; height:36px; margin-left:4px; padding:0 12px 0 8px; border-radius:999px; font-size:14px; font-weight:600; color:var(--ink); background:var(--card); box-shadow:inset 0 0 0 1px var(--line-2); transition:transform .35s var(--spring); }
.alc-accb:active{ transform:scale(.95); }
.alc-accb svg{ width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.7; }
.alc-accb.is-in{ width:36px; padding:0; justify-content:center; overflow:hidden; color:#fff; background:#8E8E93; box-shadow:none; }
.alc-accb.is-in img{ width:100%; height:100%; object-fit:cover; }
.alc-accb.is-in span{ font-size:15px; }
@media (max-width:480px){ .alc-accb:not(.is-in) b{ display:none; } .alc-accb:not(.is-in){ width:36px; padding:0; justify-content:center; } }
.alc-login{ display:inline-flex; align-items:center; gap:8px; height:40px; margin-top:10px; padding:0 16px; border-radius:999px; font-size:15px; font-weight:600; color:#fff; background:#0A2A66; }
.alc-login svg{ width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.8; }
.al-spark.alc-orn-big{ width:64px; height:64px; }
.alc-mini{ background:linear-gradient(145deg,#1D5BD8,#0A2A66); }
.alc-mini .ali,.alc-orn-big .ali{ stroke:none; }
