.fxinek-chat,
.fxinek-panel {
  --fxinek-accent: var(--wp--preset--color--primary, #2563eb);
  --fxinek-accent-2: var(--wp--preset--color--secondary, var(--fxinek-accent));
  --fxinek-accent-text: var(--wp--preset--color--contrast, #ffffff);
  --fxinek-accent-gradient: linear-gradient(135deg, var(--fxinek-accent) 0%, var(--fxinek-accent-2) 100%);
  --fxinek-bg: #ffffff;
  --fxinek-border: #e1e5ea;
  --fxinek-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --fxinek-header-bg: linear-gradient(135deg, #f5f7fb 0%, #e8edf5 100%);
  --fxinek-header-text: #27304d;
  --fxinek-surface: #f9fafc;
  --fxinek-user-bg: #27304d;
  --fxinek-user-text: #ffffff;
  --fxinek-bot-bg: #ffffff;
  --fxinek-bot-text: #1f2a44;
  --fxinek-bot-border: #e5e9f2;
  --fxinek-choice-bg: #ffffff;
  --fxinek-choice-text: #27304d;
  --fxinek-choice-border: #d8deea;
  --fxinek-input-bg: #ffffff;
  --fxinek-input-text: #1f2a44;
  --fxinek-input-border: #d8deea;
  --fxinek-send-bg: #27304d;
  --fxinek-send-text: #ffffff;
  --fxinek-send-hover: #1b2237;
  --fxinek-muted: #5b657d;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "Noto Sans", "Liberation Sans", sans-serif;
}

html[data-theme="dark"] .fxinek-chat,
html[data-theme="dark"] .fxinek-panel,
html[data-color-scheme="dark"] .fxinek-chat,
html[data-color-scheme="dark"] .fxinek-panel,
body[data-theme="dark"] .fxinek-chat,
body[data-theme="dark"] .fxinek-panel,
body[data-color-scheme="dark"] .fxinek-chat,
body[data-color-scheme="dark"] .fxinek-panel,
html.dark .fxinek-chat,
html.dark .fxinek-panel,
body.dark .fxinek-chat,
body.dark .fxinek-panel,
html.theme-dark .fxinek-chat,
html.theme-dark .fxinek-panel,
body.theme-dark .fxinek-chat,
body.theme-dark .fxinek-panel,
html.dark-mode .fxinek-chat,
html.dark-mode .fxinek-panel,
body.dark-mode .fxinek-chat,
body.dark-mode .fxinek-panel,
html.is-dark .fxinek-chat,
html.is-dark .fxinek-panel,
body.is-dark .fxinek-chat,
body.is-dark .fxinek-panel,
html.mode-dark .fxinek-chat,
html.mode-dark .fxinek-panel,
body.mode-dark .fxinek-chat,
body.mode-dark .fxinek-panel {
  --fxinek-bg: #0f172a;
  --fxinek-border: #1f2a44;
  --fxinek-shadow: 0 18px 36px rgba(2, 6, 23, 0.35);
  --fxinek-header-bg: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  --fxinek-header-text: #e5e7eb;
  --fxinek-surface: #111827;
  --fxinek-user-bg: #2563eb;
  --fxinek-user-text: #eff6ff;
  --fxinek-bot-bg: #0b1220;
  --fxinek-bot-text: #e5e7eb;
  --fxinek-bot-border: #1f2a44;
  --fxinek-choice-bg: #0f172a;
  --fxinek-choice-text: #e5e7eb;
  --fxinek-choice-border: #1f2a44;
  --fxinek-input-bg: #0b1220;
  --fxinek-input-text: #e5e7eb;
  --fxinek-input-border: #1f2a44;
  --fxinek-send-bg: #2563eb;
  --fxinek-send-text: #eff6ff;
  --fxinek-send-hover: #1d4ed8;
  --fxinek-muted: #9ca3af;
}

@media (prefers-color-scheme: dark) {
  .fxinek-chat,
  .fxinek-panel {
    --fxinek-bg: #0f172a;
    --fxinek-border: #1f2a44;
    --fxinek-shadow: 0 18px 36px rgba(2, 6, 23, 0.35);
    --fxinek-header-bg: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    --fxinek-header-text: #e5e7eb;
    --fxinek-surface: #111827;
    --fxinek-user-bg: #2563eb;
    --fxinek-user-text: #eff6ff;
    --fxinek-bot-bg: #0b1220;
    --fxinek-bot-text: #e5e7eb;
    --fxinek-bot-border: #1f2a44;
    --fxinek-choice-bg: #0f172a;
    --fxinek-choice-text: #e5e7eb;
    --fxinek-choice-border: #1f2a44;
    --fxinek-input-bg: #0b1220;
    --fxinek-input-text: #e5e7eb;
    --fxinek-input-border: #1f2a44;
    --fxinek-send-bg: #2563eb;
    --fxinek-send-text: #eff6ff;
    --fxinek-send-hover: #1d4ed8;
    --fxinek-muted: #9ca3af;
  }
}

.fxinek-chat {
  max-width: 520px;
  border: 1px solid var(--fxinek-border);
  border-radius: 12px;
  background: var(--fxinek-bg);
  box-shadow: var(--fxinek-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fxinek-chat__header {
  padding: 14px 16px;
  background: var(--fxinek-header-bg);
  font-weight: 700;
  font-size: 18px;
  color: var(--fxinek-header-text);
}

.fxinek-chat__messages {
  padding: 16px;
  min-height: 220px;
  max-height: 340px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--fxinek-surface);
}

.fxinek-chat__message {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  max-width: 85%;
}

.fxinek-chat__message--user {
  align-self: flex-end;
  background: var(--fxinek-user-bg);
  color: var(--fxinek-user-text);
}

.fxinek-chat__message--bot {
  align-self: flex-start;
  background: var(--fxinek-bot-bg);
  color: var(--fxinek-bot-text);
  border: 1px solid var(--fxinek-bot-border);
}

.fxinek-chat__choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 12px 16px;
  background: var(--fxinek-surface);
}

.fxinek-chat__choice {
  border: 1px solid var(--fxinek-choice-border);
  background: var(--fxinek-choice-bg);
  color: var(--fxinek-choice-text);
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.fxinek-chat__choice:hover {
  border-color: var(--fxinek-choice-text);
  color: var(--fxinek-choice-text);
}

.fxinek-chat__input {
  display: flex;
  gap: 8px;
  padding: 12px 16px 16px 16px;
  border-top: 1px solid var(--fxinek-border);
  background: var(--fxinek-input-bg);
}

.fxinek-chat__text {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--fxinek-input-border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--fxinek-input-text);
  background: var(--fxinek-input-bg);
}

.fxinek-chat__send {
  border: none;
  background: var(--fxinek-send-bg);
  color: var(--fxinek-send-text);
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.fxinek-chat__send:hover {
  background: var(--fxinek-send-hover);
}

.fxinek-panel {
  border: 1px solid var(--fxinek-border);
  border-radius: 14px;
  background: var(--fxinek-bg);
  box-shadow: var(--fxinek-shadow);
  overflow: hidden;
}

.fxinek-panel__header {
  padding: 14px 18px;
  font-weight: 700;
  font-size: 18px;
  color: var(--fxinek-header-text);
  background: var(--fxinek-header-bg);
}

.fxinek-panel__layout {
  padding: 16px 18px 22px 18px;
  background: var(--fxinek-surface);
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: 18px;
}

.fxinek-panel__menu {
  border: 1px solid var(--fxinek-border);
  background: var(--fxinek-bg);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 420px;
}

.fxinek-panel__menu-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--fxinek-header-text);
}

.fxinek-panel__menu-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: auto;
  max-height: 520px;
}

.fxinek-panel__menu-item {
  text-align: left;
  border: 1px solid var(--fxinek-border);
  background: var(--fxinek-surface);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fxinek-panel__menu-item:hover {
  border-color: var(--fxinek-choice-text);
}

.fxinek-panel__menu-item.is-active {
  border-color: var(--fxinek-send-bg);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.15);
}

.fxinek-panel__menu-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--fxinek-muted);
}

.fxinek-panel__menu-refresh {
  border: 1px solid var(--fxinek-border);
  background: var(--fxinek-bg);
  color: var(--fxinek-header-text);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}

.fxinek-panel__menu-empty,
.fxinek-panel__history-empty {
  font-size: 14px;
  color: var(--fxinek-muted);
  padding: 14px;
  border: 1px dashed var(--fxinek-border);
  border-radius: 10px;
  background: var(--fxinek-bg);
}

.fxinek-panel__content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fxinek-panel__chat .fxinek-chat {
  max-width: 100%;
}

.fxinek-panel__history {
  border: 1px solid var(--fxinek-border);
  background: var(--fxinek-bg);
  border-radius: 12px;
  padding: 12px 14px;
}

.fxinek-panel__history-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.fxinek-panel__history-title {
  font-weight: 700;
  color: var(--fxinek-header-text);
}

.fxinek-panel__history-delete {
  border: 1px solid var(--fxinek-border);
  background: var(--fxinek-bg);
  color: var(--fxinek-header-text);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}

.fxinek-panel__history-delete:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.fxinek-panel__history-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 420px;
  overflow: auto;
}

.fxinek-panel__message {
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  max-width: 92%;
}

.fxinek-panel__message--user {
  align-self: flex-end;
  background: var(--fxinek-user-bg);
  color: var(--fxinek-user-text);
}

.fxinek-panel__message--bot {
  align-self: flex-start;
  background: var(--fxinek-bot-bg);
  color: var(--fxinek-bot-text);
  border: 1px solid var(--fxinek-bot-border);
}

@media (max-width: 600px) {
  .fxinek-chat {
    max-width: 100%;
  }

  .fxinek-chat__messages {
    max-height: 280px;
  }

  .fxinek-panel__layout {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .fxinek-panel__menu {
    min-height: auto;
  }

  .fxinek-panel__menu-list {
    max-height: 240px;
  }

  .fxinek-panel__history-body {
    max-height: 300px;
  }
}
