/* Kubo: one minimal, accessible chat system. */
.kubo-launcher {
  position: fixed;
  right: 24px;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 26;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 18px 8px 10px;
  border: 1px solid #315b54;
  border-radius: 999px;
  background: #163e37;
  color: #fff;
  box-shadow: 0 6px 24px #163e3726;
  font: 600 14px/1.4 var(--sans, sans-serif);
  cursor: pointer;
  transition: transform 0.18s ease;
}
.kubo-launcher:hover {
  transform: translateY(-2px);
}
.kubo-face {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  color: inherit;
}
.kubo-face svg {
  width: 26px;
  height: 26px;
}
.back-to-top {
  bottom: 100px;
}
.kubo-dialog {
  position: fixed;
  inset: auto 24px 24px auto;
  margin: 0;
  padding: 0;
  width: 420px;
  max-width: calc(100vw - 32px);
  height: min(690px, calc(100dvh - 48px));
  max-height: calc(100dvh - 48px);
  border: 1px solid #d5dfda;
  border-radius: 20px;
  background: #fffdf8;
  color: #203e36;
  box-shadow: 0 20px 70px #102e3433;
  overflow: hidden;
}
.kubo-dialog[open] {
  display: flex;
  flex-direction: column;
}
.kubo-dialog::backdrop {
  background: #102e344d;
}
.kubo-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px;
  border-bottom: 1px solid #dce3dd;
  flex-shrink: 0;
}
.kubo-head > div {
  flex: 1;
  min-width: 0;
}
.kubo-head h2 {
  font: 650 20px/1.3 var(--sans, sans-serif);
  margin: 0;
  letter-spacing: 0;
}
.kubo-head h2 span {
  display: block;
  font: 500 10px/1.5 var(--sans, sans-serif);
  letter-spacing: 0.08em;
  margin-top: 3px;
}
.kubo-head p {
  font-size: 12px;
  margin: 4px 0 0;
  color: #56695e;
}
.kubo-head .icon-button {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  color: #203e36;
  border: 1px solid #dce3dd;
  border-radius: 50%;
  background: transparent;
}
.kubo-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-bottom: 1px solid #dce3dd;
  flex-shrink: 0;
}
.kubo-toolbar select {
  flex: 1;
  min-width: 0;
  width: 40%;
  color: #203e36;
  background: transparent;
  border: 0;
  font-size: 12px;
}
.kubo-toolbar button {
  background: transparent;
  color: #203e36;
  border: 0;
  padding: 6px;
  font-size: 12px;
}
.kubo-dialog button,
.kubo-toolbar select {
  min-height: 44px;
  cursor: pointer;
}
.kubo-toolbar button:last-child {
  min-width: 44px;
  font-size: 20px;
}
.kubo-consent {
  padding: 12px 18px;
  background: #eef2eb;
  font-size: 12px;
  line-height: 1.5;
  max-height: 130px;
  overflow: auto;
  flex-shrink: 0;
}
.kubo-consent[hidden] {
  display: none;
}
.kubo-consent label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.kubo-consent input {
  flex-shrink: 0;
  margin-top: 4px;
}
.kubo-consent a {
  display: inline-block;
  margin-top: 8px;
  text-decoration: underline;
}
.kubo-feed {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 20px;
  scrollbar-width: thin;
}
.kubo-welcome > .eyebrow {
  font-size: 10px;
  color: #53675e;
}
.kubo-welcome h3 {
  font: 500 clamp(24px, 5vw, 32px)/1.2 var(--serif, Georgia, serif);
  margin: 12px 0;
}
.kubo-welcome p {
  font-size: 14px;
  line-height: 1.6;
  color: #53675e;
}
.kubo-prompts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 20px 0;
}
.kubo-prompts button {
  padding: 12px;
  border: 1px solid #dce3dd;
  border-radius: 12px;
  background: #fff;
  color: #203e36;
  text-align: left;
  font-size: 12px;
  line-height: 1.5;
}
.kubo-prompts button:hover {
  background: #edf2eb;
}
.kubo-welcome .kubo-memory {
  font-size: 12px;
}
.kubo-message {
  margin: 0 0 18px;
  max-width: 94%;
  background: transparent;
}
.kubo-speaker {
  display: block;
  font-size: 10px;
  color: #53675e;
  margin-bottom: 6px;
}
.kubo-message p {
  margin: 0;
  padding: 13px 15px;
  border: 1px solid #dce3dd;
  border-radius: 14px;
  background: #f0f3ed;
  color: #203e36;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 14px/1.65 var(--sans, sans-serif);
}
.kubo-message.user {
  margin-left: auto;
}
.kubo-message.user .kubo-speaker {
  text-align: right;
}
.kubo-message.user p {
  background: #163e37;
  color: #fff;
  border-color: #163e37;
}
.kubo-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.kubo-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 10px;
  color: #163e37;
  border: 1px solid #dce3dd;
  border-radius: 8px;
  font-size: 12px;
  text-decoration: underline;
}
.kubo-status {
  flex-shrink: 0;
  max-height: 90px;
  overflow: auto;
  padding: 0 18px;
  font-size: 12px;
  color: #53675e;
}
.kubo-status:not(:empty) {
  padding-block: 8px;
}
.kubo-status button {
  margin: 4px;
  padding: 6px 10px;
  border: 1px solid #aebfb4;
  border-radius: 8px;
  background: #fff;
  color: #203e36;
}
.kubo-composer {
  margin: 8px 16px 0;
  padding: 10px;
  border: 1px solid #b4c4b9;
  border-radius: 14px;
  background: #fff;
  flex-shrink: 0;
}
.kubo-composer:focus-within {
  outline: 2px solid #347264;
  outline-offset: 2px;
}
.kubo-composer textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  max-height: 90px;
  resize: none;
  border: 0;
  padding: 4px;
  background: #fff;
  color: #203e36;
  font: 16px/1.5 var(--sans, sans-serif);
}
.kubo-composer textarea::placeholder {
  color: #63766b;
}
.kubo-composer > div {
  display: flex;
  align-items: center;
  gap: 8px;
}
.kubo-composer > div > span {
  flex: 1;
  font-size: 11px;
  color: #63766b;
}
.kubo-composer button {
  padding: 8px 14px;
  border: 0;
  border-radius: 10px;
  background: #163e37;
  color: #fff;
}
.kubo-composer #kubo-stop {
  background: #eef2eb;
  color: #203e36;
}
.kubo-dialog button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.kubo-foot {
  display: grid;
  gap: 4px;
  padding: 10px 18px 14px;
  font-size: 11px;
  line-height: 1.5;
  color: #53675e;
  flex-shrink: 0;
}
.kubo-foot a {
  color: #163e37;
  text-decoration: underline;
}
.kubo-dialog :focus-visible,
.kubo-launcher:focus-visible {
  outline: 3px solid #b87942;
  outline-offset: 3px;
}
@media (max-width: 700px) {
  .kubo-launcher {
    right: 16px;
    bottom: calc(84px + env(safe-area-inset-bottom));
  }
  .kubo-dialog {
    inset: auto 0 0;
    width: 100%;
    max-width: 100%;
    height: calc(100dvh - env(safe-area-inset-top) - 12px);
    max-height: calc(100dvh - env(safe-area-inset-top) - 12px);
    border-radius: 18px 18px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
}
@media (max-height: 520px) {
  .kubo-head {
    padding: 6px 14px;
  }
  .kubo-head h2 span,
  .kubo-head p {
    display: none;
  }
  .kubo-feed {
    padding: 12px;
  }
  .kubo-consent {
    max-height: 70px;
  }
  .kubo-foot {
    padding-block: 4px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .kubo-launcher {
    transition: none;
    transform: none;
  }
}
.reduce-motion .kubo-launcher {
  transition: none;
  transform: none;
}
@media print {
  .kubo-dialog,
  .kubo-launcher {
    display: none !important;
  }
}
