:root {
  --oc-bg: #ffffff;
  --oc-text: #1f2937;
  --oc-muted: #6b7280;
  --oc-accent: #2563eb;
  --oc-accent-hover: #1d4ed8;
  --oc-user-bg: #2563eb;
  --oc-user-text: #fff;
  --oc-bot-bg: #f3f4f6;
  --oc-border: #e5e7eb;
}

#ollama-chatbot-root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Launcher is pinned bottom-right but offset upward to sit above the reCAPTCHA badge.
   On this site the reCAPTCHA badge is ~70px tall and sits at bottom: 0.
   The CSS variables make it easy to adjust per theme/page later. */
:root {
  --oc-launcher-bottom: 90px;
  --oc-launcher-right: auto;
  --oc-launcher-left: 20px;
  --oc-window-bottom: calc(var(--oc-launcher-bottom) + 70px);
  --oc-window-right: auto;
  --oc-window-left: var(--oc-launcher-left);
}

.ollama-launcher {
  position: fixed;
  bottom: var(--oc-launcher-bottom);
  left: var(--oc-launcher-left);
  right: var(--oc-launcher-right);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--oc-accent);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-size: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ollama-launcher:hover {
  background: var(--oc-accent-hover);
}

.ollama-window {
  position: fixed;
  bottom: var(--oc-window-bottom);
  left: var(--oc-window-left);
  right: var(--oc-window-right);
  width: 360px;
  max-width: calc(100vw - 40px);
  height: 500px;
  background: var(--oc-bg);
  border: 1px solid var(--oc-border);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  overflow: hidden;
}

.ollama-header {
  background: var(--oc-accent);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ollama-header-title {
  font-weight: 600;
  font-size: 15px;
}

.ollama-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

.ollama-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ollama-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.ollama-msg.user {
  align-self: flex-end;
  background: var(--oc-user-bg);
  color: var(--oc-user-text);
  border-bottom-right-radius: 4px;
}

.ollama-msg.bot {
  align-self: flex-start;
  background: var(--oc-bot-bg);
  color: var(--oc-text);
  border-bottom-left-radius: 4px;
}

.ollama-typing {
  align-self: flex-start;
  background: var(--oc-bot-bg);
  color: var(--oc-muted);
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  display: none;
}

.ollama-typing.active {
  display: block;
}

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

.ollama-input {
  flex: 1;
  border: 1px solid var(--oc-border);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
  resize: none;
  max-height: 100px;
}

.ollama-send {
  background: var(--oc-accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.ollama-send:hover {
  background: var(--oc-accent-hover);
}

.ollama-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ollama-error {
  background: #fee2e2;
  color: #991b1b;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin: 0 16px 12px;
}

@media (max-width: 420px) {
  :root {
    --oc-launcher-bottom: 90px;
    --oc-launcher-left: 10px;
  }
  .ollama-window {
    left: 10px;
    width: calc(100vw - 20px);
    height: calc(100vh - 120px);
  }
}
