/* =========================================================  
   247ChatMate — Widget V2
   CLEAN BASELINE — SCROLL SAFE (RECOVERY — STABLE)
   BEHAVIOUR + UX POLISH PASS
   + MIN FIX — LOCK CHIP HEIGHT / NO SHAPE GROWTH
========================================================= */

:root {
  --matewa-accent: #25D366;
  --matewa-accent-dark: #1fb85a;

  --matewa-bg-soft: #f1f5f9;
  --matewa-bg-white: #ffffff;

  --matewa-text-main: #0f172a;
  --matewa-text-muted: #334155;

  --matewa-vertical-gap: 12px;

  --matewa-radius: 22px;
  --matewa-radius-inner: 16px;

  --matewa-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ---------------------------------------------------------
   SAFETY
--------------------------------------------------------- */

#matewa-widget,
#matewa-widget * {
  box-sizing: border-box;
}

/* ---------------------------------------------------------
   WIDGET SHELL
--------------------------------------------------------- */

#matewa-widget {
  position: fixed;
  bottom: 96px;
  left: 50%;
  transform: translateX(-50%);

  width: 320px;
  height: 520px;

  display: flex;
  flex-direction: column;

  visibility: hidden;
  opacity: 0;
  pointer-events: none;

  background: var(--matewa-bg-white);
  border-radius: var(--matewa-radius);
  overflow: hidden;

  box-shadow: 0 32px 70px rgba(0,0,0,.35);
  font-family: var(--matewa-font);

  z-index: 9998;
}

#matewa-widget.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

/* ---------------------------------------------------------
   HEADER
--------------------------------------------------------- */

.matewa-header {
  height: 64px;
  padding: 0 18px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  background: linear-gradient(
    180deg,
    var(--matewa-accent),
    var(--matewa-accent-dark)
  );

  color: #fff;
  margin-bottom: calc(var(--matewa-vertical-gap) - 16px);
}

.matewa-header-title {
  font-size: 17px;
  font-weight: 700;
}

.matewa-close {
  width: 44px;
  height: 44px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 50%;
  border: none;

  background: transparent;
  color: #fff;

  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
}

/* ---------------------------------------------------------
   SCROLL AREA (ONLY THIS SCROLLS)
--------------------------------------------------------- */

.matewa-bubbles {
  position: relative;

  flex: 1;
  display: flex;
  flex-direction: column;

  overflow-y: auto;
  overflow-x: hidden;

  padding: 16px;
  padding-bottom: 140px;

  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* ---------------------------------------------------------
   STREAM
--------------------------------------------------------- */

.matewa-stream {
  display: flex;
  flex-direction: column;
  gap: var(--matewa-vertical-gap);
}

/* ---------------------------------------------------------
   INTRO
--------------------------------------------------------- */

.matewa-intro {
  display: flex;
  flex-direction: column;
  gap: var(--matewa-vertical-gap);
}

.matewa-intro .matewa-bubble {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.matewa-intro .matewa-bubble.is-visible {
  opacity: 1;
}

/* ---------------------------------------------------------
   BUBBLES
--------------------------------------------------------- */

.matewa-bubble {
  padding: 14px 16px;
  border-radius: var(--matewa-radius-inner);
  background: var(--matewa-bg-soft);

  font-size: 15px;
  line-height: 1.5;
  color: #0f172a;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.95),
    0 4px 10px rgba(15,23,42,.12);
}

.matewa-muted {
  color: var(--matewa-text-muted);
}

/* ---------------------------------------------------------
   TASK APPEARANCE
--------------------------------------------------------- */

.matewa-task,
.matewa-notes,
.matewa-phone,
.matewa-contact {
  opacity: 0;
  transition: opacity 0.35s ease;
}

.matewa-task.is-active,
.matewa-notes.is-active,
.matewa-phone.is-active,
.matewa-contact.is-active {
  opacity: 1;
}

/* ---------------------------------------------------------
   CHIPS
--------------------------------------------------------- */

.matewa-chip-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.matewa-chip {
  height: 52px;
  min-height: 52px;
  padding: 6px 8px;

  border-radius: 14px;
  border: 1.5px solid var(--matewa-accent);

  background: #fff;
  color: var(--matewa-accent);

  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.25;

  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;

  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
  overflow: hidden;

  cursor: pointer;

  transition:
    transform 0.12s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

/* ⭐ MIN FIX — clamp chip label to two lines only */
.matewa-chip-label {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;

  width: 100%;
  max-height: 34px;
  overflow: hidden;

  line-height: 1.25;
  text-align: center;
  word-break: normal;
  overflow-wrap: normal;
}

.matewa-chip.is-selected {
  background: linear-gradient(
    180deg,
    var(--matewa-accent),
    var(--matewa-accent-dark)
  );
  color: #fff;
  border-color: transparent;
}

/* ---------------------------------------------------------
   INPUTS
--------------------------------------------------------- */

.matewa-notes,
.matewa-phone,
.matewa-contact {
  display: none;
  flex-direction: column;
  gap: 8px;
}

.matewa-notes.is-active,
.matewa-phone.is-active,
.matewa-contact.is-active {
  display: flex;
}

/* ---------- TEXTAREA (WHATSAPP-LIKE — 1 LINE) ---------- */

.matewa-notes textarea {
  width: 100%;

  font-family: var(--matewa-font);
  font-size: 15px;
  line-height: 1.4;

  padding: 10px 16px;
  border-radius: 14px;
  border: 1.5px solid var(--matewa-accent);

  height: calc(1.4em + 20px);
  max-height: calc(1.4em + 20px);

  resize: none;
  overflow-y: auto;

  display: block;
}

.matewa-notes textarea {
  scroll-behavior: auto;
}

/* ---------------------------------------------------------
   OTHER INPUTS
--------------------------------------------------------- */

.matewa-phone input,
.matewa-contact input {
  height: 48px;
  border-radius: 14px;
  border: 1.5px solid var(--matewa-accent);
  padding: 0 16px;

  font-family: var(--matewa-font);
  font-size: 15px;
}

/* ---------------------------------------------------------
   CHARACTER COUNTER
--------------------------------------------------------- */

.matewa-notes {
  position: relative;
}

/* required for phone helper anchoring */
.matewa-phone {
  position: relative;
}

.matewa-char-counter {
  position: absolute;
  right: 26px; /* pulled inward to clear scrollbar */
  bottom: 8px;

  font-size: 10px;
  font-weight: 600;
  color: var(--matewa-text-muted);

  pointer-events: none;
}

/* ⭐ MIN FIX — micro-lowered to clear bubble radius cleanly */
.matewa-phone .matewa-char-counter {
  bottom: 80px;
}

/* ---------------------------------------------------------
   CTA — CLICK-SAFE MIN FIX (WIDTH ALIGNMENT CORRECTED)
--------------------------------------------------------- */

.matewa-cta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 56px;

  padding: 0 16px;
  display: flex;
  flex-direction: column;
  gap: var(--matewa-vertical-gap);

  background: linear-gradient(
    to top,
    rgba(255,255,255,0.96),
    rgba(255,255,255,0.92)
  );

  border-radius: 0;

  z-index: 2;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition: opacity 0.25s ease;
}

.matewa-cta.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 5;
}

.matewa-cta .matewa-chip-group {
  margin-top: 4px;
}

/* ---------------------------------------------------------
   CTA CHIP LAYOUT (2-COLUMN OVERRIDE)
--------------------------------------------------------- */

.matewa-cta .matewa-chip-group {
  grid-template-columns: 1fr 1fr;
}

.matewa-cta .matewa-chip {
  height: 48px;
  min-height: 48px;
  font-size: 14px;
}

.matewa-cta .matewa-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* ---------------------------------------------------------
   BRANDING
--------------------------------------------------------- */

.matewa-branding {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;

  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;

  background: #fff;
  border-top: 1px solid #eef2f7;

  font-size: 12px;
  z-index: 3;
}

.matewa-branding a {
  color: var(--matewa-accent);
  font-weight: 600;
}

/* ---------------------------------------------------------
   LAUNCHER
--------------------------------------------------------- */

#matewa-launcher {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);

  height: 52px;
  padding: 0 22px;

  border-radius: 26px;
  border: none;

  background: linear-gradient(
    180deg,
    var(--matewa-accent),
    var(--matewa-accent-dark)
  );

  color: #fff;
  font-size: 15px;
  font-weight: 700;

  box-shadow: 0 14px 36px rgba(0,0,0,.28);
  cursor: pointer;
  z-index: 9999;
}

#matewa-launcher::before {
  content: "Chat on WhatsApp";
}

/* ---------------------------------------------------------
   LAUNCHER HIDE WHEN WIDGET IS OPEN
   Uses authoritative body class from matewa-launcher.js
--------------------------------------------------------- */

body.matewa-launcher-hidden #matewa-launcher {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ---------------------------------------------------------
   LOCKED INPUT VISUAL (PAINT ONLY)
--------------------------------------------------------- */

.matewa-notes textarea.is-locked,
.matewa-phone input.is-locked,
.matewa-contact input.is-locked {
  background: linear-gradient(
    180deg,
    var(--matewa-accent),
    var(--matewa-accent-dark)
  ) !important;

  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: none !important;
  caret-color: transparent;
}

/* ⭐ MIN FIX — locked textarea counter turns white */
.matewa-notes textarea.is-locked ~ .matewa-char-counter {
  color: #ffffff !important;
}

.matewa-notes textarea.is-locked::placeholder,
.matewa-phone input.is-locked::placeholder,
.matewa-contact input.is-locked::placeholder {
  color: rgba(255,255,255,.9) !important;
}

/* ---------------------------------------------------------
   FOCUS STATE
--------------------------------------------------------- */

.matewa-notes textarea:focus,
.matewa-phone input:focus,
.matewa-contact input:focus {
  outline: none !important;
  border-color: var(--matewa-accent);
  box-shadow: 0 0 0 2px rgba(37,211,102,.25);
}

.matewa-notes textarea:not(.is-locked):focus,
.matewa-phone input:not(.is-locked):focus,
.matewa-contact input:not(.is-locked):focus {
  background: #f6fff9;
}

/* =========================================================
   PHONE HELPER — INLINE, STABLE, TEXT-SWAP ONLY
   Restores helper under input + Mickey-mouse warning
========================================================= */

/* override absolute positioning for PHONE ONLY */
.matewa-phone .matewa-char-counter {
  position: static;
  margin-top: 4px;
  padding-left: 16px;

  font-size: 11px;
  line-height: 1.3;
  font-weight: 500;

  color: var(--matewa-text-muted);
  text-align: left;

  pointer-events: none;
}

/* =========================================================
   CONTACT HELPER — EXACT MATCH TO PHONE HELPER
   Reserved space, text-swap only
========================================================= */

.matewa-contact .matewa-soft-hint {
  display: block;

  height: 14px;
  margin-top: 4px;
  padding-left: 16px;

  font-size: 11px;
  line-height: 1.3;
  font-weight: 500;

  color: var(--matewa-text-muted);
  text-align: left;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.matewa-contact .matewa-soft-hint.is-visible {
  opacity: 1;
}

/* =========================================================
   FINAL MICRO-RHYTHM FIX — PHONE + CONTACT HELPERS
   Symmetric spacing, no layout shift, text-swap only
========================================================= */

/* shared helper rhythm (phone + contact) */
.matewa-phone .matewa-char-counter,
.matewa-contact .matewa-soft-hint {
  display: block;

  margin-top: 4px;
  margin-bottom: 4px;

  padding-left: 16px;

  font-size: 12px;
  line-height: 1.3;
  font-weight: 500;

  color: var(--matewa-text-muted);
  opacity: 0.8;

  pointer-events: none;
}

/* ensure helpers never push layout when empty */
.matewa-contact .matewa-soft-hint {
  height: 14px;
}

/* warnings override colour only (no spacing change) */
.matewa-phone .matewa-char-counter.is-warning,
.matewa-contact .matewa-soft-hint.is-warning {
  color: var(--matewa-text-muted);
  opacity: 1;
}

/* =========================================================
   RTL SUPPORT — MINIMAL, AUTO (NO BLOAT)
========================================================= */

#matewa-wrapper[dir="rtl"] {
  direction: rtl;
}

#matewa-wrapper[dir="rtl"] .matewa-stream,
#matewa-wrapper[dir="rtl"] .matewa-intro,
#matewa-wrapper[dir="rtl"] .matewa-bubble,
#matewa-wrapper[dir="rtl"] .matewa-phone .matewa-char-counter,
#matewa-wrapper[dir="rtl"] .matewa-contact .matewa-soft-hint {
  text-align: right;
}

#matewa-wrapper[dir="rtl"] .matewa-chip-group {
  direction: rtl;
}

#matewa-wrapper[dir="rtl"] .matewa-char-counter {
  right: auto;
  left: 26px;
}

/* =========================================================
   HARD ISOLATION — GRID SAFE + PROPER WEIGHT
========================================================= */

#matewa-widget .matewa-chip {
  appearance: none !important;
  -webkit-appearance: none !important;
  all: unset;

  box-sizing: border-box;
  width: 100% !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  height: 52px !important;
  min-height: 52px !important;
  padding: 6px 8px !important;

  border-radius: 14px !important;
  border: 1.5px solid var(--matewa-accent) !important;

  background: #fff !important;
  color: var(--matewa-accent) !important;

  font-family: var(--matewa-font) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1.25 !important;

  text-align: center !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: anywhere !important;
  overflow: hidden !important;

  cursor: pointer !important;
  box-shadow: none !important;

  -webkit-font-smoothing: antialiased !important;
  text-rendering: optimizeLegibility !important;
}

/* ⭐ MIN FIX — hard clamp chip label to two lines only */
#matewa-widget .matewa-chip .matewa-chip-label {
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;

  width: 100% !important;
  max-height: 34px !important;
  overflow: hidden !important;

  line-height: 1.25 !important;
  text-align: center !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
}

#matewa-widget .matewa-chip.is-selected {
  background: linear-gradient(
    180deg,
    var(--matewa-accent),
    var(--matewa-accent-dark)
  ) !important;
  color: #fff !important;
  border-color: transparent !important;
}

/* =========================================================
   VIEWPORT SAFETY FIX (BODY FIXED COMPAT)
========================================================= */

#matewa-widget {
  position: fixed !important;
  bottom: 96px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
}

/* =========================================================
   ELEMENTOR HARD OVERRIDE — CLOSE (X) BUTTON
   Surgical force reset
========================================================= */

#matewa-widget .matewa-close {
  appearance: none !important;
  -webkit-appearance: none !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  width: 44px !important;
  height: 44px !important;

  padding: 1px 6px !important;
  margin: 0 !important;

  background: transparent !important;
  color: #ffffff !important;

  border: none !important;
  border-radius: 50% !important;

  font-family: Arial, sans-serif !important;
  font-size: 22px !important;
  font-weight: 800 !important;
  line-height: normal !important;

  box-sizing: border-box !important;
  text-align: center !important;

  box-shadow: none !important;
  text-shadow: none !important;

  transition: background 0.18s ease !important, opacity 0.18s ease !important;
}

#matewa-widget .matewa-close:hover,
#matewa-widget .matewa-close:focus-visible {
  background: rgba(255, 255, 255, 0.18) !important;
  outline: none !important;
}

/* =========================================================
   SPACING AUDIT PATCH — VISUAL RHYTHM ONLY
   NO BEHAVIOUR CHANGES
========================================================= */

/* ---------------------------------------------------------
   1. BUBBLE → CHIP GRID BREATHING ROOM
   (fixes tight chip screen)
--------------------------------------------------------- */

.matewa-task .matewa-chip-group {
  margin-top: calc(var(--matewa-vertical-gap) + 4px);
}

/* ---------------------------------------------------------
   2. INPUT GROUP RHYTHM
   (fixes optional/helper spacing feeling off)
--------------------------------------------------------- */

.matewa-notes,
.matewa-phone,
.matewa-contact {
  gap: 8px;
}

/* ---------------------------------------------------------
   4. CTA CHIP GROUP BREATHING ROOM
--------------------------------------------------------- */

.matewa-cta .matewa-chip-group {
  margin-top: 8px;
}

/* ---------------------------------------------------------
   5. STREAM RHYTHM MICRO-BALANCE
--------------------------------------------------------- */

.matewa-stream {
  gap: calc(var(--matewa-vertical-gap) + 2px);
}

/* =========================================================
   OPTIONAL LABEL — ATTACH TO INPUT ABOVE
   Spacing only
========================================================= */

.matewa-phone .matewa-char-counter,
.matewa-contact .matewa-soft-hint {
  margin-top: -2px;
  margin-bottom: 8px;
}

/* =========================================================
   CONTACT SOFT CONFIRM — STRONG VISUAL CONFIRM
   Same visual language as locked fields, but still editable on refocus
========================================================= */

.matewa-contact input.is-soft-confirmed {
  background: linear-gradient(
    180deg,
    var(--matewa-accent),
    var(--matewa-accent-dark)
  ) !important;

  color: #ffffff !important;
  border-color: transparent !important;
  box-shadow: none !important;
  caret-color: transparent;
}

.matewa-contact input.is-soft-confirmed::placeholder {
  color: rgba(255,255,255,.9) !important;
}

/* =========================================================
   PHASE 5-A-7A — FRONTEND WIDGET VISUAL FLOW FIT CORRECTION
   Visual/layout only. Preserves chip fit rules and handoff behaviour.
========================================================= */

#matewa-widget {
  width: 320px;
  height: 520px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: #ffffff;
  box-shadow:
    0 30px 72px rgba(15, 23, 42, 0.28),
    0 10px 24px rgba(15, 23, 42, 0.14);
}

#matewa-widget .matewa-header {
  height: 60px;
  padding: 0 12px 0 16px;
  background:
    radial-gradient(circle at 22% 0%, rgba(255, 255, 255, 0.18), transparent 34%),
    linear-gradient(180deg, #15803d 0%, #057a29 100%);
}

#matewa-widget .matewa-header-title {
  font-size: 15px;
  letter-spacing: -0.01em;
  line-height: 1.05;
  max-width: 118px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  display: block;
}

#matewa-widget .matewa-bubbles {
  padding: 14px;
  padding-bottom: 122px;
  background:
    radial-gradient(circle at 100% 0%, rgba(37, 211, 102, 0.07), transparent 30%),
    #ffffff;
}

#matewa-widget .matewa-stream {
  gap: 12px;
}

#matewa-widget .matewa-bubble {
  padding: 12px 14px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.085);
}

#matewa-widget .matewa-muted {
  background: #ecfdf3;
  border-color: rgba(37, 211, 102, 0.18);
  color: #14532d;
}

/* Keep the proven chip contract: fixed cards, two-line clamp, no oversized labels. */
#matewa-widget .matewa-task .matewa-chip-group {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 11px;
}

#matewa-widget .matewa-task .matewa-chip {
  height: 50px !important;
  min-height: 50px !important;
  padding: 6px 7px !important;
  border-color: rgba(5, 122, 41, 0.28) !important;
  color: #057a29 !important;
  background: #ffffff !important;
  box-shadow: 0 7px 16px rgba(15, 23, 42, 0.055) !important;
}

#matewa-widget .matewa-task .matewa-chip:hover,
#matewa-widget .matewa-task .matewa-chip:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.095) !important;
}

#matewa-widget .matewa-task .matewa-chip.is-selected {
  background: linear-gradient(180deg, #15803d 0%, #057a29 100%) !important;
  color: #ffffff !important;
  border-color: transparent !important;
}

#matewa-widget .matewa-task .matewa-chip .matewa-chip-label {
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  width: 100% !important;
  max-height: 30px !important;
  overflow: hidden !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: normal !important;
  hyphens: none !important;
  font-size: 11.2px !important;
  line-height: 1.25 !important;
  font-weight: 700 !important;
  text-align: center !important;
}

#matewa-widget .matewa-notes {
  margin-top: 7px;
  gap: 8px;
}

#matewa-widget .matewa-notes .matewa-bubble {
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 750;
  color: #14532d;
  background: #ecfdf3;
  border-color: rgba(37, 211, 102, 0.18);
}

#matewa-widget .matewa-notes textarea {
  min-height: 96px;
  height: 96px;
  max-height: 96px;
  padding: 12px 14px 27px;
  border-color: rgba(5, 122, 41, 0.30);
  background: #ffffff;
  font-size: 14px;
  line-height: 1.42;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), 0 8px 18px rgba(15, 23, 42, 0.06);
}

#matewa-widget .matewa-notes .matewa-char-counter {
  right: 18px;
  bottom: 11px;
  color: #64748b;
}

#matewa-widget .matewa-phone-field {
  position: relative;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
}

#matewa-widget .matewa-phone-country-picker {
  position: relative;
  min-width: 0;
  z-index: 20;
}

#matewa-widget .matewa-phone-field--no-country-selector {
  grid-template-columns: minmax(0, 1fr);
}

#matewa-widget .matewa-phone-country-picker.is-hidden {
  display: none !important;
}

#matewa-widget .matewa-phone-country-picker select.matewa-phone-country {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

#matewa-widget .matewa-phone-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 48px;
  padding: 0 8px;
  border: 1.5px solid rgba(15, 23, 42, 0.14);
  border-radius: 14px;
  background: #ffffff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
  position: relative;
  z-index: 2;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 7px 16px rgba(15, 23, 42, 0.04);
}

#matewa-widget .matewa-phone-code:hover {
  border-color: rgba(15, 23, 42, 0.22);
  background: #ffffff;
}

#matewa-widget .matewa-phone-code:focus-visible,
#matewa-widget .matewa-phone-country-picker.is-open .matewa-phone-code {
  border-color: rgba(5, 122, 41, 0.42);
  background: #f8fffb;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.14);
}

#matewa-widget .matewa-phone-code.is-locked,
#matewa-widget .matewa-phone-code:disabled {
  opacity: 1;
  cursor: default;
}

#matewa-widget .matewa-phone-country-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 18px;
  font-size: 15px;
  line-height: 1;
}

#matewa-widget .matewa-phone-country-dial {
  display: inline-block;
  flex: 0 0 auto;
  min-width: 28px;
  font-variant-numeric: tabular-nums;
  text-align: left;
}

#matewa-widget .matewa-phone-country-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 80;
  width: min(292px, calc(100vw - 48px));
  max-height: 238px;
  padding: 6px;
  overflow-y: auto;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  background: #ffffff;
  pointer-events: auto;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

#matewa-widget .matewa-phone-country-menu[hidden] {
  display: none !important;
}


#matewa-widget .matewa-phone-format-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 2px 2px 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

#matewa-widget .matewa-phone-format-option {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
  font-family: var(--matewa-font);
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

#matewa-widget .matewa-phone-format-option.is-selected {
  border-color: rgba(5, 122, 41, 0.42);
  background: #ecfdf3;
  color: #14532d;
}

#matewa-widget .matewa-phone-format-option:disabled {
  opacity: .35;
  cursor: default;
}

#matewa-widget .matewa-phone-country-option {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 62px;
  align-items: center;
  column-gap: 8px;
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #0f172a;
  font-family: var(--matewa-font);
  font-size: 13px;
  line-height: 1.15;
  text-align: left;
  cursor: pointer;
}

#matewa-widget .matewa-phone-country-option:hover,
#matewa-widget .matewa-phone-country-option:focus-visible,
#matewa-widget .matewa-phone-country-option.is-selected {
  background: #ecfdf3;
  outline: none;
}

#matewa-widget .matewa-phone-country-option-flag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  font-size: 16px;
  line-height: 1;
}

#matewa-widget .matewa-phone-country-option-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

#matewa-widget .matewa-phone-country-option-dial {
  justify-self: end;
  width: 62px;
  color: #14532d;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

#matewa-widget .matewa-phone-field .matewa-phone-input {
  min-width: 0;
}

#matewa-widget .matewa-phone input,
#matewa-widget .matewa-contact input {
  border-color: rgba(5, 122, 41, 0.26);
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 7px 16px rgba(15, 23, 42, 0.05);
}

#matewa-widget .matewa-phone input:focus,
#matewa-widget .matewa-contact input:focus,
#matewa-widget .matewa-notes textarea:focus {
  border-color: #057a29;
  box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.18);
}

#matewa-widget .matewa-cta {
  bottom: 40px;
  padding: 8px 14px 10px;
  gap: 8px;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.99), rgba(255, 255, 255, 0.93));
  box-shadow: 0 -12px 24px rgba(255, 255, 255, 0.94);
}

#matewa-widget .matewa-cta-prompt,
#matewa-widget .matewa-cta-confirm {
  padding: 9px 11px;
  font-size: 13px;
  line-height: 1.32;
  font-weight: 750;
  text-align: center;
}

#matewa-widget .matewa-cta .matewa-chip-group {
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 0;
}

#matewa-widget .matewa-cta .matewa-chip {
  height: 58px !important;
  min-height: 58px !important;
  padding: 7px 6px !important;
  justify-content: center !important;
  gap: 6px;
  border-color: rgba(5, 122, 41, 0.30) !important;
  color: #057a29 !important;
  background: #ffffff !important;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.07) !important;
  text-align: center !important;
}

#matewa-widget .matewa-cta .matewa-chip.is-selected {
  background: linear-gradient(180deg, #15803d 0%, #057a29 100%) !important;
  color: #ffffff !important;
}

#matewa-widget .matewa-cta-whatsapp {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #f0fdf4 url('../img/whatsapp.svg') center / 13px 13px no-repeat;
  border: 1px solid rgba(37, 211, 102, 0.25);
}

#matewa-widget .matewa-cta .matewa-chip.is-selected .matewa-cta-whatsapp {
  background-color: #ffffff;
  border-color: rgba(255, 255, 255, 0.78);
}

#matewa-widget .matewa-cta-copy {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  max-width: calc(100% - 26px);
  align-items: center;
  justify-content: center;
}

#matewa-widget .matewa-cta-copy strong,
#matewa-widget .matewa-cta-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  color: inherit;
  font-size: 12.5px;
  line-height: 1.12;
  font-weight: 850;
  white-space: normal;
  overflow: visible;
  text-align: center;
}

#matewa-widget .matewa-cta-label-line {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

#matewa-widget .matewa-cta-copy small {
  display: none;
}

#matewa-widget .matewa-location-prompt {
  display: grid;
  gap: 7px;
  padding: 11px;
  border: 1px solid rgba(5, 122, 41, 0.22);
  border-radius: 14px;
  background: #f3fbf6;
  color: #173f2a;
  text-align: left;
}

#matewa-widget .matewa-location-prompt strong {
  font-size: 13px;
  line-height: 1.25;
  font-weight: 850;
}

#matewa-widget .matewa-location-prompt span {
  font-size: 11px;
  line-height: 1.4;
  font-weight: 600;
}

#matewa-widget .matewa-location-continue {
  min-height: 40px;
  margin-top: 2px;
  padding: 8px 12px;
  border: 0;
  border-radius: 10px;
  background: #15803d;
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 800;
  cursor: pointer;
}

#matewa-widget .matewa-location-continue:disabled {
  opacity: .7;
  cursor: wait;
}

#matewa-wrapper[dir="rtl"] #matewa-widget .matewa-location-prompt {
  text-align: right;
}

@media (max-width: 420px) {
  #matewa-widget {
    left: 12px !important;
    right: 12px !important;
    bottom: 86px !important;
    width: auto;
    max-width: none;
    height: min(520px, calc(100vh - 112px));
    transform: none !important;
  }

  #matewa-widget .matewa-bubbles {
    padding: 14px;
    padding-bottom: 122px;
  }

  #matewa-widget .matewa-task .matewa-chip .matewa-chip-label {
    font-size: 10.8px !important;
  }

  #matewa-widget .matewa-cta-copy strong,
  #matewa-widget .matewa-cta-label {
    font-size: 12.5px;
  }
}

/* =========================================================
   ACCESSIBILITY QA 5-A-8 — FOCUS, CONTRAST AND MOTION
   Minimum CSS only. No widget flow or phone logic changes.
   MIN FIX — replaces harsh black browser-style outline
   with branded accessible green focus ring.
========================================================= */

:root {
  --matewa-accent: #15803d;
  --matewa-accent-dark: #057a29;
}

#matewa-launcher:focus-visible,
#matewa-widget .matewa-chip:focus-visible,
#matewa-widget .matewa-phone-code:focus-visible,
#matewa-widget .matewa-phone-country-option:focus-visible,
#matewa-widget input:focus-visible,
#matewa-widget textarea:focus-visible,
#matewa-widget .matewa-branding a:focus-visible {
  outline: 3px solid rgba(21, 128, 61, 0.58) !important;
  outline-offset: 3px !important;
  box-shadow:
    0 0 0 4px rgba(21, 128, 61, 0.14),
    0 8px 18px rgba(15, 23, 42, 0.08) !important;
}

#matewa-widget .matewa-close:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.96) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 5px rgba(21, 128, 61, 0.34) !important;
}

#matewa-widget .matewa-chip:focus-visible,
#matewa-widget .matewa-phone-code:focus-visible,
#matewa-widget .matewa-phone-country-option:focus-visible {
  box-shadow:
    0 0 0 4px rgba(21, 128, 61, 0.16),
    0 10px 22px rgba(15, 23, 42, 0.10) !important;
}

#matewa-widget .matewa-chip.is-selected:focus-visible,
#matewa-widget .matewa-cta .matewa-chip.is-selected:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.96) !important;
  outline-offset: 3px !important;
  box-shadow:
    0 0 0 6px rgba(21, 128, 61, 0.38),
    0 10px 22px rgba(15, 23, 42, 0.12) !important;
}

@media (prefers-reduced-motion: reduce) {
  #matewa-launcher,
  #matewa-widget,
  #matewa-widget * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
/* 247ChatMate language selector */
#matewa-widget .matewa-lang-switcher {
  position: relative;
  display: flex;
  align-items: center;
  margin-left: auto;
  margin-right: 6px;
  z-index: 30;
}

#matewa-widget .matewa-lang-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 30px;
  min-width: 118px;
  max-width: 158px;
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  color: #fff;
  font-size: 12.5px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 3px 10px rgba(0,0,0,.10);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

#matewa-widget .matewa-lang-button:hover,
#matewa-widget .matewa-lang-button[aria-expanded="true"] {
  background: rgba(255,255,255,.24);
  border-color: rgba(255,255,255,.58);
}

#matewa-widget .matewa-lang-name {
  display: inline-block;
  max-width: 104px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#matewa-widget .matewa-lang-flag {
  width: 21px;
  height: 15px;
  border-radius: 3px;
  object-fit: cover;
  flex: 0 0 21px;
  box-shadow: 0 0 0 1px rgba(255,255,255,.75), 0 1px 3px rgba(0,0,0,.20);
}

#matewa-widget .matewa-lang-globe { display: none !important; }
#matewa-widget .matewa-lang-fallback { display: none !important; }
#matewa-widget .matewa-lang-emoji {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 22px;
  font-size: 18px;
  line-height: 1;
  filter: saturate(1.18);
}

#matewa-widget .matewa-lang-caret {
  font-size: 10px;
  opacity: .95;
  flex: 0 0 auto;
  transform: translateY(-1px);
}

#matewa-widget .matewa-lang-menu {
  position: absolute;
  top: 36px;
  right: 0;
  width: 232px;
  max-height: 204px; /* roughly 5 languages visible */
  overflow-y: auto;
  padding: 7px;
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(0,0,0,.24);
  z-index: 9999;
  overscroll-behavior: contain;
}

#matewa-widget .matewa-lang-menu::-webkit-scrollbar {
  width: 8px;
}

#matewa-widget .matewa-lang-menu::-webkit-scrollbar-thumb {
  background: rgba(20, 184, 112, .35);
  border-radius: 999px;
}

#matewa-widget .matewa-lang-option {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 10px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #12231f;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

#matewa-widget .matewa-lang-option .matewa-lang-globe { display: none !important; }

#matewa-widget .matewa-lang-option .matewa-lang-option-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

#matewa-widget .matewa-lang-option:hover,
#matewa-widget .matewa-lang-option[aria-selected="true"] {
  background: rgba(20, 184, 112, .13);
  color: #14532d;
}

#matewa-widget .matewa-lang-loader {
  position: absolute;
  inset: 52px 0 28px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.98);
  z-index: 20;
  pointer-events: none;
}

#matewa-widget .matewa-lang-loader-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 42px);
  padding: 12px 16px;
  border: 1px solid rgba(20,184,112,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.94);
  box-shadow: 0 10px 28px rgba(15,23,42,.12);
  color: #14532d;
  font-size: 12.5px;
  font-weight: 800;
}

#matewa-widget .matewa-lang-spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(20,184,112,.22);
  border-top-color: rgba(20,184,112,.95);
  border-radius: 50%;
  animation: matewa-lang-spin .75s linear infinite;
  flex: 0 0 auto;
}

#matewa-widget .matewa-lang-loader-text {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@keyframes matewa-lang-spin {
  to { transform: rotate(360deg); }
}


/* Strict language loading: never show half-English content while a selected language is being prepared. */
#matewa-widget.matewa-lang-loading .matewa-stream,
#matewa-widget.matewa-lang-loading .matewa-cta {
  visibility: hidden !important;
}
#matewa-widget.matewa-lang-loading .matewa-branding {
  opacity: .28;
}

#matewa-widget .matewa-chip-translation-missing .matewa-chip-label::after {
  content: "";
}


/* Language selector off means off, including after reset/replay. */
#matewa-widget.matewa-language-selector-disabled .matewa-lang-switcher{
  display:none!important;
}


/* =========================================================
   FREEV2FIXED2X2
   Free / expired mode uses four fixed universal chips in 2 x 2.
   Paid modes retain the standard 3 x 2 vertical grid.
========================================================= */
#matewa-wrapper.matewa-mode-free .matewa-task .matewa-chip-group {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

#matewa-wrapper.matewa-mode-free .matewa-task .matewa-chip {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
}


/* 1.1.146 — Summary export is an action button, never a navigable file link. */
#matewa-widget .summary-download,
.summary-download {
  border: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.summary-download[disabled] { opacity: .68; cursor: wait; }

/* =========================================================
   1.1.229 — WIDGET SHELL POLISH ONLY
   LOCKED: no flow, copy, pacing, bubble order, control order,
   phone detector logic, widget dimensions, component dimensions,
   spacing geometry or interaction changes.
   Visual changes only: typography family/weight, colour, border,
   shadow and surface finish. No Restart control.
========================================================= */

:root {
  --matewa-font: "Manrope", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --matewa-accent: #168447;
  --matewa-accent-dark: #116f3b;
  --matewa-bg-soft: #f1f3f2;
  --matewa-bg-white: #ffffff;
  --matewa-text-main: #18211d;
  --matewa-text-muted: #66716c;
}

/* Defensive lock: Restart is not part of the approved shell. */
#matewa-widget .matewa-restart {
  display: none !important;
}

/* Shell surface: retain exact geometry, improve finish only. */
#matewa-widget {
  font-family: var(--matewa-font) !important;
  background: #f7f8f7 !important;
  border-color: rgba(24, 33, 29, 0.08) !important;
  box-shadow:
    0 28px 64px rgba(20, 32, 26, 0.20),
    0 7px 20px rgba(20, 32, 26, 0.10) !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Header: same size and placement, calmer premium green. */
#matewa-widget .matewa-header {
  background:
    linear-gradient(180deg, #1b9652 0%, #147f45 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.20),
    0 1px 0 rgba(9, 78, 39, 0.16) !important;
}

#matewa-widget .matewa-header-title {
  font-family: var(--matewa-font) !important;
  font-weight: 700 !important;
  color: #ffffff !important;
}

#matewa-widget .matewa-close {
  font-weight: 500 !important;
  color: rgba(255, 255, 255, 0.94) !important;
}

#matewa-widget .matewa-close:hover,
#matewa-widget .matewa-close:focus-visible {
  background: rgba(255, 255, 255, 0.12) !important;
}

/* Body/background: geometry untouched. */
#matewa-widget .matewa-bubbles {
  background: #f7f8f7 !important;
}

/* Conversation bubbles: quieter, less card-template-like. */
#matewa-widget .matewa-bubble {
  background: #f0f2f1 !important;
  border-color: #e2e6e4 !important;
  color: var(--matewa-text-main) !important;
  font-family: var(--matewa-font) !important;
  font-weight: 500 !important;
  box-shadow:
    0 2px 7px rgba(24, 33, 29, 0.055),
    inset 0 1px 0 rgba(255, 255, 255, 0.72) !important;
}

#matewa-widget .matewa-muted {
  background: #eef5f0 !important;
  border-color: #dce9e0 !important;
  color: #355342 !important;
  font-weight: 500 !important;
}

/* Visitor choices: same grid/card geometry, neutral premium surface. */
#matewa-widget .matewa-task .matewa-chip,
#matewa-wrapper.matewa-mode-free .matewa-task .matewa-chip {
  border-color: #d7ddda !important;
  background: #ffffff !important;
  color: #27312c !important;
  box-shadow:
    0 4px 10px rgba(24, 33, 29, 0.065),
    inset 0 1px 0 rgba(255, 255, 255, 0.96) !important;
}

#matewa-widget .matewa-task .matewa-chip .matewa-chip-label,
#matewa-wrapper.matewa-mode-free .matewa-task .matewa-chip .matewa-chip-label {
  font-family: var(--matewa-font) !important;
  font-weight: 600 !important;
  color: inherit !important;
}

#matewa-widget .matewa-task .matewa-chip:hover,
#matewa-widget .matewa-task .matewa-chip:focus-visible {
  border-color: #bfc9c3 !important;
  background: #ffffff !important;
  box-shadow:
    0 6px 14px rgba(24, 33, 29, 0.09),
    0 0 0 3px rgba(22, 132, 71, 0.08) !important;
}

#matewa-widget .matewa-task .matewa-chip.is-selected,
#matewa-wrapper.matewa-mode-free .matewa-task .matewa-chip.is-selected {
  background: linear-gradient(180deg, #1b9652 0%, #147f45 100%) !important;
  border-color: transparent !important;
  color: #ffffff !important;
  box-shadow:
    0 6px 14px rgba(20, 127, 69, 0.20),
    inset 0 1px 0 rgba(255, 255, 255, 0.20) !important;
}

/* Field labels/supporting copy: retain size/line-height, reduce visual heaviness. */
#matewa-widget .matewa-notes .matewa-bubble,
#matewa-widget .matewa-phone > .matewa-bubble,
#matewa-widget .matewa-contact > .matewa-bubble {
  color: #355342 !important;
  background: #eef5f0 !important;
  border-color: #dce9e0 !important;
  font-weight: 600 !important;
}

/* Inputs: same dimensions, neutral border until interaction. */
#matewa-widget .matewa-notes textarea,
#matewa-widget .matewa-phone input,
#matewa-widget .matewa-contact input,
#matewa-widget .matewa-phone-code {
  font-family: var(--matewa-font) !important;
  color: #1e2923 !important;
  background: #ffffff !important;
  border-color: #d1d9d5 !important;
  box-shadow:
    0 3px 9px rgba(24, 33, 29, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.92) !important;
}

#matewa-widget input::placeholder,
#matewa-widget textarea::placeholder {
  color: #7f8a84 !important;
  opacity: 1 !important;
}

#matewa-widget .matewa-phone-code {
  font-weight: 700 !important;
}

#matewa-widget .matewa-phone .matewa-char-counter,
#matewa-widget .matewa-contact .matewa-soft-hint,
#matewa-widget .matewa-char-counter {
  color: #758079 !important;
  font-weight: 500 !important;
}

/* Keep existing locked-state behaviour, refine only the paint. */
#matewa-widget .matewa-notes textarea.is-locked,
#matewa-widget .matewa-phone input.is-locked,
#matewa-widget .matewa-contact input.is-locked,
#matewa-widget .matewa-contact input.is-soft-confirmed {
  background: linear-gradient(180deg, #1b9652 0%, #147f45 100%) !important;
  border-color: transparent !important;
  color: #ffffff !important;
}

/* CTA region: preserve exact structure and geometry. */
#matewa-widget .matewa-cta {
  background: linear-gradient(
    to top,
    rgba(247, 248, 247, 0.99),
    rgba(247, 248, 247, 0.93)
  ) !important;
  box-shadow: 0 -10px 22px rgba(247, 248, 247, 0.94) !important;
}

#matewa-widget .matewa-cta-prompt,
#matewa-widget .matewa-cta-confirm {
  font-family: var(--matewa-font) !important;
  font-weight: 600 !important;
  color: #29352f !important;
}

#matewa-widget .matewa-cta .matewa-chip {
  border-color: #cad5cf !important;
  background: #ffffff !important;
  color: #147f45 !important;
  box-shadow:
    0 4px 10px rgba(24, 33, 29, 0.065),
    inset 0 1px 0 rgba(255, 255, 255, 0.96) !important;
}

#matewa-widget .matewa-cta .matewa-chip.is-selected {
  background: linear-gradient(180deg, #1b9652 0%, #147f45 100%) !important;
  border-color: transparent !important;
  color: #ffffff !important;
}

#matewa-widget .matewa-cta-copy strong,
#matewa-widget .matewa-cta-label {
  font-family: var(--matewa-font) !important;
  font-weight: 700 !important;
}

/* Location prompt + country menu: typography/surface consistency only. */
#matewa-widget .matewa-location-prompt {
  border-color: #d8e5dc !important;
  background: #f0f6f2 !important;
  color: #2b4737 !important;
}

#matewa-widget .matewa-location-prompt strong,
#matewa-widget .matewa-location-continue,
#matewa-widget .matewa-phone-country-option,
#matewa-widget .matewa-lang-button,
#matewa-widget .matewa-lang-option,
#matewa-widget .matewa-lang-loader-card {
  font-family: var(--matewa-font) !important;
}

#matewa-widget .matewa-location-prompt strong,
#matewa-widget .matewa-location-continue {
  font-weight: 700 !important;
}

#matewa-widget .matewa-location-continue {
  background: #147f45 !important;
}

#matewa-widget .matewa-phone-country-menu,
#matewa-widget .matewa-lang-menu {
  border-color: #d9dfdc !important;
  background: #ffffff !important;
  box-shadow: 0 16px 36px rgba(24, 33, 29, 0.16) !important;
}

#matewa-widget .matewa-phone-country-option,
#matewa-widget .matewa-lang-option {
  color: #29342f !important;
  font-weight: 600 !important;
}

#matewa-widget .matewa-phone-country-option:hover,
#matewa-widget .matewa-phone-country-option:focus-visible,
#matewa-widget .matewa-phone-country-option.is-selected,
#matewa-widget .matewa-lang-option:hover,
#matewa-widget .matewa-lang-option[aria-selected="true"] {
  background: #edf5f0 !important;
  color: #28533a !important;
}

#matewa-widget .matewa-lang-button {
  font-weight: 600 !important;
}

/* Branding: same position/size, more deliberate hierarchy. */
#matewa-widget .matewa-branding {
  background: #ffffff !important;
  border-top-color: #edf0ee !important;
  color: #808a85 !important;
  font-family: var(--matewa-font) !important;
  font-weight: 500 !important;
}

#matewa-widget .matewa-branding a {
  color: #537061 !important;
  font-weight: 600 !important;
}

/* Launcher: exact existing dimensions/copy, upgraded surface only. */
#matewa-launcher {
  font-family: var(--matewa-font) !important;
  font-weight: 700 !important;
  background: linear-gradient(180deg, #1b9652 0%, #147f45 100%) !important;
  box-shadow:
    0 12px 28px rgba(20, 127, 69, 0.24),
    0 4px 10px rgba(20, 32, 26, 0.10) !important;
}

/* =========================================================
   1.1.230 — CTA ALIGNMENT + FIXED-LINE CALLBACK PRESENTATION
   No widget dimension, task order, bubble order or pacing changes.
========================================================= */

/* Desktop visitor choices now share the same white/green finish as the
   approved handoff controls. Geometry remains exactly as before. */
@media (min-width: 421px) {
  #matewa-widget .matewa-task .matewa-chip,
  #matewa-wrapper.matewa-mode-free #matewa-widget .matewa-task .matewa-chip {
    border-color: #cad5cf !important;
    background: #ffffff !important;
    color: #147f45 !important;
    box-shadow:
      0 4px 10px rgba(24, 33, 29, 0.065),
      inset 0 1px 0 rgba(255, 255, 255, 0.96) !important;
  }

  #matewa-widget .matewa-task .matewa-chip:hover,
  #matewa-widget .matewa-task .matewa-chip:focus-visible {
    border-color: #aebfb5 !important;
    background: #ffffff !important;
    box-shadow:
      0 6px 14px rgba(24, 33, 29, 0.09),
      0 0 0 3px rgba(22, 132, 71, 0.08) !important;
  }
}

/* Fixed-line route uses a simple phone handset in the same icon footprint as
   WhatsApp. No button size/position changes. */
#matewa-widget .matewa-cta-phone {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M6.62 10.79a15.46 15.46 0 0 0 6.59 6.59l2.2-2.2a1 1 0 0 1 1.02-.24c1.12.37 2.33.57 3.57.57a1 1 0 0 1 1 1V20a1 1 0 0 1-1 1C10.61 21 3 13.39 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.25.2 2.45.57 3.57a1 1 0 0 1-.25 1.02l-2.2 2.2Z'/%3E%3C/svg%3E") center / 15px 15px no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M6.62 10.79a15.46 15.46 0 0 0 6.59 6.59l2.2-2.2a1 1 0 0 1 1.02-.24c1.12.37 2.33.57 3.57.57a1 1 0 0 1 1 1V20a1 1 0 0 1-1 1C10.61 21 3 13.39 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.25.2 2.45.57 3.57a1 1 0 0 1-.25 1.02l-2.2 2.2Z'/%3E%3C/svg%3E") center / 15px 15px no-repeat;
}

#matewa-widget .matewa-cta[data-route="call"] .matewa-cta-confirm {
  color: #355342 !important;
  background: #eef5f0 !important;
  border-color: #dce9e0 !important;
  font-weight: 600 !important;
}



/* =========================================================
   1.1.231 — CTA STATE TREATMENTS
   Visual-state polish only. No dimension, pacing, bubble-order,
   intro, phone-detector or handoff-order changes.
========================================================= */

/* Stronger channel marks in the existing icon footprint area. */
#matewa-widget .matewa-cta-whatsapp,
#matewa-widget .matewa-cta-phone {
  flex: 0 0 25px !important;
  width: 25px !important;
  height: 25px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background-color: currentColor !important;
  box-shadow: none !important;
}

#matewa-widget .matewa-cta-whatsapp {
  background-image: none !important;
  -webkit-mask: url('../img/whatsapp.svg') center / 24px 24px no-repeat;
  mask: url('../img/whatsapp.svg') center / 24px 24px no-repeat;
}

#matewa-widget .matewa-cta-phone {
  -webkit-mask-size: 22px 22px !important;
  mask-size: 22px 22px !important;
}

#matewa-widget .matewa-cta-copy {
  max-width: calc(100% - 31px) !important;
}

/* Default / hover / pressed states shown in the approved treatment board. */
#matewa-widget .matewa-cta .matewa-chip {
  border-color: #c8d3cd !important;
  background: #ffffff !important;
  color: #13813f !important;
  box-shadow:
    0 4px 10px rgba(24, 33, 29, 0.075),
    inset 0 1px 0 rgba(255, 255, 255, 0.98) !important;
  transition: background-color 140ms ease, border-color 140ms ease,
    box-shadow 140ms ease, color 140ms ease, transform 140ms ease !important;
}

#matewa-widget .matewa-cta .matewa-chip:hover:not(:disabled):not(.is-disabled):not(.is-selected),
#matewa-widget .matewa-cta .matewa-chip:focus-visible:not(:disabled):not(.is-disabled):not(.is-selected) {
  border-color: #9fbea9 !important;
  background: #f7fcf8 !important;
  color: #0f7838 !important;
  box-shadow:
    0 6px 14px rgba(24, 33, 29, 0.09),
    0 0 0 3px rgba(22, 132, 71, 0.075) !important;
}

#matewa-widget .matewa-cta .matewa-chip:active:not(:disabled):not(.is-disabled),
#matewa-widget .matewa-cta .matewa-chip.is-selected {
  background: linear-gradient(180deg, #20a552 0%, #148541 100%) !important;
  border-color: #148541 !important;
  color: #ffffff !important;
  box-shadow:
    0 5px 12px rgba(20, 133, 65, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.20) !important;
}

/* Disabled treatment is ready for any existing/current availability rule. */
#matewa-widget .matewa-cta .matewa-chip:disabled,
#matewa-widget .matewa-cta .matewa-chip.is-disabled,
#matewa-widget .matewa-cta .matewa-chip[aria-disabled="true"] {
  border-color: #e0e4e2 !important;
  background: #f7f8f7 !important;
  color: #a4aba7 !important;
  box-shadow: none !important;
  cursor: not-allowed !important;
  opacity: 1 !important;
}

/* Existing selected interval becomes the visual opening state; timing is unchanged. */
#matewa-widget .matewa-cta .matewa-chip.is-loading {
  position: relative;
}

#matewa-widget .matewa-cta .matewa-chip.is-loading .matewa-cta-whatsapp {
  -webkit-mask: none !important;
  mask: none !important;
  width: 20px !important;
  height: 20px !important;
  flex-basis: 20px !important;
  border-radius: 999px !important;
  background: conic-gradient(from 0deg, rgba(255,255,255,.24), #ffffff) !important;
  position: relative;
}

#matewa-widget .matewa-cta .matewa-chip.is-loading .matewa-cta-whatsapp::after {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 999px;
  background: #1a9149;
}

#matewa-widget .matewa-cta .matewa-chip.is-loading .matewa-cta-whatsapp {
  animation: matewa-cta-spin .72s linear infinite;
}

@keyframes matewa-cta-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  #matewa-widget .matewa-cta .matewa-chip.is-loading .matewa-cta-whatsapp {
    animation: none !important;
  }
}

/* Callback helper card: same CTA slot and same confirmation timing. */
#matewa-widget .matewa-cta[data-route="call"] .matewa-cta-confirm {
  position: relative;
  min-height: 50px;
  padding: 9px 11px 9px 43px !important;
  text-align: left !important;
  color: #235c38 !important;
  background: #f3faf5 !important;
  border-color: #bcdcc7 !important;
  box-shadow:
    0 4px 10px rgba(24, 80, 43, 0.055),
    inset 0 1px 0 rgba(255,255,255,.95) !important;
}

#matewa-widget .matewa-cta[data-route="call"] .matewa-cta-confirm::before {
  content: '✓';
  position: absolute;
  left: 12px;
  top: 50%;
  width: 23px;
  height: 23px;
  transform: translateY(-50%);
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #159447;
  color: #ffffff;
  font-family: var(--matewa-font);
  font-size: 14px;
  line-height: 1;
  font-weight: 800;
}


/* =========================================================
   1.1.236 — Widget callback requested-time step
   Uses the existing CTA area after an explicit Call later choice.
========================================================= */
#matewa-widget .matewa-callback-time{display:grid;gap:8px;width:100%}
#matewa-widget .matewa-callback-time__field{display:grid;gap:5px;padding:9px 10px;border:1px solid #dce6df;border-radius:12px;background:#fff;color:#53645b;font-size:11px;font-weight:600}
#matewa-widget .matewa-callback-time__input{width:100%;min-height:38px;box-sizing:border-box;border:1px solid #cbd8cf;border-radius:9px;background:#fff;color:#17251d;padding:7px 9px;font:600 12px/1.2 var(--matewa-font);outline:none}
#matewa-widget .matewa-callback-time__input:focus{border-color:#78ad8a;box-shadow:0 0 0 3px rgba(21,148,71,.08)}
#matewa-widget .matewa-callback-time__actions{display:grid;grid-template-columns:.72fr 1.28fr;gap:8px}
#matewa-widget .matewa-callback-time__actions button{min-height:40px;border-radius:10px;font:700 11px/1.15 var(--matewa-font);cursor:pointer}
#matewa-widget .matewa-callback-time__back{border:1px solid #d4ddd7;background:#fff;color:#4e6256}
#matewa-widget .matewa-callback-time__continue{border:1px solid #148541;background:#168d46;color:#fff}
#matewa-widget .matewa-callback-time__continue:disabled{opacity:.6;cursor:wait}

/* ---------------------------------------------------------
   EMERGENCY DECISION — CANONICAL REBUILD 1.1.270
   Same widget shell. No outer scroll on intent/chips stage.
   Only the 140-character notes field may scroll internally.
--------------------------------------------------------- */
#matewa-widget.matewa-intent-stage .matewa-bubbles {
  overflow-y: hidden !important;
}

#matewa-widget .matewa-emergency-fork[hidden],
#matewa-widget .matewa-emergency-phone-helper[hidden] {
  display: none !important;
}

#matewa-widget .matewa-notes.has-emergency-fork .matewa-notes-textarea {
  height: 48px !important;
  min-height: 48px !important;
  max-height: 48px !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  resize: none !important;
  scrollbar-width: thin;
}

#matewa-widget .matewa-emergency-fork {
  width: 100%;
  margin: 8px 0 0;
  box-sizing: border-box;
}

/* =========================================================
   1.9.100 — native widget callback calendar
   The saved callback contract is unchanged: local selection becomes an
   absolute Unix timestamp plus the existing human-readable window label.
========================================================= */
#matewa-widget .matewa-header-brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0;
}
#matewa-widget .matewa-header-logo{
  display:block;
  width:34px;
  height:34px;
  flex:0 0 34px;
  object-fit:cover;
  border-radius:10px;
  box-shadow:0 3px 9px rgba(7,67,34,.26),inset 0 1px 0 rgba(255,255,255,.28);
}
#matewa-widget .matewa-branding a{
  color:#168447!important;
  font-weight:650!important;
  text-decoration:none!important;
  text-shadow:0 0 7px rgba(22,132,71,.26),0 0 14px rgba(22,132,71,.12);
  transition:color .18s ease,text-shadow .18s ease;
}
#matewa-widget .matewa-branding a:hover,
#matewa-widget .matewa-branding a:focus-visible{
  color:#116f3b!important;
  text-decoration:none!important;
  text-shadow:0 0 7px rgba(22,132,71,.42),0 0 18px rgba(22,132,71,.22);
}
#matewa-widget .matewa-cta.matewa-cta--callback{
  top:72px;
  bottom:40px;
  padding:7px 14px 10px;
  overflow-x:hidden;
  overflow-y:auto;
  overscroll-behavior:contain;
  -webkit-overflow-scrolling:touch;
  background:#f7f8f7!important;
  box-shadow:none!important;
}
#matewa-widget .matewa-callback-time{
  display:grid;
  gap:8px;
  width:100%;
}
#matewa-widget .matewa-callback-time__field{
  display:grid;
  gap:7px;
  padding:10px;
  border:1px solid #dce6df;
  border-radius:12px;
  background:#fff;
  color:#53645b;
  font-size:11px;
  font-weight:600;
  box-shadow:0 4px 10px rgba(24,33,29,.055),inset 0 1px 0 rgba(255,255,255,.96);
}
#matewa-widget .matewa-callback-time__month{
  display:grid;
  grid-template-columns:29px minmax(0,1fr) 29px;
  gap:5px;
  align-items:center;
}
#matewa-widget .matewa-callback-time__month-label{
  min-width:0;
  overflow:hidden;
  color:#27312c;
  font-size:13px;
  font-weight:700;
  text-align:center;
  text-overflow:ellipsis;
  white-space:nowrap;
}
#matewa-widget .matewa-callback-time__month-button{
  width:29px;
  height:29px;
  display:grid;
  place-items:center;
  padding:0;
  border:1px solid #d7ddda;
  border-radius:9px;
  background:#fff;
  color:#526058;
  font:500 18px/1 var(--matewa-font);
  cursor:pointer;
}
#matewa-widget .matewa-callback-time__month-button:disabled{
  color:#bdc5c0;
  background:#f7f8f7;
  cursor:not-allowed;
}
#matewa-widget .matewa-callback-time__week,
#matewa-widget .matewa-callback-time__days{
  display:grid;
  grid-template-columns:repeat(7,minmax(0,1fr));
  gap:3px;
}
#matewa-widget .matewa-callback-time__week span{
  min-width:0;
  overflow:hidden;
  padding:2px 0 4px;
  color:#89938d;
  font-size:8px;
  line-height:1;
  font-weight:700;
  text-align:center;
  text-overflow:ellipsis;
  text-transform:none;
  white-space:nowrap;
}
#matewa-widget .matewa-callback-time__day{
  width:100%;
  min-width:0;
  height:27px;
  display:grid;
  place-items:center;
  padding:0;
  border:0;
  border-radius:8px;
  background:transparent;
  color:#35423b;
  font:600 11px/1 var(--matewa-font);
  cursor:pointer;
}
#matewa-widget .matewa-callback-time__day.is-other{color:#aeb8b2}
#matewa-widget .matewa-callback-time__day.is-today{box-shadow:inset 0 0 0 1px #9cc7ac}
#matewa-widget .matewa-callback-time__day:hover:not(:disabled),
#matewa-widget .matewa-callback-time__day:focus-visible:not(:disabled){background:#eef5f0;color:#176f3d}
#matewa-widget .matewa-callback-time__day.is-selected{
  color:#fff;
  background:linear-gradient(180deg,#1b9652 0%,#147f45 100%);
  box-shadow:0 4px 9px rgba(20,127,69,.21),inset 0 1px 0 rgba(255,255,255,.20);
}
#matewa-widget .matewa-callback-time__day:disabled{
  color:#ccd2ce;
  cursor:not-allowed;
  box-shadow:none;
}
#matewa-widget .matewa-callback-time__time-title{
  margin:1px 1px -1px;
  color:#53645b;
  font-size:10px;
  font-weight:700;
}
#matewa-widget .matewa-callback-time__times{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:6px;
  max-height:70px;
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-width:thin;
}
#matewa-widget .matewa-callback-time__no-times{
  grid-column:1/-1;
  padding:9px 8px;
  border:1px dashed #d7ddda;
  border-radius:9px;
  background:#f7f8f7;
  color:#718078;
  font:600 9px/1.35 var(--matewa-font);
  text-align:center;
}
#matewa-widget .matewa-callback-time__time{
  min-width:0;
  min-height:32px;
  padding:5px 3px;
  border:1px solid #d7ddda;
  border-radius:9px;
  background:#fff;
  color:#34433b;
  font:650 10px/1 var(--matewa-font);
  cursor:pointer;
}
#matewa-widget .matewa-callback-time__time:hover:not(:disabled),
#matewa-widget .matewa-callback-time__time:focus-visible:not(:disabled){border-color:#bfc9c3;background:#f5faf7}
#matewa-widget .matewa-callback-time__time.is-selected{
  border-color:#78ad8a;
  background:#eef5f0;
  color:#146f3c;
  box-shadow:0 0 0 2px rgba(21,148,71,.07);
}
#matewa-widget .matewa-callback-time__time:disabled{
  color:#b9c1bc;
  background:#f7f8f7;
  cursor:not-allowed;
}
#matewa-widget .matewa-callback-time__selection{
  display:flex;
  align-items:center;
  gap:7px;
  min-width:0;
  padding:7px 8px;
  border-radius:9px;
  background:#f3f8f5;
  color:#355342;
}
#matewa-widget .matewa-callback-time__calendar-icon{
  width:22px;
  height:22px;
  display:grid;
  place-items:center;
  flex:0 0 22px;
  border-radius:7px;
  background:#fff;
  color:#168447;
  box-shadow:0 2px 5px rgba(24,80,43,.08);
}
#matewa-widget .matewa-callback-time__calendar-icon::before{
  content:'';
  width:12px;
  height:12px;
  border:1.5px solid currentColor;
  border-radius:3px;
  background:linear-gradient(currentColor,currentColor) 0 3px/100% 1.5px no-repeat;
}
#matewa-widget .matewa-callback-time__selection-copy{min-width:0}
#matewa-widget .matewa-callback-time__selection strong{
  display:block;
  overflow:hidden;
  color:#355342;
  font-size:10px;
  line-height:1.25;
  font-weight:700;
  text-overflow:ellipsis;
  white-space:nowrap;
}
#matewa-widget .matewa-callback-time__selection small{
  display:block;
  margin-top:1px;
  overflow:hidden;
  color:#718078;
  font-size:8px;
  line-height:1.2;
  font-weight:500;
  text-overflow:ellipsis;
  white-space:nowrap;
}
#matewa-widget .matewa-callback-time__actions{
  display:grid;
  grid-template-columns:.72fr 1.28fr;
  gap:8px;
}
#matewa-widget .matewa-callback-time__actions button{
  min-height:40px;
  border-radius:10px;
  font:700 11px/1.15 var(--matewa-font);
  cursor:pointer;
}
#matewa-widget .matewa-callback-time__back{border:1px solid #d4ddd7;background:#fff;color:#4e6256}
#matewa-widget .matewa-callback-time__continue{
  border:1px solid #148541;
  background:#168d46;
  color:#fff;
  box-shadow:0 5px 11px rgba(20,127,69,.18),inset 0 1px 0 rgba(255,255,255,.18);
}
#matewa-widget .matewa-callback-time__continue:disabled{opacity:.6;cursor:not-allowed}

#matewa-widget .matewa-callback-confirm{
  display:flex;
  align-items:center;
  gap:12px;
  width:100%;
  padding:15px;
  border:1px solid #dce6df;
  border-radius:14px;
  background:#fff;
  color:#34433b;
  box-shadow:0 5px 15px rgba(24,80,43,.08);
}
#matewa-widget .matewa-callback-confirm__icon{
  width:34px;
  height:34px;
  display:grid;
  place-items:center;
  flex:0 0 34px;
  border-radius:11px;
  background:#eef7f1;
  color:#168447;
}
#matewa-widget .matewa-callback-confirm__icon::before{
  content:'';
  width:15px;
  height:15px;
  border:2px solid currentColor;
  border-radius:50%;
  background:linear-gradient(currentColor,currentColor) 50% 2px/2px 6px no-repeat,
    linear-gradient(45deg,transparent 45%,currentColor 46% 55%,transparent 56%) 8px 7px/5px 5px no-repeat;
}
#matewa-widget .matewa-callback-confirm > span:last-child{display:grid;gap:3px;min-width:0}
#matewa-widget .matewa-callback-confirm strong{font-size:13px;line-height:1.25;color:#27352d}
#matewa-widget .matewa-callback-confirm small{font-size:11px;line-height:1.3;color:#168447;font-weight:700}
#matewa-widget .matewa-callback-confirm em{font-size:10px;line-height:1.35;color:#6b7c72;font-style:normal}
#matewa-widget .matewa-callback-confirm--saving .matewa-callback-confirm__icon::before{
  border-right-color:transparent;
  background:none;
  animation:matewaCallbackSpin .8s linear infinite;
}
#matewa-widget .matewa-callback-confirm--booked{
  border-color:#cfe8d7;
  background:linear-gradient(180deg,#ffffff 0%,#f5fbf7 100%);
}
@keyframes matewaCallbackSpin{to{transform:rotate(360deg)}}

@media(max-height:620px){
  #matewa-widget .matewa-cta.matewa-cta--callback{top:66px}
}

#matewa-widget .matewa-emergency-question {
  width: 100%;
  min-height: 38px;
  margin: 0 0 8px;
  padding: 8px 10px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid #efb4b8;
  border-radius: 12px;
  background: #fff5f5;
  color: #b42318;
  font-size: 12px;
  line-height: 1.25;
  font-weight: 700;
  text-align: center;
}

#matewa-widget .matewa-emergency-symbol,
#matewa-widget .matewa-emergency-choice-icon {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  min-height: 18px !important;
  max-height: 18px !important;
  flex: 0 0 18px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

#matewa-widget .matewa-emergency-symbol svg,
#matewa-widget .matewa-emergency-choice-icon svg {
  display: block !important;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  max-width: 18px !important;
  min-height: 18px !important;
  max-height: 18px !important;
  overflow: visible;
}

#matewa-widget .matewa-chip-group--emergency {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 8px !important;
  width: 100% !important;
  margin: 0 !important;
}

#matewa-widget .matewa-chip-group--emergency .matewa-emergency-choice {
  width: 100% !important;
  height: 48px !important;
  min-height: 48px !important;
  padding: 6px 8px !important;
  box-sizing: border-box !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  border: 1px solid #cad5cf !important;
  border-radius: 12px !important;
  background: #fff !important;
  color: #147f45 !important;
  box-shadow: 0 4px 10px rgba(24,33,29,.075) !important;
  font-size: 11.5px !important;
  line-height: 1.15 !important;
  font-weight: 700 !important;
  text-align: center !important;
}

#matewa-widget .matewa-chip-group--emergency .matewa-emergency-yes.is-selected {
  background: #d11f2d !important;
  border-color: #d11f2d !important;
  color: #fff !important;
}

#matewa-widget .matewa-chip-group--emergency .matewa-emergency-no.is-selected {
  background: #168a4b !important;
  border-color: #168a4b !important;
  color: #fff !important;
}

#matewa-widget .matewa-emergency-phone-helper {
  margin-top: 8px;
  color: #b42318;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 700;
}


/* =========================================================
   1.1.272 — EMERGENCY GEOMETRY / PHONE CTA POLISH
   - emergency fork clears footer and never exposes notes counter
   - emergency helper sits directly beneath phone field
   - confirmed emergency CTA is a single full-width primary action
   ========================================================= */
#matewa-widget .matewa-char-counter[hidden] { display:none !important; }

#matewa-widget.matewa-intent-stage .matewa-bubbles {
  padding-bottom: 64px !important;
}

#matewa-widget .matewa-notes.has-emergency-fork {
  padding-bottom: 10px !important;
}

#matewa-widget .matewa-notes.has-emergency-fork .matewa-emergency-fork {
  margin-bottom: 6px !important;
}

#matewa-widget.matewa-phone-stage .matewa-bubbles {
  padding-top: 14px !important;
  padding-bottom: 154px !important;
  overflow-y: hidden !important;
}

#matewa-widget.matewa-phone-stage .matewa-phone {
  display:flex !important;
  flex-direction:column !important;
  gap:8px !important;
}

#matewa-widget.matewa-phone-stage .matewa-phone .matewa-bubble {
  margin-bottom:0 !important;
}

#matewa-widget.matewa-phone-stage .matewa-phone .matewa-char-counter {
  position:static !important;
  right:auto !important;
  bottom:auto !important;
  margin:0 10px !important;
  min-height:14px !important;
}

#matewa-widget.matewa-phone-stage .matewa-emergency-phone-helper {
  margin:0 0 0 0 !important;
  padding:0 2px !important;
  font-size:11px !important;
  line-height:1.28 !important;
}

#matewa-widget[data-emergency-confirmed="1"] .matewa-cta {
  bottom:40px !important;
  padding:8px 14px 10px !important;
  gap:8px !important;
}

#matewa-widget[data-emergency-confirmed="1"] .matewa-cta .matewa-chip-group {
  display:grid !important;
  grid-template-columns:minmax(0,1fr) !important;
  width:100% !important;
  gap:0 !important;
}

#matewa-widget[data-emergency-confirmed="1"] .matewa-cta .matewa-chip {
  width:100% !important;
  max-width:none !important;
  height:58px !important;
  min-height:58px !important;
  padding:8px 16px !important;
  font-size:15px !important;
  justify-content:center !important;
}

#matewa-widget[data-emergency-confirmed="1"] .matewa-cta .matewa-cta-label,
#matewa-widget[data-emergency-confirmed="1"] .matewa-cta .matewa-cta-copy strong {
  font-size:15px !important;
  line-height:1.15 !important;
  font-weight:800 !important;
}

#matewa-widget[data-emergency-confirmed="1"] .matewa-cta-phone {
  width:22px !important;
  height:22px !important;
  flex:0 0 22px !important;
}
\n\n/* =========================================================
   1.1.274 — EMERGENCY VIEWPORT + CTA OWNERSHIP
   Keep both emergency decisions completely above the fixed footer.
   The 140-character field remains the only internal scroll owner.
   ========================================================= */
#matewa-widget .matewa-notes.has-emergency-fork .matewa-notes-textarea {
  height: 42px !important;
  min-height: 42px !important;
  max-height: 42px !important;
  overflow-y: auto !important;
}
#matewa-widget .matewa-notes.has-emergency-fork .matewa-emergency-fork {
  margin-top: 3px !important;
  margin-bottom: 12px !important;
}
#matewa-widget .matewa-notes.has-emergency-fork .matewa-emergency-question {
  min-height: 36px !important;
  margin-bottom: 5px !important;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}
#matewa-widget .matewa-notes.has-emergency-fork .matewa-chip-group--emergency .matewa-emergency-choice {
  height: 46px !important;
  min-height: 46px !important;
}
#matewa-widget.matewa-intent-stage .matewa-bubbles {
  padding-bottom: 52px !important;
  overflow-y: hidden !important;
}

/* 1.1.281: functional no-mobile route; existing widget/card styling unchanged. */
#matewa-widget .matewa-phone-email-fallback {
  display: block;
  margin: 8px auto 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #082554;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}
#matewa-widget .matewa-phone-email-fallback[hidden] { display: none; }


/* 1.9.2 — calm post-handoff footer before automatic widget close */
.matewa-cta-confirm__footer{margin-top:8px;padding-top:7px;border-top:1px solid rgba(8,37,84,.10);font:600 11px/1.35 Manrope,sans-serif;color:#6f8092;text-align:center}

/* v1.9.77 — final two-choice CTA: stable green selection, no sticky white hover. */
#matewa-widget .matewa-cta .matewa-cta-chip:not(.is-selected),
#matewa-widget .matewa-cta .matewa-cta-chip:not(.is-selected):hover,
#matewa-widget .matewa-cta .matewa-cta-chip:not(.is-selected):active,
#matewa-widget .matewa-cta .matewa-cta-chip:not(.is-selected):focus {
  background: #edf8f0 !important;
  color: #147f45 !important;
}
#matewa-widget .matewa-cta .matewa-cta-chip.is-selected,
#matewa-widget .matewa-cta .matewa-cta-chip.is-selected:hover,
#matewa-widget .matewa-cta .matewa-cta-chip.is-selected:active,
#matewa-widget .matewa-cta .matewa-cta-chip.is-selected:focus {
  background: #168849 !important;
  color: #ffffff !important;
  border-color: #168849 !important;
}
/* Desktop mouse hover matches the resting colour; selection alone changes state. */
@media (hover: hover) and (pointer: fine) {
  #matewa-widget .matewa-cta .matewa-cta-chip:not(.is-selected):hover {
    background: #edf8f0 !important;
    color: #147f45 !important;
  }
}

/* v1.9.79 — final CTA selected state: hover/focus cannot turn it white. */
#matewa-widget .matewa-cta button.matewa-chip.matewa-cta-chip.is-selected,
#matewa-widget .matewa-cta button.matewa-chip.matewa-cta-chip.is-selected:hover,
#matewa-widget .matewa-cta button.matewa-chip.matewa-cta-chip.is-selected:focus,
#matewa-widget .matewa-cta button.matewa-chip.matewa-cta-chip.is-selected:focus-visible,
#matewa-widget .matewa-cta button.matewa-chip.matewa-cta-chip.is-selected:active {
  background: #168849 !important;
  background-color: #168849 !important;
  background-image: none !important;
  color: #fff !important;
  border-color: #168849 !important;
}
#matewa-widget .matewa-cta button.matewa-chip.matewa-cta-chip.is-selected:hover .matewa-cta-label,
#matewa-widget .matewa-cta button.matewa-chip.matewa-cta-chip.is-selected:hover .matewa-cta-copy {
  color: #fff !important;
}

/* v1.9.85 — canonical selected state for the MAIN task chips; beat all legacy hover/focus rules. */
#matewa-widget .matewa-task button.matewa-chip.is-selected,
#matewa-widget .matewa-task button.matewa-chip.is-selected:hover,
#matewa-widget .matewa-task button.matewa-chip.is-selected:focus,
#matewa-widget .matewa-task button.matewa-chip.is-selected:focus-visible,
#matewa-widget .matewa-task button.matewa-chip.is-selected:active,
#matewa-wrapper.matewa-mode-free #matewa-widget .matewa-task button.matewa-chip.is-selected:hover {
  background: #168849 !important; background-color: #168849 !important;
  background-image: none !important; color: #fff !important; border-color: #168849 !important;
}
#matewa-widget .matewa-task button.matewa-chip.is-selected:hover *,
#matewa-widget .matewa-task button.matewa-chip.is-selected:focus * { color: #fff !important; }

/* Scheduled WhatsApp confirmation keeps its fallback below the saved time. */
#matewa-widget .matewa-callback-confirm.matewa-cta-confirm{flex-wrap:wrap;text-align:start}
#matewa-widget .matewa-callback-confirm.matewa-cta-confirm>span:nth-child(2){display:grid;gap:4px;min-width:0;flex:1;overflow-wrap:anywhere}
#matewa-widget .matewa-callback-confirm.matewa-cta-confirm>#cmWhatsAppWebFallback{display:block;flex:0 0 100%;width:100%;padding-top:8px;border-top:1px solid #dce6df;font:500 12px/1.4 var(--matewa-font);text-align:center;color:#176148;overflow-wrap:anywhere}

/* Calendar grid rows preserve seven columns and semantic keyboard navigation. */
#matewa-widget .matewa-callback-time__days{display:flex;flex-direction:column;gap:3px}
#matewa-widget .matewa-callback-time__days > [role="row"]{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px}

#matewa-widget .matewa-sms-fallback-choice{display:block;margin:9px auto 0;padding:8px 10px;max-width:100%;border:1px solid #aac8b7;border-radius:8px;background:#f5faf7;color:#14533c;font:600 12px/1.4 var(--matewa-font);cursor:pointer;white-space:normal}
#matewa-widget .matewa-channel-fallbacks{display:flex;flex:0 0 100%;width:100%;flex-direction:column;gap:9px;margin-top:9px;padding-top:9px;border-top:1px solid #dce6df;font:500 12px/1.4 var(--matewa-font);overflow-wrap:anywhere}
#matewa-widget .matewa-channel-fallbacks a{color:#14533c;text-decoration:underline}
#matewa-widget .matewa-channel-fallbacks button{padding:8px;border:1px solid #aac8b7;border-radius:8px;background:#f5faf7;color:#14533c;font:inherit;cursor:pointer}
