:root {
  --vokky-bg: #0f172a;
  --vokky-panel: #ffffff;
  --vokky-border: #e5e7eb;
  --vokky-muted: #64748b;
  --vokky-text: #0f172a;
  --vokky-soft: #f8fafc;
  --vokky-brand: #1d4ed8;
  --vokky-brand-2: #eff6ff;
  --vokky-user: #111827;
  --vokky-user-text: #ffffff;
  --vokky-shadow: 0 22px 60px rgba(15, 23, 42, 0.18);
}

.vokky-launcher,
.vokky-chat,
.vokky-chat * {
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}

.vokky-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--vokky-bg);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--vokky-shadow);
  z-index: 9997;
}

.launcher-dot,
.vokky-online-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #22c55e;
}

.launcher-text {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.vokky-chat {
  position: fixed;
  right: 22px;
  bottom: 88px;
  width: min(430px, calc(100vw - 24px));
  height: min(740px, calc(100dvh - 110px));
  max-height: calc(100dvh - 110px);
  display: none;
  flex-direction: column;
  background: var(--vokky-panel);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--vokky-shadow);
  z-index: 9998;
}

.vokky-chat.is-open {
  display: flex;
}


html[dir="rtl"] .vokky-chat,
html[dir="rtl"] .vokky-launcher {
  direction: rtl;
}

#vokky-chat,
.vokky-chat {
  margin: 0 !important;
  padding: 0 !important;
  min-height: 0;
  line-height: normal;
  isolation: isolate;
}

#vokky-chat > *,
.vokky-chat > * {
  margin: 0 !important;
}

.vokky-header,
.vokky-actions,
.vokky-input-wrap {
  flex: 0 0 auto;
}

.vokky-messages {
  min-height: 0;
  flex: 1 1 auto;
  overscroll-behavior: contain;
}

.vokky-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #0f172a 0%, #1d4ed8 100%);
  color: #fff;
}

.vokky-header-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.vokky-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vokky-header-text strong {
  font-size: 16px;
}

.vokky-header-text span {
  font-size: 12px;
  opacity: 0.95;
}

.vokky-header-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vokky-clear,
.vokky-close {
  border: 0;
  cursor: pointer;
}

.vokky-clear {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
}

.vokky-close {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  font-size: 24px;
  line-height: 1;
}

.vokky-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px 12px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  scroll-behavior: smooth;
}

.message {
  display: flex;
  margin-bottom: 12px;
}

.message-bubble {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 18px;
  line-height: 1.45;
  font-size: 14px;
  white-space: normal;
  word-break: break-word;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
}

.message--bot {
  justify-content: flex-start;
}

.message--bot .message-bubble {
  background: #fff;
  color: var(--vokky-text);
  border: 1px solid var(--vokky-border);
  border-top-left-radius: 8px;
}

.message--user {
  justify-content: flex-end;
}

.message--user .message-bubble {
  background: var(--vokky-user);
  color: var(--vokky-user-text);
  border-top-right-radius: 8px;
}

.message--typing .message-bubble {
  color: var(--vokky-muted);
  background: var(--vokky-soft);
}

.message-bubble strong {
  font-weight: 700;
}

.message-bubble a {
  color: var(--vokky-brand);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}

.vokky-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px 4px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  background: #fff;
}

.vokky-actions[hidden] {
  display: none;
}

.vokky-action-btn {
  border: 1px solid #60a5fa;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  color: #1e3a8a;
  padding: 10px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(29, 78, 216, 0.14);
}

.vokky-action-btn:hover {
  background: linear-gradient(180deg, #dbeafe 0%, #bfdbfe 100%);
  border-color: #3b82f6;
}

.vokky-action-btn:disabled {
  opacity: 0.6;
}


.vokky-input-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  background: #fff;
}

.vokky-input {
  resize: none;
  min-height: 46px;
  max-height: 132px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  color: var(--vokky-text);
  background: #fff;
}

.vokky-input:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.18);
}

.vokky-send {
  min-width: 108px;
  height: 46px;
  border: 0;
  border-radius: 14px;
  background: var(--vokky-brand);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.vokky-send:disabled,
.vokky-action-btn:disabled,
.vokky-clear:disabled {
  opacity: 0.65;
  cursor: default;
}

@media (max-width: 640px) {
  .vokky-launcher {
    right: 14px;
    bottom: 14px;
  }

  .vokky-chat {
    right: 12px;
    left: 12px;
    width: auto;
    bottom: 72px;
    height: calc(100dvh - 96px);
    max-height: calc(100dvh - 96px);
    border-radius: 18px;
  }

  .vokky-header {
    align-items: flex-start;
  }

  .vokky-header-tools {
    flex-direction: column;
    align-items: stretch;
  }

  .vokky-clear {
    font-size: 11px;
  }
}

.vokky-card-host {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 14px 8px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
  background: #fff;
}

.vokky-card-host[hidden] {
  display: none;
}

.vokky-card {
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid #dbeafe;
  background: #f8fbff;
  border-radius: 16px;
  padding: 12px;
}

.vokky-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}

.vokky-card-desc {
  font-size: 12px;
  color: #475569;
  margin-bottom: 10px;
}

.vokky-card-field {
  display: block;
  margin-bottom: 10px;
}

.vokky-card-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 6px;
}

.vokky-card-required { color: #b91c1c; }

.vokky-card-field input,
.vokky-card-field textarea,
.vokky-card-field select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  color: #0f172a;
  background: #fff;
}

.vokky-card-field textarea {
  resize: vertical;
  min-height: 80px;
}

.vokky-card-helper {
  display: block;
  font-size: 11px;
  color: #64748b;
  margin-bottom: 6px;
}

.vokky-card-options {
  display: grid;
  gap: 8px;
}

.vokky-card-option {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: start;
  column-gap: 8px;
  font-size: 13px;
  color: #0f172a;
}

.vokky-card-option input { margin-top: 2px; width: 16px; height: 16px; }

.vokky-card-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.vokky-card-primary,
.vokky-card-secondary {
  border: 0;
  border-radius: 999px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.vokky-card-primary {
  background: #1d4ed8;
  color: #fff;
}

.vokky-card-secondary {
  background: #e2e8f0;
  color: #0f172a;
}

.vokky-card-preview {
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  font-size: 13px;
  line-height: 1.45;
  color: #0f172a;
}

.vokky-card-error {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 12px;
  line-height: 1.4;
}


.vokky-card-topic-buttons .vokky-card-secondary {
  width: 100%;
  text-align: left;
}


.vokky-card-top-actions{display:flex;justify-content:flex-start;margin:-4px 0 8px 0;}
.vokky-card-top-actions .vokky-card-secondary{padding:6px 10px;font-size:12px;}


.vokky-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.vokky-card-title-row .vokky-card-title {
  margin-bottom: 0;
}

.vokky-card-topic-change {
  white-space: nowrap;
  flex: 0 0 auto;
}
