#assistant-alert-host {
  position: fixed;
  top: 58px;
  right: 16px;
  z-index: 12010;
  pointer-events: none;
}

.assistant-alert-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 260px;
  max-width: min(420px, calc(100vw - 24px));
  border: 0;
  border-left: 4px solid #1fbf7f;
  border-radius: 10px;
  background: #111218;
  color: #f6f2df;
  padding: 10px 12px;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  transform: translateY(-18px);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
  pointer-events: auto;
  text-align: left;
}

.assistant-alert-card.active {
  transform: translateY(0);
  opacity: 1;
}

.assistant-alert-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  margin-top: 2px;
}

.assistant-alert-body strong {
  display: block;
  font-size: 13px;
  line-height: 1.25;
}

.assistant-alert-body small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.25;
  opacity: 0.92;
}

.assistant-alert-warning {
  border-left-color: #e2b93f;
}

.assistant-alert-critical {
  border-left-color: #d94a4a;
}

.assistant-alert-positive {
  border-left-color: #2fca91;
}

.assistant-panel {
  position: fixed;
  right: 14px;
  bottom: 14px;
  width: min(420px, calc(100vw - 20px));
  height: min(68vh, 560px);
  min-width: 320px;
  max-width: min(560px, calc(100vw - 16px));
  min-height: 320px;
  max-height: min(80vh, 760px);
  border-radius: 14px;
  border: 1px solid rgba(232, 196, 81, 0.32);
  background: rgba(12, 13, 16, 0.95);
  color: #f6f2df;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.38);
  z-index: 12000;
  display: none;
  overflow: hidden;
}

.assistant-panel.active {
  display: flex;
  flex-direction: column;
}

.assistant-panel.assistant-panel-dragging {
  box-shadow: 0 22px 42px rgba(0, 0, 0, 0.48);
}

.assistant-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(232, 196, 81, 0.2);
  cursor: move;
  user-select: none;
}

.assistant-head-actions {
  display: inline-flex;
  gap: 8px;
}

.assistant-head h3 {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.4px;
}

#assistant-close-btn {
  border: 1px solid rgba(232, 196, 81, 0.45);
  background: transparent;
  color: #f6f2df;
  min-height: 32px;
  min-width: 32px;
  border-radius: 8px;
  cursor: pointer;
}

#assistant-billing-btn {
  border: 1px solid rgba(232, 196, 81, 0.45);
  background: rgba(232, 196, 81, 0.14);
  color: #f6f2df;
  min-height: 32px;
  border-radius: 8px;
  cursor: pointer;
  padding: 0 10px;
}

.assistant-meta {
  font-size: 12px;
  opacity: 0.92;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(232, 196, 81, 0.15);
}

.assistant-command-support {
  padding: 8px 12px;
  border-bottom: 1px solid rgba(232, 196, 81, 0.15);
  background: rgba(232, 196, 81, 0.06);
}

.assistant-command-support.hidden {
  display: none;
}

.assistant-command-support-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

#assistant-command-support-close {
  border: 1px solid rgba(232, 196, 81, 0.45);
  background: transparent;
  color: #f6f2df;
  border-radius: 6px;
  min-height: 26px;
  min-width: 26px;
  cursor: pointer;
}

#assistant-command-support-content {
  margin: 0;
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.35;
  color: #efe7c5;
}

.assistant-chat-log {
  flex: 1;
  overflow: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.assistant-msg {
  border-radius: 12px;
  padding: 9px 10px;
  font-size: 13px;
  line-height: 1.4;
  border: 1px solid rgba(232, 196, 81, 0.16);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.assistant-msg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.assistant-msg-role {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.assistant-msg-time {
  font-size: 11px;
  opacity: 0.7;
}

.assistant-msg-body {
  white-space: normal;
}

.assistant-msg-line {
  margin: 0;
}

.assistant-msg-line + .assistant-msg-line {
  margin-top: 5px;
}

.assistant-msg-spacer {
  height: 6px;
}

.assistant-msg-list {
  margin: 0;
  padding-left: 18px;
}

.assistant-msg-list + .assistant-msg-list,
.assistant-msg-line + .assistant-msg-list,
.assistant-msg-list + .assistant-msg-line {
  margin-top: 6px;
}

.assistant-msg-list li + li {
  margin-top: 4px;
}

.assistant-msg-kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
}

.assistant-msg-kv + .assistant-msg-kv,
.assistant-msg-line + .assistant-msg-kv,
.assistant-msg-kv + .assistant-msg-line,
.assistant-msg-list + .assistant-msg-kv,
.assistant-msg-kv + .assistant-msg-list {
  margin-top: 6px;
}

.assistant-msg-kv strong {
  color: #f1d27f;
  font-weight: 700;
}

.assistant-msg-user {
  background: linear-gradient(180deg, rgba(232, 196, 81, 0.2), rgba(232, 196, 81, 0.14));
  align-self: flex-end;
  max-width: 90%;
}

.assistant-msg-assistant {
  background: linear-gradient(180deg, rgba(214, 172, 72, 0.17), rgba(214, 172, 72, 0.1));
  align-self: stretch;
}

.assistant-msg-system {
  background: linear-gradient(180deg, rgba(255, 147, 78, 0.16), rgba(255, 147, 78, 0.09));
  align-self: stretch;
}

.assistant-msg-user .assistant-msg-role {
  background: rgba(232, 196, 81, 0.26);
  color: #f6efcf;
}

.assistant-msg-assistant .assistant-msg-role {
  background: rgba(86, 198, 138, 0.24);
  color: #d5f6df;
}

.assistant-msg-system .assistant-msg-role {
  background: rgba(255, 147, 78, 0.26);
  color: #ffe4cc;
}

.assistant-input-wrap {
  padding: 10px 12px 12px;
  border-top: 1px solid rgba(232, 196, 81, 0.2);
}

.assistant-resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 20px;
  height: 20px;
  border: 0;
  background: linear-gradient(135deg, transparent 0 46%, rgba(232, 196, 81, 0.7) 47% 53%, transparent 54% 100%);
  cursor: nwse-resize;
  padding: 0;
}

.assistant-resize-handle::before {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 10px;
  height: 10px;
  border-right: 2px solid rgba(232, 196, 81, 0.75);
  border-bottom: 2px solid rgba(232, 196, 81, 0.75);
}

#assistant-input {
  width: 100%;
  min-height: 66px;
  max-height: 120px;
  resize: vertical;
  border-radius: 10px;
  border: 1px solid rgba(232, 196, 81, 0.35);
  background: rgba(10, 11, 14, 0.9);
  color: #f6f2df;
  padding: 8px 10px;
  box-sizing: border-box;
}

.assistant-input-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

#assistant-char-count {
  font-size: 12px;
  opacity: 0.85;
}

#assistant-send-btn {
  min-height: 36px;
  min-width: 84px;
  border: 0;
  border-radius: 8px;
  background: #e2b93f;
  color: #16120a;
  font-weight: 700;
  cursor: pointer;
}

#assistant-quick-btn {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(232, 196, 81, 0.5);
  background: rgba(19, 20, 24, 0.94);
  color: #f4df9c;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  z-index: 11990;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35);
}

.assistant-quick-panel {
  position: fixed;
  right: 18px;
  bottom: 68px;
  width: min(280px, calc(100vw - 24px));
  border-radius: 12px;
  border: 1px solid rgba(232, 196, 81, 0.32);
  background: rgba(12, 13, 16, 0.96);
  color: #f6f2df;
  z-index: 11995;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  padding: 10px;
}

.assistant-quick-panel.hidden {
  display: none;
}

.assistant-quick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

#assistant-quick-close {
  border: 1px solid rgba(232, 196, 81, 0.45);
  background: transparent;
  color: #f6f2df;
  border-radius: 6px;
  min-height: 28px;
  min-width: 28px;
  cursor: pointer;
}

.assistant-quick-list {
  display: grid;
  gap: 6px;
}

.assistant-quick-option {
  border: 1px solid rgba(232, 196, 81, 0.34);
  background: rgba(232, 196, 81, 0.08);
  color: #f6f2df;
  border-radius: 8px;
  min-height: 36px;
  text-align: left;
  padding: 0 10px;
  cursor: pointer;
}

.assistant-billing-modal {
  position: fixed;
  inset: 0;
  z-index: 12040;
  background: rgba(8, 10, 16, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.assistant-billing-modal.hidden {
  display: none;
}

.assistant-billing-card {
  width: min(420px, 100%);
  border-radius: 12px;
  border: 1px solid rgba(232, 196, 81, 0.45);
  background: rgba(12, 14, 20, 0.96);
  color: #f6f2df;
  padding: 14px;
}

.assistant-billing-card h3 {
  margin: 0 0 10px;
}

.assistant-billing-card p {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.4;
}

#assistant-billing-pay {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: #e2b93f;
  color: #16120a;
  font-weight: 700;
  padding: 0 14px;
  cursor: pointer;
}

.assistant-billing-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

#assistant-billing-cancel {
  min-height: 38px;
  border: 1px solid rgba(232, 196, 81, 0.4);
  border-radius: 8px;
  background: transparent;
  color: #f6f2df;
  padding: 0 14px;
  cursor: pointer;
}

@media (max-width: 900px) {
  #assistant-alert-host {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    top: 62px;
  }

  .assistant-panel {
    left: 10px;
    right: 10px;
    width: auto;
    bottom: 10px;
    height: min(70vh, 560px);
    min-height: 280px;
    max-height: 76vh;
  }

  .assistant-resize-handle {
    display: none;
  }

  #assistant-quick-btn {
    right: 12px;
    bottom: 12px;
  }

  .assistant-quick-panel {
    right: 10px;
    left: 10px;
    width: auto;
    bottom: 60px;
  }
}

body[data-visual="minimal"] .assistant-panel,
body[data-visual="minimal"] .assistant-alert-card,
body[data-visual="minimal"] .assistant-quick-panel {
  transition: none !important;
  backdrop-filter: none !important;
}
