/* Bloom chat widget — self-contained, drops into any page via a <script> tag.
   One accent (Utah Grown green) on neutral grays; flat surfaces with 1px borders; a shadow only on
   the panel itself. Phone width first. */

.bloom-root {
  --bloom-font: 'Urbanist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --bloom-brand: #1f6b3b;
  --bloom-brand-hover: #18572f;
  --bloom-brand-tint: #eef6f1;
  --bloom-brand-ring: rgba(31, 107, 59, 0.18);
  --bloom-text: #111827;
  --bloom-text-2: #4b5563;
  --bloom-text-3: #9ca3af;
  --bloom-surface: #ffffff;
  --bloom-surface-2: #f6f7f8;
  --bloom-surface-3: #eff1f3;
  --bloom-border: #e5e7eb;
  --bloom-border-strong: #d1d5db;
  --bloom-danger: #c0362c;
  --bloom-radius: 20px;
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2147483000;
  font-family: var(--bloom-font);
  color: var(--bloom-text);
  font-size: 14.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.bloom-root *,
.bloom-root *::before,
.bloom-root *::after {
  box-sizing: border-box;
}

/* Zero specificity, so every component class below wins over it. */
:where(.bloom-root) :where(button, input, textarea) {
  font: inherit;
  color: inherit;
}

.bloom-root :focus-visible {
  outline: 2px solid var(--bloom-brand);
  outline-offset: 2px;
}

/* --- Launcher and panel --- */

.bloom-launcher {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 0;
  background: var(--bloom-brand);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 8px 24px -6px rgba(17, 24, 39, 0.35);
  transition: transform 0.15s ease, background 0.15s ease;
}
.bloom-launcher:hover {
  background: var(--bloom-brand-hover);
  transform: translateY(-1px);
}
.bloom-launcher.is-open {
  display: none;
}

.bloom-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 392px;
  height: min(680px, calc(100vh - 48px));
  background: var(--bloom-surface);
  border-radius: var(--bloom-radius);
  box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.06), 0 24px 48px -16px rgba(17, 24, 39, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* `display: flex` above would otherwise win over the hidden attribute, and a minimized panel would stay on screen. */
.bloom-panel[hidden] {
  display: none;
}

.bloom-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bloom-brand);
  color: #fff;
}
.bloom-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #fff;
  border: 0;
  padding: 4px;
  object-fit: contain;
}
.bloom-titles {
  flex: 1;
  min-width: 0;
}
.bloom-title {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
}
.bloom-subtitle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.82);
}
.bloom-subtitle::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7ee2a0;
}
/* Minimize (hides the panel, keeps the chat) and X (asks, then ends the chat). */
.bloom-minimize,
.bloom-close {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.bloom-minimize:hover,
.bloom-close:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

/* --- Header menu (⋯): Clear conversation, Email this chat --- */

.bloom-header {
  position: relative;
}
.bloom-menu-btn {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.bloom-menu-btn:hover,
.bloom-menu-btn[aria-expanded='true'] {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.bloom-menu {
  position: absolute;
  top: calc(100% - 4px);
  right: 12px;
  z-index: 3;
  min-width: 210px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  background: var(--bloom-surface);
  color: var(--bloom-text);
  border: 1px solid var(--bloom-border);
  border-radius: 14px;
  box-shadow: 0 12px 28px -8px rgba(17, 24, 39, 0.3);
}
.bloom-menu[hidden] {
  display: none;
}
.bloom-menu-item {
  text-align: left;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--bloom-text);
  cursor: pointer;
}
.bloom-menu-item[hidden] {
  display: none;
}
.bloom-menu-item:hover {
  background: var(--bloom-surface-3);
}

/* --- Conversation --- */

.bloom-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px 12px;
  background: var(--bloom-surface);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bloom-turn {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 88%;
}
.bloom-turn-user {
  align-self: flex-end;
  align-items: flex-end;
}
.bloom-turn-bot {
  align-self: flex-start;
  align-items: flex-start;
  /* A fixed width (bubbles still shrink inside it) so cards, pickers, and carousels get the same room. */
  width: 88%;
}

.bloom-bubble {
  padding: 10px 14px;
  border-radius: 18px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bloom-bubble-bot {
  background: var(--bloom-surface-3);
  color: var(--bloom-text);
  border-bottom-left-radius: 6px;
}
.bloom-bubble-user {
  background: var(--bloom-brand);
  color: #fff;
  border-bottom-right-radius: 6px;
}
/* The server masked something in what the patient typed: the bubble's new text fades in (widget.js nodeFor). */
.bloom-bubble-user.is-masked {
  animation: bloom-mask 0.7s ease-out;
}
@keyframes bloom-mask {
  from {
    opacity: 0.1;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .bloom-bubble-user.is-masked {
    animation: none;
  }
}
/* The last lines of an answer bubble: the question it ends on, then the fine print. */
.bloom-bubble-prompt {
  margin-top: 6px;
}
.bloom-bubble-footer {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--bloom-text-2);
}

.bloom-connector {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--bloom-text-2);
  padding-left: 2px;
}

/* The review page (review.js) still draws a footer and a question as lines of their own. */
.bloom-footer {
  font-size: 12px;
  color: var(--bloom-text-3);
  padding-left: 2px;
}

.bloom-typing {
  display: inline-flex;
  gap: 4px;
  padding: 13px 14px;
}
.bloom-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bloom-text-3);
  animation: bloom-bounce 1.1s infinite ease-in-out;
}
.bloom-typing span:nth-child(2) {
  animation-delay: 0.15s;
}
.bloom-typing span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes bloom-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  40% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

/* --- Cards and actions (card, and the base every template builds on) --- */

.bloom-card {
  width: 100%;
  background: var(--bloom-surface);
  border: 1px solid var(--bloom-border);
  border-radius: 14px;
  padding: 14px 16px;
}
.bloom-card-title {
  font-weight: 700;
  font-size: 14.5px;
  margin-bottom: 4px;
}
.bloom-card-line {
  font-size: 13.5px;
  color: var(--bloom-text-2);
}
.bloom-card-highlight {
  margin-top: 10px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  background: var(--bloom-surface-2);
  border-radius: 10px;
  padding: 8px 12px;
}
.bloom-card-highlight-label {
  font-size: 12.5px;
  color: var(--bloom-text-2);
}
.bloom-card-highlight-value {
  font-weight: 700;
}
.bloom-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.bloom-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  padding: 9px 14px;
  border-radius: 10px;
  background: var(--bloom-brand);
  color: #fff;
  border: 1px solid var(--bloom-brand);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.bloom-action:hover {
  background: var(--bloom-brand-hover);
  border-color: var(--bloom-brand-hover);
}
.bloom-action-secondary {
  background: var(--bloom-surface);
  color: var(--bloom-text);
  border-color: var(--bloom-border-strong);
}
.bloom-action-secondary:hover {
  background: var(--bloom-surface-2);
  border-color: var(--bloom-border-strong);
}
.bloom-action:disabled {
  cursor: default;
}

/* --- Chips: the one row above the composer (a question's answers, the follow-ups, or the starters) --- */

.bloom-suggestions,
.bloom-followups {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
/* Follow-ups belong to the latest answer only; earlier rows disappear once the conversation moves on. */
.bloom-turn:not(.is-latest) > .bloom-followups {
  display: none;
}
.bloom-suggestions {
  padding: 4px 16px 10px;
  background: var(--bloom-surface);
}
.bloom-suggestions[hidden] {
  display: none;
}
.bloom-chip {
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--bloom-border-strong);
  background: var(--bloom-surface);
  color: var(--bloom-text);
  cursor: pointer;
  transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}
.bloom-chip:disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}
.bloom-chip:hover {
  border-color: var(--bloom-brand);
  color: var(--bloom-brand);
  background: var(--bloom-brand-tint);
}
.bloom-choices-prompt {
  font-size: 13.5px;
  color: var(--bloom-text-2);
  margin-bottom: 8px;
  padding-left: 2px;
}

/* --- Composer --- */

.bloom-composer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bloom-surface);
  border-top: 1px solid var(--bloom-border);
}
.bloom-input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--bloom-border-strong);
  background: var(--bloom-surface);
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.bloom-input::placeholder {
  color: var(--bloom-text-3);
}
.bloom-input:focus {
  border-color: var(--bloom-brand);
  box-shadow: 0 0 0 3px var(--bloom-brand-ring);
}
.bloom-send {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: var(--bloom-brand);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.bloom-send:hover {
  background: var(--bloom-brand-hover);
}

/* The line under the composer: the server's notice for the turn. A warning (PII, crisis) is tinted, no louder than the chat. */
.bloom-notice {
  min-height: 27px; /* the line keeps its room before the first turn names it */
  font-size: 11px;
  color: var(--bloom-text-3);
  text-align: center;
  padding: 0 12px 10px;
  background: var(--bloom-surface);
}
.bloom-notice.is-pii,
.bloom-notice.is-crisis {
  min-height: 0;
  margin: 0 12px 10px;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
}
.bloom-notice.is-pii {
  color: #7a4b00;
  background: #fff4dc;
}
.bloom-notice.is-crisis {
  color: #8f2a22;
  background: #fdeeec;
}

/* --- X: "End this chat?" asked over the panel --- */

.bloom-end {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 24, 39, 0.45);
}
.bloom-end[hidden] {
  display: none;
}
.bloom-end-card {
  width: 100%;
  max-width: 300px;
  padding: 18px 18px 16px;
  background: var(--bloom-surface);
  border-radius: 16px;
  box-shadow: 0 12px 28px -8px rgba(17, 24, 39, 0.4);
}
.bloom-end-title {
  font-weight: 700;
  font-size: 15px;
}
.bloom-end-detail {
  margin-top: 4px;
  color: var(--bloom-text-2);
  font-size: 13.5px;
}
.bloom-end-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.bloom-end-confirm,
.bloom-end-keep {
  flex: 1 1 auto;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.bloom-end-keep {
  background: var(--bloom-brand);
  border: 1px solid var(--bloom-brand);
  color: #fff;
}
.bloom-end-keep:hover {
  background: var(--bloom-brand-hover);
  border-color: var(--bloom-brand-hover);
}
.bloom-end-confirm {
  background: var(--bloom-surface);
  border: 1px solid var(--bloom-border-strong);
  color: var(--bloom-danger);
}
.bloom-end-confirm:hover {
  background: #fdeeec;
  border-color: var(--bloom-danger);
}

/* --- Rendering templates (widget/templates) --- */

.bloom-turn-bot > .bloom-card,
.bloom-turn-bot > .bloom-quote,
.bloom-turn-bot > .bloom-carousel {
  max-width: 100%;
}

/* Unknown template from a newer server: shown plainly so nothing is lost. */
.bloom-template {
  border-style: dashed;
}

/* quote — visibly a quotation, shown in full: never truncated, never scrolled. */
.bloom-quote {
  width: 100%;
  margin: 0;
  background: var(--bloom-surface);
  border: 1px solid var(--bloom-border);
  border-radius: 14px;
  padding: 14px 16px 12px;
}
.bloom-quote-text {
  margin: 0;
  padding: 0 0 0 12px;
  border-left: 3px solid var(--bloom-brand);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--bloom-text);
  white-space: pre-wrap;
}
.bloom-quote-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--bloom-border);
  font-size: 12.5px;
}
.bloom-quote-source {
  font-style: normal;
  font-weight: 600;
  color: var(--bloom-text-2);
}
.bloom-quote-link {
  color: var(--bloom-brand);
  font-weight: 600;
  text-decoration: none;
}
.bloom-quote-link:hover {
  text-decoration: underline;
}

/* appointment_picker */
.bloom-picker-intro {
  font-weight: 600;
  margin-bottom: 10px;
}
.bloom-picker-slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
  gap: 6px;
}
.bloom-slot {
  font-size: 12.5px;
  line-height: 1.3;
  font-weight: 600;
  padding: 9px 6px;
  border-radius: 10px;
  border: 1px solid var(--bloom-border-strong);
  background: var(--bloom-surface);
  color: var(--bloom-text);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.bloom-slot:hover {
  border-color: var(--bloom-brand);
  background: var(--bloom-brand-tint);
}
.bloom-slot[aria-pressed='true'],
.bloom-slot.is-selected {
  background: var(--bloom-brand);
  border-color: var(--bloom-brand);
  color: #fff;
}
.bloom-slot:disabled {
  cursor: default;
  opacity: 0.5;
}
.bloom-slot[aria-pressed='true']:disabled,
.bloom-slot.is-selected:disabled {
  opacity: 1;
}
.bloom-picker-step {
  font-weight: 700;
  margin-bottom: 10px;
}
.bloom-picker-locations {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 6px;
}
.bloom-location-miles {
  display: block;
  font-size: 12px;
  font-weight: 400;
  opacity: 0.7;
}
.bloom-picker-where {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-weight: 700;
}
.bloom-picker-where-label::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--bloom-brand);
}
.bloom-picker-form {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--bloom-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bloom-picker-form[hidden] {
  display: none;
}
.bloom-picker-chosen {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-weight: 700;
}
.bloom-picker-more {
  margin-top: 10px;
}
.bloom-text-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--bloom-brand);
  text-decoration: none;
}
.bloom-text-link::after {
  content: ' →';
}
.bloom-text-link:hover {
  text-decoration: underline;
}
.bloom-link-button {
  font-size: 12.5px;
  font-weight: 600;
  border: 0;
  background: none;
  color: var(--bloom-brand);
  cursor: pointer;
  padding: 0;
}
.bloom-link-button:hover {
  text-decoration: underline;
}

/* form fields — shared by the picker and the escalation form */
.bloom-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}
.bloom-field-row {
  display: flex;
  gap: 8px;
}
.bloom-field-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--bloom-text-2);
}
.bloom-field-input {
  font-size: 14px;
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--bloom-border-strong);
  background: var(--bloom-surface);
  outline: none;
  resize: vertical;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.bloom-field-input::placeholder {
  color: var(--bloom-text-3);
}
.bloom-field-input:focus {
  border-color: var(--bloom-brand);
  box-shadow: 0 0 0 3px var(--bloom-brand-ring);
}
.bloom-field-input:disabled {
  background: var(--bloom-surface-2);
  color: var(--bloom-text-2);
}
.bloom-form-error {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--bloom-danger);
}
.bloom-form-error:empty {
  display: none;
}
.bloom-picker-form .bloom-action,
.bloom-escalation .bloom-action {
  align-self: flex-start;
  min-width: 96px;
}
.is-done .bloom-action[type='submit'] {
  background: var(--bloom-brand-tint);
  border-color: var(--bloom-brand-tint);
  color: var(--bloom-brand);
}

/* appointment_confirmation */
.bloom-confirm .bloom-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bloom-confirm .bloom-card-title::before {
  content: '';
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bloom-brand)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E")
    center / 12px no-repeat;
}
.bloom-confirm-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px 14px;
  margin: 10px 0 0;
  font-size: 13.5px;
}
.bloom-confirm-facts dt {
  color: var(--bloom-text-3);
}
.bloom-confirm-facts dd {
  margin: 0;
  font-weight: 600;
}

/* contact_phone / contact_email */
.bloom-contact-value {
  font-weight: 700;
  font-size: 15.5px;
  overflow-wrap: anywhere;
}
.bloom-contact .bloom-card-actions {
  margin-top: 10px;
}

/* escalation_form */
.bloom-escalation {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bloom-escalation-prompt {
  font-weight: 700;
}

/* carousel — swipe on phones, arrows on desktop */
.bloom-carousel {
  width: 100%;
}
.bloom-carousel-track {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  padding-bottom: 6px;
  scrollbar-width: none;
}
.bloom-carousel-track::-webkit-scrollbar {
  display: none;
}
.bloom-carousel-item {
  flex: 0 0 80%;
  max-width: 250px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
}
.bloom-carousel-item .bloom-card-actions {
  margin-top: auto;
  padding-top: 12px;
}
.bloom-carousel-nav {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 2px;
}
.bloom-carousel-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--bloom-border-strong);
  background: var(--bloom-surface);
  color: var(--bloom-text-2);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.bloom-carousel-btn:hover {
  color: var(--bloom-brand);
  border-color: var(--bloom-brand);
}
@media (hover: none) {
  .bloom-carousel-nav {
    display: none;
  }
}

.bloom-link {
  width: 100%;
}

/* --- Channel previews: same payload, drawn the way each phone shows it --- */

/* SMS (iMessage-style) */
.bloom-channel-sms .bloom-bubble-bot {
  background: #e9e9eb;
  color: #111;
}
.bloom-channel-sms .bloom-bubble-user {
  background: #34c759;
}
.bloom-channel-sms .bloom-header {
  background: #f6f6f6;
  color: #111;
  border-bottom: 1px solid #e3e3e3;
}
.bloom-channel-sms .bloom-subtitle,
.bloom-channel-sms .bloom-minimize,
.bloom-channel-sms .bloom-close {
  color: #555;
}
.bloom-channel-rcs .bloom-header {
  background: #1a73e8;
}
.bloom-channel-sms .bloom-notice,
.bloom-channel-sms .bloom-suggestions {
  display: none; /* real texting has no chips */
}

/* RCS (Google Messages-style) — widget/rcs-preview.js draws the SendRcsMessage payloads. */
.bloom-channel-rcs .bloom-bubble-bot {
  background: #f1f3f4;
  color: #202124;
}
.bloom-channel-rcs .bloom-bubble-user {
  background: #1a73e8;
}
.bloom-rcs-turn {
  gap: 6px;
}
.bloom-rcs-card {
  width: 100%;
  max-width: 296px;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 16px;
  overflow: hidden;
  color: #202124;
}
.bloom-rcs-card-small {
  flex: 0 0 180px;
}
.bloom-rcs-card-medium {
  flex: 0 0 236px;
}
.bloom-rcs-card-title {
  font-weight: 700;
  padding: 12px 14px 0;
}
.bloom-rcs-card-desc {
  padding: 4px 14px 12px;
  font-size: 13.5px;
  color: #5f6368;
  white-space: pre-wrap;
}
.bloom-rcs-card-actions {
  display: flex;
  flex-direction: column;
  border-top: 1px solid #dadce0;
}
.bloom-rcs-suggestion {
  font-size: 13.5px;
  font-weight: 600;
  color: #1a73e8;
  background: #fff;
  border: 0;
  cursor: pointer;
}
.bloom-rcs-suggestion.is-card {
  padding: 10px 14px;
  text-align: center;
}
.bloom-rcs-suggestion.is-card + .bloom-rcs-suggestion.is-card {
  border-top: 1px solid #dadce0;
}
.bloom-rcs-suggestion:hover {
  background: #f4f8fe;
}
.bloom-rcs-carousel {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  width: calc(100% + 16px);
  padding-bottom: 6px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.bloom-rcs-carousel .bloom-rcs-card {
  scroll-snap-align: start;
}
.bloom-rcs-chips {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
}
.bloom-turn.is-latest .bloom-rcs-chips {
  display: flex;
}
.bloom-rcs-suggestion.is-chip {
  padding: 7px 12px;
  border: 1px solid #dadce0;
  border-radius: 999px;
}
.bloom-rcs-suggestion[data-kind='OpenUrl']::after {
  content: ' ↗';
}

/* --- Phones: the panel takes the screen --- */

@media (max-width: 480px) {
  .bloom-root {
    right: 12px;
    bottom: 12px;
  }
  .bloom-panel {
    width: calc(100vw - 24px);
    height: calc(100vh - 24px);
  }
}

/* --- Feedback: thumbs under each answer and optional words (a note; on a thumbs-down, two boxes). The review page also draws approval status --- */

.bloom-feedback {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
}
.bloom-feedback-row {
  display: flex;
  gap: 2px;
  margin-top: -2px;
}
.bloom-feedback-btn {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--bloom-text-3);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.bloom-feedback-btn:hover {
  background: var(--bloom-surface-3);
  color: var(--bloom-text-2);
}
.bloom-feedback-btn.is-selected[data-rating='up'] {
  color: var(--bloom-brand);
  background: var(--bloom-brand-tint);
}
.bloom-feedback-btn.is-selected[data-rating='down'] {
  color: var(--bloom-danger);
  background: #fdeeec;
}
.bloom-feedback-form {
  display: flex;
  gap: 6px;
  width: 100%;
}
.bloom-feedback-form[hidden],
.bloom-feedback-fields[hidden],
.bloom-feedback-thanks[hidden],
.bloom-approval[hidden] {
  display: none;
}
/* A thumbs-down: the two labelled boxes stack above one Send. */
.bloom-feedback-form.is-down {
  flex-direction: column;
  align-items: stretch;
}
.bloom-feedback-form.is-down .bloom-feedback-send {
  align-self: flex-end;
}
.bloom-feedback-fields {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bloom-feedback-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.bloom-feedback-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--bloom-text-2);
}
.bloom-feedback-text {
  width: 100%;
  min-height: 52px;
  resize: vertical;
  border: 1px solid var(--bloom-border);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 13.5px;
  line-height: 1.4;
  background: var(--bloom-surface);
}
.bloom-feedback-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--bloom-border);
  border-radius: 10px;
  padding: 7px 10px;
  font-size: 13.5px;
  background: var(--bloom-surface);
}
.bloom-feedback-input:focus,
.bloom-feedback-text:focus {
  outline: none;
  border-color: var(--bloom-brand);
  box-shadow: 0 0 0 3px var(--bloom-brand-ring);
}
.bloom-feedback-send {
  border: 0;
  border-radius: 10px;
  padding: 7px 12px;
  background: var(--bloom-brand);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}
.bloom-feedback-send:hover {
  background: var(--bloom-brand-hover);
}
.bloom-feedback-thanks {
  font-size: 12.5px;
  color: var(--bloom-text-3);
}
.bloom-approval {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
}
.bloom-approval.is-alpha {
  color: #6b7280;
  background: #f1f2f4;
}
.bloom-approval.is-beta {
  color: #1d4ed8;
  background: #eaf1ff;
}
.bloom-approval.is-production {
  color: var(--bloom-brand, #1f6b3b);
  background: var(--bloom-brand-tint, #eef6f1);
}
.bloom-approval.is-changes {
  color: var(--bloom-danger, #c0362c);
  background: #fdeeec;
}

/* A reply from the team in a resumed conversation: a bot bubble that says who it is from. */
.bloom-turn-team {
  gap: 4px;
}
.bloom-team-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--bloom-brand);
  padding-left: 2px;
}
.bloom-bubble-team {
  background: var(--bloom-brand-tint);
  border: 1px solid var(--bloom-brand-ring);
}

/* "Thinking…": the typing bubble once a request has outlasted the free tiers (a model call). */
.bloom-thinking {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  font-size: 13px;
  color: var(--bloom-text-2);
}
.bloom-turn.is-thinking .bloom-typing {
  display: none;
}
.bloom-turn.is-thinking .bloom-thinking {
  display: inline-flex;
}
.bloom-thinking-icon {
  display: inline-flex;
  color: var(--bloom-brand);
  animation: bloom-think 1.4s infinite ease-in-out;
}
@keyframes bloom-think {
  0%,
  100% {
    transform: scale(0.85) rotate(0deg);
    opacity: 0.55;
  }
  50% {
    transform: scale(1.1) rotate(20deg);
    opacity: 1;
  }
}

/* Booking: the day strip above a day's times. */
.bloom-picker-days {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 6px;
  scrollbar-width: thin;
}
.bloom-day {
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 52px;
  padding: 8px 10px;
  border: 1px solid var(--bloom-border);
  border-radius: 12px;
  background: var(--bloom-surface);
  color: var(--bloom-text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.bloom-day:hover {
  border-color: var(--bloom-brand);
}
.bloom-day.is-selected {
  background: var(--bloom-brand);
  border-color: var(--bloom-brand);
  color: #fff;
}
.bloom-day-count {
  font-size: 11px;
  font-weight: 500;
  opacity: 0.75;
}
