/* ARBI.RU — нижняя контекстная ИИ-панель. */
.ai-dock {
  position: fixed;
  z-index: 11000;
  right: 18px;
  bottom: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  max-width: calc(100vw - 36px);
}
.ai-dock__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--graphite-900);
  border-radius: 999px;
  background: var(--graphite-900);
  color: #fff;
  font: inherit;
  font-size: var(--step-14);
  font-weight: 640;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(19, 23, 14, .18);
  transition: transform .18s ease, background-color .18s ease;
}
.ai-dock__toggle:hover { transform: translateY(-2px); background: var(--graphite-800); }
.ai-dock__spark { color: var(--lime-500); font-size: 18px; line-height: 1; }
.ai-dock__panel {
  width: min(440px, calc(100vw - 36px));
  max-height: min(660px, calc(100vh - 90px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line-300);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(19, 23, 14, .22);
}
.ai-dock__panel[hidden] { display: none; }
.ai-dock__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line-200);
  background: var(--paper-warm);
}
.ai-dock__head b { font-size: var(--step-14); }
.ai-dock__head p { margin: 4px 0 0; color: var(--graphite-500); font-size: var(--step-12); max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-dock__close {
  width: 32px; height: 32px; flex: 0 0 auto; border: 0; border-radius: 50%;
  background: var(--paper); color: var(--graphite-700); cursor: pointer;
}
.ai-dock__messages {
  flex: 1 1 auto;
  overflow: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: var(--step-14);
  line-height: 1.5;
}
.ai-dock__hint { margin: 0; color: var(--graphite-500); font-size: var(--step-13); }
.ai-dock__msg { max-width: 92%; padding: 10px 12px; border-radius: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.ai-dock__msg--user { align-self: flex-end; background: var(--lime-050); border: 1px solid var(--lime-200); }
.ai-dock__msg--bot { align-self: flex-start; background: var(--paper-warm); border: 1px solid var(--line-200); }
.ai-dock__msg--error { align-self: stretch; color: var(--danger-700); background: var(--danger-050); border-color: var(--danger-200); }
.ai-dock__msg a { color: var(--graphite-900); text-decoration: underline; text-decoration-color: var(--lime-500); }
.ai-dock__loading { color: var(--graphite-500); font-size: var(--step-13); }
.ai-dock__form { padding: 10px 12px 8px; border-top: 1px solid var(--line-200); background: var(--paper); }
.ai-dock__form textarea {
  width: 100%; resize: vertical; min-height: 48px; max-height: 140px;
  padding: 9px 10px; border: 1px solid var(--line-300); border-radius: 10px;
  font: inherit; font-size: var(--step-14); background: var(--paper);
}
.ai-dock__form textarea:focus { outline: 2px solid var(--lime-500); outline-offset: 1px; border-color: var(--graphite-900); }
.ai-dock__row { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.ai-dock__attach {
  border: 1px solid var(--line-300); background: var(--paper); color: var(--graphite-700);
  border-radius: 8px; padding: 5px 9px; font: inherit; font-size: var(--step-12); cursor: pointer;
}
.ai-dock__file { min-width: 0; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--graphite-500); font-size: var(--step-12); }
.ai-dock__row .btn { margin-left: auto; }
.ai-dock__tools { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 12px 12px; }
.ai-dock__tools button, .ai-dock__tools a {
  border: 1px solid var(--line-200); background: var(--paper-warm); color: var(--graphite-700);
  border-radius: 999px; padding: 4px 9px; font: inherit; font-size: var(--step-12); text-decoration: none; cursor: pointer;
}
.ai-dock__tools button:hover, .ai-dock__tools a:hover { border-color: var(--lime-500); color: var(--graphite-900); }
.ai-dock__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; font-size: var(--step-13); }
.ai-dock__actions a { color: var(--graphite-900); }
@media (max-width: 640px) {
  .ai-dock { right: 10px; bottom: 10px; max-width: calc(100vw - 20px); }
  .ai-dock__panel { width: calc(100vw - 20px); max-height: min(76vh, 620px); }
  .ai-dock__toggle { padding: 0 12px; font-size: var(--step-13); }
}
@media (prefers-reduced-motion: reduce) {
  .ai-dock__toggle { transition: none; }
}
