.auntdai-chat {
  /* Brand stripes: dark gold is the wider band (~56%), light gold the rest. */
  --ad-gold: #efa601;
  --ad-gold-light: #ffd05e;
  --ad-gold-hover: #d99400;
  --ad-stripe-dark: 24px;
  --ad-stripe-light: 19px;
  --ad-stripes: repeating-linear-gradient(
    to right,
    var(--ad-gold) 0 var(--ad-stripe-dark),
    var(--ad-gold-light) var(--ad-stripe-dark) calc(var(--ad-stripe-dark) + var(--ad-stripe-light))
  );
  --ad-ink: #2b2b2b;
  --ad-on-gold: #2b2b2b;
  --ad-cream: #fff6de;
  --ad-paper: #fffef8;
  --ad-assistant: #ffffff;
  --ad-muted: #4a4336;
  --ad-line: rgba(43, 43, 43, 0.14);
  --ad-chip-hover: #fff3c4;
  --ad-field-border: #e6d3a1;
  --ad-logo-ring: #fff6d0;
  --ad-serif: "Iowan Old Style", Palatino, "Palatino Linotype", "Liberation Serif", Georgia, serif;
  --ad-sans: Inter, "Segoe UI", "Liberation Sans", "Nimbus Sans", sans-serif;
  color: var(--ad-ink);
  font-family: var(--ad-sans);
  font-size: 16px;
  line-height: 1.45;
}

.auntdai-chat button,
.auntdai-chat textarea {
  font: inherit;
  letter-spacing: normal;
  text-transform: none;
}

/* The host page styles headings and buttons. Keep the chat readable anyway. */
.auntdai-chat h2,
.auntdai-chat p {
  letter-spacing: normal;
  text-transform: none;
}

.auntdai-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99990;
  display: flex;
  align-items: center;
  gap: 10px;
  width: auto;
  max-width: calc(100vw - 32px);
  height: auto;
  min-height: 64px;
  padding: 6px 16px 6px 6px;
  border: 0;
  border-radius: 999px;
  background: var(--ad-gold);
  color: var(--ad-on-gold);
  box-shadow: 0 10px 26px rgba(120, 78, 0, 0.28);
  cursor: pointer;
}

.auntdai-launcher:hover,
.auntdai-launcher:focus-visible {
  background: var(--ad-gold-hover);
  color: var(--ad-on-gold);
}

.auntdai-launcher:focus-visible,
.auntdai-panel button:focus-visible,
.auntdai-panel textarea:focus-visible,
.auntdai-panel a:focus-visible {
  outline: 3px solid var(--ad-ink);
  outline-offset: 2px;
}

.auntdai-launcher-mark {
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--ad-logo-ring);
  flex: none;
}

.auntdai-avatar {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
  border: 2px solid #fff;
  flex: none;
  box-shadow: 0 0 0 1px var(--ad-logo-ring);
}

.auntdai-launcher-mark img,
.auntdai-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #fff;
}

.auntdai-launcher-label {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
  color: var(--ad-on-gold);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: 0;
  white-space: nowrap;
}

.auntdai-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 99991;
  display: flex;
  flex-direction: column;
  width: min(400px, calc(100vw - 24px));
  height: min(680px, calc(100dvh - 32px));
  border: 1px solid var(--ad-line);
  border-radius: 22px;
  background: var(--ad-paper);
  box-shadow: 0 24px 60px rgba(60, 28, 16, 0.28);
  overflow: hidden;
}

.auntdai-panel[hidden],
.auntdai-launcher[hidden] {
  display: none;
}

.auntdai-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 12px 14px 16px;
  background: var(--ad-stripes);
  color: var(--ad-on-gold);
}

.auntdai-header h2 {
  margin: 0;
  font-family: var(--ad-serif);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--ad-on-gold) !important;
  text-transform: none !important;
  background: transparent;
}

.auntdai-header p {
  margin: 2px 0 0;
  color: var(--ad-on-gold) !important;
  font-size: 13px;
  text-transform: none !important;
}

.auntdai-header-text {
  flex: 1;
  min-width: 0;
}

.auntdai-close {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ad-on-gold);
  cursor: pointer;
}

.auntdai-close:hover {
  background: rgba(43, 43, 43, 0.12);
}

.auntdai-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--ad-cream);
}

.auntdai-msg {
  max-width: 92%;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 16px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.auntdai-msg-assistant {
  background: var(--ad-assistant);
  color: var(--ad-ink);
  border: 1px solid var(--ad-line);
  border-top-left-radius: 6px;
}

.auntdai-msg-user {
  margin-left: auto;
  background: var(--ad-gold-light);
  color: var(--ad-ink);
  border-top-right-radius: 6px;
}

.auntdai-msg a {
  color: var(--ad-ink);
  font-weight: 650;
}

.auntdai-typing {
  color: var(--ad-muted);
  font-size: 14px;
}

.auntdai-compose {
  padding: 10px 12px 8px;
  background: var(--ad-paper);
  border-top: 1px solid var(--ad-line);
}

.auntdai-quick {
  display: inline-flex;
  margin: 0 0 8px;
  padding: 8px 12px;
  border: 1px solid var(--ad-gold);
  border-radius: 999px;
  background: #fff;
  color: var(--ad-ink);
  cursor: pointer;
  text-align: left;
}

.auntdai-quick:hover {
  background: var(--ad-chip-hover);
}

.auntdai-form {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

.auntdai-form textarea {
  flex: 1;
  min-height: 46px;
  max-height: 120px;
  resize: none;
  padding: 11px 12px;
  border: 1px solid var(--ad-field-border);
  border-radius: 14px;
  background: #fff;
  color: var(--ad-ink);
}

.auntdai-send {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--ad-gold);
  color: var(--ad-on-gold);
  cursor: pointer;
  flex: none;
}

.auntdai-send:hover {
  background: var(--ad-gold-hover);
  color: var(--ad-on-gold);
}

.auntdai-send:disabled {
  opacity: 0.45;
  cursor: default;
}

.auntdai-mic {
  width: 46px;
  height: 46px;
  border: 1px solid var(--ad-gold);
  border-radius: 50%;
  background: var(--ad-gold);
  color: var(--ad-on-gold);
  cursor: pointer;
  flex: none;
}

.auntdai-mic[hidden] {
  display: none;
}

.auntdai-mic:hover,
.auntdai-mic.is-recording {
  background: var(--ad-gold-hover);
  color: var(--ad-on-gold);
}

.auntdai-mic.is-recording {
  box-shadow: 0 0 0 3px var(--ad-ink);
}

.auntdai-note {
  margin: 8px 2px 2px;
  color: var(--ad-muted);
  font-size: 12px;
}

.auntdai-note a {
  color: var(--ad-ink);
}

@media (max-width: 640px) {
  .auntdai-launcher {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    gap: 8px;
    min-height: 56px;
    padding: 4px 12px 4px 4px;
  }

  .auntdai-launcher-mark {
    width: 48px;
    height: 48px;
  }

  .auntdai-launcher-label {
    font-size: 13px;
    white-space: normal;
    max-width: 9.2em;
  }

  .auntdai-panel {
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
  }

  .auntdai-log {
    padding-bottom: 8px;
  }

  .auntdai-compose {
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  .auntdai-chat * {
    scroll-behavior: auto !important;
  }
}

@media print {
  .auntdai-chat {
    display: none !important;
  }
}
