/* chat-widget.css — floating assistant for kuba.ie
   Retheme by overriding these four variables in your own stylesheet. */

.kc {
  --kc-bg: #11100d;
  --kc-fg: #e6e0d4;
  --kc-accent: #f0a92a;
  --kc-muted: #8a8375;
  --kc-line: #2a2823;
  --kc-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 9998;
  font-family: var(--kc-mono);
  font-size: 0.875rem;
  line-height: 1.55;
}

/* ---- toggle ---- */

.kc__toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--kc-line);
  border-radius: 2px;
  background: var(--kc-bg);
  color: var(--kc-accent);
  font: inherit;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 120ms ease;
}

.kc__toggle:hover { border-color: var(--kc-accent); }

.kc__toggle:focus-visible {
  outline: 2px solid var(--kc-accent);
  outline-offset: 2px;
}

.kc__caret {
  color: var(--kc-accent);
  animation: kc-blink 1.1s step-end infinite;
}

@keyframes kc-blink { 50% { opacity: 0; } }

/* ---- panel ---- */

.kc__panel {
  display: none;
  flex-direction: column;
  width: min(23rem, calc(100vw - 2.5rem));
  height: min(30rem, calc(100vh - 8rem));
  margin-bottom: 0.75rem;
  border: 1px solid var(--kc-line);
  border-radius: 2px;
  background: var(--kc-bg);
  color: var(--kc-fg);
  overflow: hidden;
}

.kc.is-open .kc__panel { display: flex; }

.kc__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--kc-line);
}

.kc__title {
  margin: 0;
  color: var(--kc-accent);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.kc__close {
  padding: 0.15rem 0.4rem;
  border: 0;
  background: none;
  color: var(--kc-muted);
  font: inherit;
  cursor: pointer;
}

.kc__close:hover { color: var(--kc-fg); }

.kc__close:focus-visible {
  outline: 2px solid var(--kc-accent);
  outline-offset: 1px;
}

/* ---- AI disclosure (EU AI Act Art. 50) ---- */

.kc__notice {
  margin: 0;
  padding: 0.5rem 0.9rem;
  border-bottom: 1px solid var(--kc-line);
  background: rgba(240, 169, 42, 0.06);
  color: var(--kc-fg);
  font-size: 0.75rem;
  line-height: 1.45;
}

/* ---- messages ---- */

.kc__log {
  flex: 1;
  padding: 0.9rem;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.kc__msg { margin: 0 0 0.9rem; }

.kc__msg:last-child { margin-bottom: 0; }

.kc__who {
  display: block;
  color: var(--kc-muted);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kc__msg--you .kc__who { color: var(--kc-accent); }

/* The "AI" speaker label is part of the Article 50 disclosure. Keep it legible
   — don't drop its contrast below the surrounding body text. */
.kc__msg--ai .kc__who { color: var(--kc-muted); }

.kc__text {
  margin: 0.2rem 0 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.kc__msg--error .kc__text { color: #e07a5f; }

/* ---- composer ---- */

.kc__form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  border-top: 1px solid var(--kc-line);
}

.kc__prompt { color: var(--kc-accent); }

.kc__input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--kc-fg);
  font: inherit;
}

.kc__input::placeholder { color: var(--kc-muted); }
.kc__input:focus { outline: none; }

.kc__send {
  border: 1px solid var(--kc-line);
  border-radius: 2px;
  padding: 0.25rem 0.55rem;
  background: none;
  color: var(--kc-fg);
  font: inherit;
  cursor: pointer;
}

.kc__send:hover:not(:disabled) { border-color: var(--kc-accent); }
.kc__send:disabled { color: var(--kc-muted); cursor: default; }

.kc__send:focus-visible {
  outline: 2px solid var(--kc-accent);
  outline-offset: 1px;
}

@media (prefers-reduced-motion: reduce) {
  .kc__caret { animation: none; }
  .kc__toggle { transition: none; }
}