.anka-chat { z-index: 100; }
/* Desktop size comes from anka-chat.js as --anka-w/--anka-h (the page is zoomed). */
.anka-panel { box-sizing: border-box; position: relative; width: var(--anka-w, min(390px, calc(100vw - 24px))); }
.anka-panel[hidden] { display: none; }
.anka-head { position: relative; }
.anka-status { margin-right: 58px; }
.anka-close {
  position: absolute; right: 9px; top: 11px; width: 30px; height: 30px;
  border: 0; border-radius: 50%; background: transparent; color: #334155;
  font: inherit; font-size: 24px; line-height: 1; cursor: pointer;
}
.anka-close:hover, .anka-close:focus-visible { background: #e9effd; }
.anka-body { box-sizing: border-box; display: flex; flex-direction: column; gap: 12px; height: var(--anka-h, min(520px, calc(100dvh - 185px))); min-height: 0; }
.anka-messages { display: flex; flex: 1; flex-direction: column; gap: 10px; overflow-y: auto; padding: 2px; }
.anka-messages .anka-msg { max-width: 92%; white-space: pre-wrap; overflow-wrap: anywhere; }
.anka-msg-user { align-self: flex-end; color: #fff !important; background: #2563eb !important; border-color: #2563eb !important; border-radius: 14px 4px 14px 14px !important; }
.anka-waiting { opacity: .65; }
.anka-error { color: #9f1239 !important; background: #fff1f2 !important; border-color: #fecdd3 !important; }
.anka-form { display: flex; align-items: flex-end; gap: 8px; border-top: 1px solid #e4e8ed; padding-top: 12px; }
.anka-form textarea {
  box-sizing: border-box; flex: 1; min-width: 0; min-height: 42px; max-height: 120px;
  resize: none; overflow-y: auto; padding: 10px 11px; border: 1px solid #cfd6df; border-radius: 12px;
  background: #fff; color: #0a0f1a; font: inherit; font-size: 14px; line-height: 1.4;
}
.anka-form textarea:focus { outline: 2px solid #9db9f6; outline-offset: 1px; }
.anka-form button { min-height: 42px; padding: 0 14px; border: 0; border-radius: 12px; background: #2563eb; color: #fff; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.anka-form button:hover { background: #1f54c8; }
.anka-form button:disabled { opacity: .55; cursor: wait; }
.anka-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #667080; font-size: 11px; line-height: 1.35; }
.anka-new { border: 0; background: transparent; color: #1f54c8; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.anka-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.anka-form[hidden], .anka-gate[hidden], .anka-who[hidden] { display: none; }
.anka-max {
  position: absolute; right: 42px; top: 11px; width: 30px; height: 30px;
  border: 0; border-radius: 50%; background: transparent; color: #334155;
  font: inherit; font-size: 17px; line-height: 1; cursor: pointer;
}
.anka-max:hover, .anka-max:focus-visible { background: #e9effd; }
.anka-resize { position: absolute; z-index: 3; pointer-events: none; }
.anka-resize-left { left: 0; top: 14px; bottom: 14px; width: 5px; }
.anka-resize-top { top: 0; left: 14px; right: 14px; height: 5px; }
.anka-resize-corner { left: 0; top: 0; width: 22px; height: 22px; }
.anka-resize-corner::after {
  content: ""; position: absolute; left: 8px; top: 8px; width: 9px; height: 9px;
  border-left: 2px solid #94a3b8; border-top: 2px solid #94a3b8; border-top-left-radius: 4px; opacity: .6;
}
.anka-near-corner .anka-resize-corner::after, .anka-dragging-corner .anka-resize-corner::after { opacity: 1; border-color: #2563eb; }
.anka-near-left .anka-resize-left, .anka-near-top .anka-resize-top, .anka-dragging-left .anka-resize-left, .anka-dragging-top .anka-resize-top { background: #2563eb; opacity: .55; border-radius: 3px; }
html.anka-dragging, html.anka-dragging * { user-select: none !important; -webkit-user-select: none !important; }
html.anka-near-left, html.anka-near-left *, html.anka-dragging-left, html.anka-dragging-left * { cursor: ew-resize !important; }
html.anka-near-top, html.anka-near-top *, html.anka-dragging-top, html.anka-dragging-top * { cursor: ns-resize !important; }
html.anka-near-corner, html.anka-near-corner *, html.anka-dragging-corner, html.anka-dragging-corner * { cursor: nwse-resize !important; }
html.anka-dragging .anka-panel { animation: none !important; }
.anka-maximized .anka-messages .anka-msg { max-width: 80%; }
.anka-gate { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid #e4e8ed; padding-top: 12px; color: #334155; font-size: 13px; line-height: 1.4; }
.anka-gate label { color: #0a0f1a; font-weight: 700; font-size: 14px; }
.anka-gate p { margin: 0; }
.anka-gate-row { display: flex; gap: 8px; }
.anka-gate input {
  box-sizing: border-box; flex: 1; min-width: 0; min-height: 42px; padding: 0 11px;
  border: 1px solid #cfd6df; border-radius: 12px; background: #fff; color: #0a0f1a; font: inherit; font-size: 14px;
}
.anka-gate input:focus { outline: 2px solid #9db9f6; outline-offset: 1px; }
.anka-gate button { min-height: 42px; padding: 0 14px; border: 0; border-radius: 12px; background: #2563eb; color: #fff; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.anka-gate button:hover { background: #1f54c8; }
.anka-gate small { color: #667080; font-size: 11px; }
.anka-gate .anka-gate-error { color: #9f1239; }
.anka-gate .anka-gate-error:empty { display: none; }
.anka-gate a { color: #1f54c8; }
.anka-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.anka-change { border: 0; padding: 0; background: transparent; color: #1f54c8; font: inherit; cursor: pointer; }
@media (max-width: 640px) {
  .anka-resize { display: none; }
  .anka-chat { right: 12px; bottom: 12px; }
  .anka-body { height: min(520px, calc(100dvh - 165px)); max-height: calc(100dvh - 165px); }
}
