.cr-widget-root {
  --cr-bg: #ffffff;
  --cr-text: #111111;
  --cr-muted: #6f6f6a;
  --cr-border: #e4e4e0;
  --cr-accent: #111111;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
}

.cr-widget-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid var(--cr-border);
  border-radius: 999px;
  background: var(--cr-bg);
  color: var(--cr-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(17, 17, 17, 0.12);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.cr-widget-toggle:hover {
  box-shadow: 0 12px 40px rgba(17, 17, 17, 0.16);
  transform: translateY(-1px);
}

.cr-widget-toggle .cr-logo {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: var(--cr-accent);
  position: relative;
  flex-shrink: 0;
}

.cr-widget-toggle .cr-logo::after {
  content: "";
  position: absolute;
  inset: 6px 5px 5px 6px;
  border: 2px solid #fff;
  border-radius: 2px;
}

.cr-widget-panel {
  display: none;
  flex-direction: column;
  width: min(380px, calc(100vw - 40px));
  height: min(520px, calc(100vh - 100px));
  margin-bottom: 12px;
  border: 1px solid var(--cr-border);
  border-radius: 12px;
  background: var(--cr-bg);
  box-shadow: 0 16px 48px rgba(17, 17, 17, 0.14);
  overflow: hidden;
}

.cr-widget-root.open .cr-widget-panel {
  display: flex;
}

.cr-widget-root.open .cr-widget-toggle {
  display: none;
}

.cr-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--cr-border);
  background: #f6f6f4;
}

.cr-widget-header strong {
  font-size: 14px;
}

.cr-widget-header span {
  display: block;
  font-size: 11px;
  color: var(--cr-muted);
  font-weight: 500;
  margin-top: 2px;
}

.cr-widget-close {
  border: none;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--cr-muted);
  padding: 4px;
}

.cr-widget-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cr-msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
}

.cr-msg.bot {
  align-self: flex-start;
  background: #f6f6f4;
  border: 1px solid var(--cr-border);
  color: #4a4a46;
}

.cr-msg.user {
  align-self: flex-end;
  background: var(--cr-accent);
  color: #fff;
}

.cr-msg.typing {
  color: var(--cr-muted);
  font-style: italic;
}

.cr-widget-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 10px;
}

.cr-prompt {
  border: 1px solid var(--cr-border);
  background: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 11px;
  color: #4a4a46;
  cursor: pointer;
}

.cr-prompt:hover {
  border-color: #111;
}

.cr-widget-input {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--cr-border);
}

.cr-widget-input input {
  flex: 1;
  border: 1px solid var(--cr-border);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
}

.cr-widget-input input:focus {
  outline: 2px solid rgba(17, 17, 17, 0.15);
  border-color: #111;
}

.cr-widget-input button {
  border: none;
  border-radius: 8px;
  background: var(--cr-accent);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  padding: 0 14px;
  cursor: pointer;
}

.cr-widget-input button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.cr-widget-footer {
  padding: 8px 14px 10px;
  font-size: 10px;
  color: var(--cr-muted);
  text-align: center;
  border-top: 1px solid var(--cr-border);
}

.cr-widget-footer a {
  color: #1a4fd6;
  text-decoration: none;
  font-weight: 600;
}

@media (max-width: 480px) {
  .cr-widget-root {
    right: 12px;
    bottom: 12px;
  }
}