/* Brendan chat widget — brand: ink / gold / cream / parchment / crimson */
.brendan-widget {
  --bw-ink: #1a1a1a;
  --bw-gold: #d4af37;
  --bw-gold-deep: #b8941f;
  --bw-cream: #fff9f2;
  --bw-parchment: #efe6d2;
  --bw-crimson: #a3182f;
  --bw-muted: #cfc4ae;
  border: 1px solid rgba(212, 175, 55, 0.55);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 249, 242, 0.08), rgba(0, 0, 0, 0.2));
  padding: 0.85rem;
  max-width: 34em;
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.brendan-widget * { box-sizing: border-box; }

.bw-banner {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}
.bw-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--bw-gold);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bw-ink);
}
.bw-banner-text { min-width: 0; }
.bw-ai-label {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bw-gold);
  margin: 0 0 0.2rem;
}
.bw-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
  font-family: Georgia, "Times New Roman", serif;
}
.bw-sub {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--bw-muted);
}

.bw-fallback-note {
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.7rem;
  border-left: 3px solid var(--bw-gold);
  background: rgba(212, 175, 55, 0.12);
  font-size: 0.88rem;
  color: #f3e8d0;
}

.bw-log {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0.6rem;
  max-height: 16rem;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.bw-msg {
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  font-size: 0.95rem;
  line-height: 1.45;
  max-width: 95%;
}
.bw-msg:last-child { margin-bottom: 0; }
.bw-msg-brendan {
  background: rgba(212, 175, 55, 0.16);
  border: 1px solid rgba(212, 175, 55, 0.35);
  margin-right: 1.5rem;
}
.bw-msg-user {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin-left: 1.5rem;
}
.bw-msg-meta {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bw-gold);
  margin-bottom: 0.2rem;
}
.bw-msg-user .bw-msg-meta { color: var(--bw-muted); }

.bw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 0.75rem;
}
.bw-chip {
  appearance: none;
  border: 1px solid rgba(212, 175, 55, 0.65);
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
  line-height: 1.3;
}
.bw-chip:hover,
.bw-chip:focus-visible {
  background: rgba(212, 175, 55, 0.22);
  outline: none;
}
.bw-chip:focus-visible {
  outline: 3px solid var(--bw-gold);
  outline-offset: 2px;
}

.bw-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.45rem;
  align-items: end;
}
.bw-form label {
  grid-column: 1 / -1;
  font-size: 0.78rem;
  color: var(--bw-muted);
}
.bw-input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  background: rgba(255, 255, 255, 0.96);
  color: var(--bw-ink);
  font: inherit;
}
.bw-input:focus-visible {
  outline: 3px solid var(--bw-gold);
  outline-offset: 2px;
}
.bw-send {
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 0.55rem 0.9rem;
  background: var(--bw-gold);
  color: var(--bw-ink);
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.bw-send:hover { background: var(--bw-gold-deep); color: #fff; }
.bw-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.bw-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  margin-top: 0.65rem;
  font-size: 0.8rem;
  color: var(--bw-muted);
}
.bw-tts {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}
.bw-tts input { accent-color: var(--bw-gold); }
.bw-status { margin: 0; min-height: 1.2em; }
.bw-status[data-busy="1"] { color: var(--bw-gold); }

.bw-enquiry {
  margin-top: 0.85rem;
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.5);
  background: rgba(239, 230, 210, 0.12);
}
.bw-enquiry[hidden] { display: none !important; }
.bw-enquiry h3 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--bw-gold);
}
.bw-enquiry .bw-field { margin: 0 0 0.55rem; }
.bw-enquiry label {
  display: block;
  font-size: 0.78rem;
  margin-bottom: 0.2rem;
  color: var(--bw-muted);
}
.bw-enquiry input,
.bw-enquiry textarea {
  width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.45rem 0.55rem;
  font: inherit;
  background: #fff;
  color: var(--bw-ink);
}
.bw-enquiry textarea { min-height: 4.5rem; resize: vertical; }
.bw-consent {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
  font-size: 0.8rem;
  color: #f0e6d2;
  margin: 0.4rem 0 0.65rem;
}
.bw-consent input { margin-top: 0.15rem; accent-color: var(--bw-gold); }
.bw-enquiry-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.bw-btn-secondary {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent;
  color: #fff;
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  font: inherit;
}
.bw-enquiry-error {
  color: #ffb4b4;
  font-size: 0.85rem;
  margin: 0.4rem 0 0;
}
.bw-enquiry-ok {
  color: #c8e6c0;
  font-size: 0.9rem;
  margin: 0.4rem 0 0;
}

.bw-noscript {
  margin: 0;
  color: var(--bw-muted);
  font-size: 0.9rem;
}

@media (prefers-reduced-motion: reduce) {
  .brendan-widget *,
  .brendan-widget *::before,
  .brendan-widget *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---- Floating "Talk to Brendan" bubble (bottom-left) ---- */
.bb-bubble{position:fixed;left:calc(16px + env(safe-area-inset-left,0px));bottom:calc(16px + env(safe-area-inset-bottom,0px));z-index:9000;display:flex;align-items:center;gap:.6rem;margin:0;padding:6px 18px 6px 6px;border:2px solid #d4af37;border-radius:999px;background:#1a1a1a;color:#fff;font:700 .95rem/1.1 inherit;font-family:inherit;cursor:pointer;box-shadow:0 6px 20px rgba(0,0,0,.28);transition:opacity .25s ease,transform .25s ease,visibility .25s;-webkit-tap-highlight-color:transparent}
.bb-bubble[hidden]{display:none}
.bb-bubble.bb-out{opacity:0;visibility:hidden;transform:translateY(12px);pointer-events:none}
.bb-bubble:hover{background:#2d2d2d}
.bb-bubble:focus-visible{outline:3px solid #d4af37;outline-offset:3px}
.bb-avatar{position:relative;flex:0 0 auto;width:48px;height:48px;border-radius:50%;overflow:hidden;background:#000;box-shadow:0 0 0 2px #d4af37}
.bb-avatar img{display:block;width:100%;height:100%;object-fit:cover}
.bb-label{white-space:nowrap}
@media (prefers-reduced-motion:no-preference){
  .bb-avatar{animation:bb-float 3.2s ease-in-out infinite}
  .bb-bubble::after{content:"";position:absolute;left:6px;top:6px;width:48px;height:48px;border-radius:50%;box-shadow:0 0 0 0 rgba(212,175,55,.55);animation:bb-pulse 2.8s ease-out infinite;pointer-events:none}
}
@keyframes bb-float{0%,100%{transform:translateY(0)}50%{transform:translateY(-3px)}}
@keyframes bb-pulse{0%{box-shadow:0 0 0 0 rgba(212,175,55,.55)}70%,100%{box-shadow:0 0 0 12px rgba(212,175,55,0)}}
@media (max-width:600px){
  .bb-bubble{padding:4px;gap:0;left:calc(12px + env(safe-area-inset-left,0px));bottom:calc(12px + env(safe-area-inset-bottom,0px))}
  .bb-avatar{width:44px;height:44px}
  .bb-bubble::after{left:4px;top:4px;width:44px;height:44px}
  .bb-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
}
@media print{.bb-bubble{display:none!important}}
