/* Copyright © 2026 MELDIX. TrioSoft. All rights reserved. */
:root {
  --arsyusha-accent: #7d6cff;
  --arsyusha-accent-2: #4aa8ff;
  --arsyusha-bg: rgba(13, 16, 28, .96);
  --arsyusha-surface: rgba(255, 255, 255, .055);
  --arsyusha-edge: rgba(255, 255, 255, .12);
  --arsyusha-text: #f7f8ff;
  --arsyusha-muted: #9ca3b7;
}
[data-theme="light"] {
  --arsyusha-bg: rgba(248, 250, 255, .97);
  --arsyusha-surface: rgba(26, 34, 60, .06);
  --arsyusha-edge: rgba(20, 30, 55, .12);
  --arsyusha-text: #151827;
  --arsyusha-muted: #6f768a;
}
.arsyusha-root {
  position: fixed;
  z-index: 9997;
  right: 22px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  font-family: inherit;
  pointer-events: none;
}
.arsyusha-root.left { right: auto; left: 22px; align-items: flex-start; }
.arsyusha-launcher {
  pointer-events: auto;
  width: 72px;
  height: 72px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform .22s ease, filter .22s ease;
}
.arsyusha-launcher:hover { transform: translateY(-3px) scale(1.045); filter: brightness(1.06); }
.arsyusha-launcher:focus-visible { outline: 2px solid rgba(126, 108, 255, .72); outline-offset: 4px; border-radius: 18px; }
.arsyusha-launcher img { width: 70px; height: 70px; object-fit: contain; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .32)); }
.arsyusha-panel {
  pointer-events: auto;
  width: min(380px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 110px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--arsyusha-edge);
  border-radius: 26px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .035), transparent 18%), var(--arsyusha-bg);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  box-shadow: 0 28px 70px rgba(4, 8, 22, .48), inset 0 1px 0 rgba(255, 255, 255, .06);
  transform-origin: bottom right;
  animation: arsyusha-open .2s ease;
}
.left .arsyusha-panel { transform-origin: bottom left; }
@keyframes arsyusha-open { from { opacity: 0; transform: translateY(10px) scale(.97); } to { opacity: 1; transform: none; } }
.arsyusha-panel.hidden { display: none; }
.arsyusha-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 14px 13px;
  border-bottom: 1px solid var(--arsyusha-edge);
  background: linear-gradient(135deg, rgba(125, 108, 255, .12), rgba(74, 168, 255, .06));
}
.arsyusha-avatar { width: 42px; height: 42px; border-radius: 15px; background: var(--arsyusha-surface); display: grid; place-items: center; overflow: hidden; flex: none; }
.arsyusha-avatar img { width: 38px; height: 38px; object-fit: contain; }
.arsyusha-head-copy { min-width: 0; flex: 1; }
.arsyusha-head-copy strong { display: block; color: var(--arsyusha-text); font-size: 15px; }
.arsyusha-head-copy small { display: block; margin-top: 3px; color: var(--arsyusha-muted); font-size: 11px; }
.arsyusha-status { display: inline-flex; align-items: center; gap: 6px; }
.arsyusha-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #2bd56f; box-shadow: 0 0 10px rgba(43, 213, 111, .7); }
.arsyusha-head-actions { display: flex; gap: 5px; }
.arsyusha-icon-btn { width: 34px; height: 34px; border: 0; border-radius: 11px; background: transparent; color: var(--arsyusha-muted); cursor: pointer; display: grid; place-items: center; }
.arsyusha-icon-btn:hover { background: var(--arsyusha-surface); color: var(--arsyusha-text); }
.arsyusha-icon-btn svg { width: 17px; height: 17px; }
.arsyusha-messages { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 11px; scroll-behavior: smooth; }
.arsyusha-message { max-width: 90%; padding: 11px 13px; border-radius: 17px; color: var(--arsyusha-text); font-size: 13px; line-height: 1.55; overflow-wrap: anywhere; }
.arsyusha-message.assistant { align-self: flex-start; background: var(--arsyusha-surface); border: 1px solid var(--arsyusha-edge); border-bottom-left-radius: 6px; white-space: normal; }
.arsyusha-message.user { align-self: flex-end; background: linear-gradient(135deg, var(--arsyusha-accent), var(--arsyusha-accent-2)); color: #fff; border-bottom-right-radius: 6px; box-shadow: 0 10px 24px rgba(98, 104, 255, .2); }
.arsyusha-plain-text { white-space: normal; }
.arsyusha-message a { color: #87bbff; text-decoration: none; border-bottom: 1px dashed currentColor; }
[data-theme="light"] .arsyusha-message a { color: #325fd4; }
.arsyusha-time { display: block; margin-top: 7px; font-size: 9px; opacity: .55; }

.arsyusha-markdown { min-width: 0; }
.arsyusha-markdown > :first-child { margin-top: 0; }
.arsyusha-markdown > :last-child { margin-bottom: 0; }
.arsyusha-markdown p { margin: 0 0 9px; }
.arsyusha-markdown h3,
.arsyusha-markdown h4,
.arsyusha-markdown h5,
.arsyusha-markdown h6 { margin: 12px 0 7px; color: var(--arsyusha-text); line-height: 1.3; letter-spacing: -.015em; }
.arsyusha-markdown h3 { font-size: 16px; }
.arsyusha-markdown h4 { font-size: 15px; }
.arsyusha-markdown h5,
.arsyusha-markdown h6 { font-size: 14px; }
.arsyusha-markdown strong { color: var(--arsyusha-text); font-weight: 760; }
.arsyusha-markdown em { color: color-mix(in srgb, var(--arsyusha-text) 90%, var(--arsyusha-muted)); }
.arsyusha-markdown del { opacity: .7; }
.arsyusha-markdown ul,
.arsyusha-markdown ol { margin: 7px 0 10px; padding-left: 20px; }
.arsyusha-markdown li { margin: 4px 0; padding-left: 2px; }
.arsyusha-markdown blockquote { margin: 9px 0; padding: 9px 11px; border-left: 3px solid var(--arsyusha-accent); border-radius: 0 10px 10px 0; background: rgba(125, 108, 255, .09); color: color-mix(in srgb, var(--arsyusha-text) 84%, var(--arsyusha-muted)); }
.arsyusha-markdown hr { height: 1px; margin: 12px 0; border: 0; background: var(--arsyusha-edge); }
.arsyusha-markdown code { padding: 2px 5px; border: 1px solid var(--arsyusha-edge); border-radius: 6px; background: rgba(0, 0, 0, .18); color: #d9e7ff; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
[data-theme="light"] .arsyusha-markdown code { background: rgba(22, 31, 55, .07); color: #24365f; }
.arsyusha-markdown pre { position: relative; max-width: 100%; margin: 10px 0; padding: 12px; overflow: auto; border: 1px solid var(--arsyusha-edge); border-radius: 12px; background: rgba(4, 7, 16, .65); }
[data-theme="light"] .arsyusha-markdown pre { background: rgba(21, 28, 46, .06); }
.arsyusha-markdown pre[data-language]::before { content: attr(data-language); display: block; margin-bottom: 7px; color: var(--arsyusha-muted); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.arsyusha-markdown pre code { display: block; padding: 0; border: 0; background: transparent; color: inherit; white-space: pre; }
.arsyusha-markdown img { display: block; max-width: 100%; max-height: 190px; margin: 9px 0; border-radius: 12px; object-fit: contain; }
.arsyusha-table-wrap { max-width: 100%; margin: 10px 0; overflow: auto; border: 1px solid var(--arsyusha-edge); border-radius: 12px; }
.arsyusha-table-wrap table { width: 100%; min-width: 260px; border-collapse: collapse; font-size: 11.5px; }
.arsyusha-table-wrap th,
.arsyusha-table-wrap td { padding: 8px 9px; border-right: 1px solid var(--arsyusha-edge); border-bottom: 1px solid var(--arsyusha-edge); vertical-align: top; }
.arsyusha-table-wrap th:last-child,
.arsyusha-table-wrap td:last-child { border-right: 0; }
.arsyusha-table-wrap tbody tr:last-child td { border-bottom: 0; }
.arsyusha-table-wrap th { background: rgba(125, 108, 255, .1); color: var(--arsyusha-text); font-weight: 760; }
.arsyusha-markdown .task-item { display: flex; align-items: flex-start; gap: 8px; list-style: none; margin-left: -18px; }
.arsyusha-markdown .task-check { width: 14px; height: 14px; flex: none; margin-top: 3px; border: 1px solid var(--arsyusha-edge); border-radius: 4px; background: var(--arsyusha-surface); }
.arsyusha-markdown .task-item.checked .task-check { border-color: transparent; background: linear-gradient(135deg, var(--arsyusha-accent), var(--arsyusha-accent-2)); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .8); }

.arsyusha-suggestions { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 14px 12px; }
.arsyusha-suggestion { border: 1px solid var(--arsyusha-edge); border-radius: 999px; background: var(--arsyusha-surface); color: var(--arsyusha-text); padding: 8px 11px; font: inherit; font-size: 11px; line-height: 1.25; cursor: pointer; }
.arsyusha-suggestion:hover { border-color: rgba(125, 108, 255, .48); background: rgba(125, 108, 255, .12); }
.arsyusha-compose { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; padding: 12px; border-top: 1px solid var(--arsyusha-edge); background: rgba(0, 0, 0, .035); }
.arsyusha-input { min-height: 44px; max-height: 110px; resize: none; border: 1px solid var(--arsyusha-edge); border-radius: 15px; background: var(--arsyusha-surface); color: var(--arsyusha-text); padding: 11px 12px; font: inherit; font-size: 13px; outline: none; }
.arsyusha-input:focus { border-color: rgba(125, 108, 255, .62); box-shadow: 0 0 0 3px rgba(125, 108, 255, .12); }
.arsyusha-send { width: 44px; height: 44px; border: 0; border-radius: 15px; background: linear-gradient(135deg, var(--arsyusha-accent), var(--arsyusha-accent-2)); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 10px 24px rgba(98, 104, 255, .2); }
.arsyusha-send:disabled { opacity: .45; cursor: not-allowed; }
.arsyusha-send svg { width: 18px; height: 18px; }
.arsyusha-typing { display: inline-flex; gap: 4px; align-items: center; }
.arsyusha-typing i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .5; animation: arsyusha-dot 1s infinite; }
.arsyusha-typing i:nth-child(2) { animation-delay: .15s; }
.arsyusha-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes arsyusha-dot { 0%, 70%, 100% { transform: translateY(0); opacity: .35; } 35% { transform: translateY(-4px); opacity: 1; } }

@media (max-width: 560px) {
  .arsyusha-root { right: 12px; bottom: 12px; }
  .arsyusha-root.left { left: 12px; }
  .arsyusha-panel { width: calc(100vw - 24px); height: min(560px, calc(100vh - 94px)); border-radius: 22px; }
  .arsyusha-launcher { width: 58px; height: 58px; }
  .arsyusha-launcher img { width: 50px; height: 50px; }
}
