/* =========================================
   Chat wrapper
   ========================================= */
.sai-chat-wrapper {
    /* fallback values; PHP inline style će ih pregaziti iz Settings → Frontend */
    --sai-bg:#ffffff;
    --sai-border:#e5e7eb;
    --sai-user-bg:#4f46e5;
    --sai-user-text:#ffffff;
    --sai-assistant-bg:#f3f4f6;
    --sai-assistant-text:#111827;
    --sai-radius:12px;
    --sai-accent:#4f46e5;
    --sai-font: system-ui, -apple-system, BlinkMacSystemFont, "Inter", Roboto, sans-serif;

    /* advanced style vars */
    --sai-shadow:none;
    --sai-avatar-radius:50%;
    --sai-messages-max-h:320px;
    --sai-send-icon-color:#fff;

    font-family: var(--sai-font, system-ui, -apple-system, BlinkMacSystemFont, "Inter", Roboto, sans-serif);
    font-size: 14px;
    line-height: 1.4;

    background: var(--sai-bg);
    border: 1px solid var(--sai-border);
    border-radius: var(--sai-radius);
    box-shadow: var(--sai-shadow);

    display: flex;
    flex-direction: column;

    max-width: 400px;
    width: 100%;
}

/* =========================================
   Messages scroll area
   ========================================= */
.sai-messages {
    /* univerzalni padding oko liste poruka */
    padding: 12px 16px;
    max-height: var(--sai-messages-max-h, 320px);
    overflow-y: auto;

    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* prva poruka u logu normalno nema ekstra razmak */
.sai-messages > .sai-msg:first-child {
    margin-top: 0;
}

/* ali ako je baš intro message, daj joj malo zraka od ruba kartice */
.sai-messages > .sai-msg:first-child.sai-msg-intro {
    margin-top: 8px;
}

/* =========================================
   Single message row
   ========================================= */
.sai-msg {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

/* User message row should push bubble to the right */
.sai-msg-user {
    justify-content: flex-end;
}

/* =========================================
   Bubbles
   ========================================= */

/* User bubble */
.sai-msg-user .sai-bubble {
    background: var(--sai-user-bg);
    color: var(--sai-user-text);
    border-radius: var(--sai-radius) var(--sai-radius) 4px var(--sai-radius);
    max-width: 80%;
    padding: 10px 12px;
    margin-left: auto;
    word-break: break-word;
    white-space: pre-line;
}

/* Assistant bubble */
.sai-msg-assistant .sai-bubble {
    background: var(--sai-assistant-bg);
    color: var(--sai-assistant-text);
    border-radius: var(--sai-radius) var(--sai-radius) var(--sai-radius) 4px;
    max-width: 80%;
    padding: 10px 12px;
    word-break: break-word;
    white-space: pre-line;
}

/* Lists inside assistant bubbles: reset white-space so \n between <li> tags
   doesn't create extra blank lines (bubble uses white-space:pre-line globally) */
.sai-msg-assistant .sai-bubble ul,
.sai-msg-assistant .sai-bubble ol {
    white-space: normal;
    margin: 4px 0;
    padding-left: 20px;
}
.sai-msg-assistant .sai-bubble li {
    white-space: normal;
    margin-bottom: 2px;
}
.sai-msg-assistant .sai-bubble li:last-child {
    margin-bottom: 0;
}

/* Make links in assistant answers clearly styled: accent color + bold */
.sai-msg-assistant .sai-bubble a {
  color: var(--sai-accent);
  font-weight: 600;
  text-decoration: none;
}
.sai-msg-assistant .sai-bubble a:hover,
.sai-msg-assistant .sai-bubble a:focus {
  text-decoration: underline;
}

/* Intro bubble override:
   - bez sive ploče
   - bez dodatnog paddinga
   - normalni paragraf tekst
*/
.sai-msg-intro .sai-bubble.sai-intro-bubble {
    background: #f3f4f6;
    color: var(--sai-assistant-text, #111827);
    border: 1px solid var(--sai-border, #e5e7eb);
    text-align: left;
    margin-left: auto;
    margin-bottom: 18px;

    color: var(--sai-assistant-text);
    max-width: 100%;
    line-height: 1.45;
    font-weight: 400;
    white-space: normal;
    word-break: break-word;
}

/* =========================================
   Avatar (assistant side)
   ========================================= */
.sai-avatar {
    width: 28px;
    height: 28px;
    border-radius: var(--sai-avatar-radius);
    flex-shrink: 0;
    background: var(--sai-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    line-height: 1;
}
.sai-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* =========================================
   Input row
   ========================================= */
.sai-input-row {
    border-top: 1px solid var(--sai-border);
    padding: 12px;

    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
}

.sai-input-row .sai-input {
    flex: 1;
    font-family: inherit !important;
    font-size: 14px;
    border: 1px solid var(--sai-border);
    border-radius: var(--sai-radius);
    padding: 8px 10px;
    line-height: 1.4;
    outline: none;
    background: #fff;
    color: #111;
}
.sai-input-row .sai-input::placeholder {
    font-family: inherit;
}
.sai-input-row .sai-input:focus {
    border-color: var(--sai-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--sai-accent) 20%, transparent);
}

/* Send button */
.sai-input-row .sai-send-btn {
  background: var(--sai-accent);
  border: none;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    line-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 36px;
    transition: opacity 0.2s ease;
}
.sai-input-row .sai-send-btn:hover {
    opacity: 0.85;
}
.sai-input-row .sai-send-btn:disabled {
    opacity: .5;
    cursor: default;
}

/* Icon inside send button */
.sai-send-icon {
    display: inline-flex;
    width: 18px;
    height: 18px;
    line-height: 0;
}
.sai-send-icon svg {
    width: 18px;
    height: 18px;
    display: block;
    fill: var(--sai-send-icon-color, #fff);
}

/* =========================================
   Voice: Mic Button (STT)
   ========================================= */
.sai-mic-btn {
    background: var(--sai-accent, #4f46e5);
    border: none;
    border-radius: 6px;
    padding: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    color: #fff;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}
.sai-mic-btn:hover {
    opacity: 0.85;
}
.sai-mic-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--sai-accent, #4f46e5) 30%, transparent);
}
.sai-mic-btn .sai-mic-icon {
    width: 20px;
    height: 20px;
    display: block;
    margin: auto;
}
.sai-mic-btn .sai-mic-icon svg {
    fill: #fff;
    color: #fff;
    width: 20px;
    height: 20px;
}
/* Recording state */
.sai-mic-btn.sai-recording {
    background: #EE4266 !important;
    color: #fff !important;
    animation: sai-mic-pulse 1.2s ease-in-out infinite;
}
@keyframes sai-mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(238, 66, 102, 0.5); }
    50% { box-shadow: 0 0 0 8px rgba(238, 66, 102, 0); }
}

/* =========================================
   Voice: Speaker Button (TTS) in actions row
   ========================================= */
.sai-act-speak {
    color: #9aa4b2;
}
.sai-act-speak:hover {
    color: #1f2937;
    background: #f3f4f6;
}
/* Playing state */
.sai-act-speak.sai-playing {
    color: var(--sai-accent, #4f46e5);
    animation: sai-speak-pulse 1s infinite;
}
@keyframes sai-speak-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .sai-mic-btn.sai-recording {
        animation: none;
        box-shadow: 0 0 0 4px rgba(238, 66, 102, 0.3);
    }
    .sai-act-speak.sai-playing {
        animation: none;
    }
}

/* =========================================
   Typing indicator
   ========================================= */
.sai-typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 1em;
}
.sai-typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--sai-accent);
    animation: sai-bounce 1s infinite ease-in-out;
    display: inline-block;
}
.sai-typing-indicator span:nth-child(1) { animation-delay: 0ms; }
.sai-typing-indicator span:nth-child(2) { animation-delay: 150ms; }
.sai-typing-indicator span:nth-child(3) { animation-delay: 300ms; }

@keyframes sai-bounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: .4;
    }
    40% {
        transform: translateY(-4px);
        opacity: 1;
    }
}
/* Waiting message shown after delay in typing indicator */
.sai-typing-wait-msg {
    font-size: 0.82em;
    color: var(--sai-text-muted, #64748b);
    margin-top: 6px;
    animation: sai-fade-in 0.4s ease;
}
@keyframes sai-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* =========================================
   Sources list under answers
   ========================================= */
.sai-sources-meta {
  font-size: 12px;
  opacity: 0.9;
  margin-top: 6px;
  line-height: 1.4;
}
/* Toggle pill */
.sai-sources-toggle,
.sai-chat-wrapper .sai-sources-meta .sai-sources-toggle,
.sai-hero-wrapper .sai-sources-meta .sai-sources-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #e2e8f0; /* slate-200 */
  background: #f8fafc; /* slate-50 */
  color: inherit;
  cursor: pointer;
  user-select: none;
  font: inherit;
  line-height: 1.1;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  box-shadow: none;
  margin-top: 20px; /* +20px traženo */
}

.sai-sources-text {
  font-weight: 500;  
}

.sai-sources-toggle:hover,
.sai-chat-wrapper .sai-sources-meta .sai-sources-toggle:hover,
.sai-hero-wrapper .sai-sources-meta .sai-sources-toggle:hover { background: #f1f5f9; }
.sai-sources-toggle:focus-visible { outline: 2px solid color-mix(in srgb, var(--sai-accent, #4f46e5) 30%, transparent); outline-offset: 2px; }
/* New circular icon container */
.sai-sources-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: var(--sai-accent, #4f46e5);
}
.sai-sources-ico svg { width: 12px; height: 12px; display:block; }

.sai-sources-meta ul { margin: 8px 0 0; padding-left: 16px; }
.sai-sources-meta a {
  color: inherit;
  text-decoration: underline;
  word-break: break-all;
  overflow-wrap: anywhere;
}

/* =========================================
   Actions under answers (Copy / Retry / Up / Down) + Feedback panel
   ========================================= */
.sai-actions{ display:flex; align-items:center; justify-content:space-between; gap:4px; margin-top:8px; opacity:.9; }
.sai-actions-left, .sai-actions-right{ display:flex; align-items:center; gap:4px; }
.sai-actions button{
  border:1px solid #e5e7eb; background:#fff; color:#334155; border-radius:8px; padding:3px 8px; cursor:pointer; line-height:1; font-size:12px;
}
.sai-actions button:hover{ background:#f8fafc; }
.sai-actions button:focus,
.sai-actions button:active{
  background: var(--sai-accent, #4f46e5);
  border-color: var(--sai-accent, #4f46e5);
  color:#fff;
  outline: none;
}
.sai-actions .sai-act-retry{ font-weight:600; }

.sai-feedback{ margin-top:8px; }
.sai-feedback[hidden]{ display:none !important; }
.sai-feedback-inner{ border:1px solid #e5e7eb; background:#fff; border-radius:10px; padding:10px; }
.sai-feedback-title{ font-size:12px; font-weight:600; color:#334155; margin-bottom:6px; }
.sai-feedback-reasons{ display:flex; flex-wrap:wrap; gap:8px 14px; margin-bottom:6px; }
.sai-feedback-opt{ font-size:12px; color:#334155; display:inline-flex; align-items:center; gap:6px; }
.sai-feedback-comment{ width:100%; border:1px solid #e5e7eb; border-radius:8px; padding:6px 8px; font-family:inherit; font-size:12px; }
.sai-feedback-actions{ display:flex; justify-content:flex-end; gap:8px; margin-top:8px; }
.sai-feedback-actions .sai-feedback-cancel,
.sai-feedback-actions .sai-feedback-send{ border:1px solid #e5e7eb; background:#fff; border-radius:8px; padding:6px 10px; font-size:12px; cursor:pointer; }
.sai-feedback-actions .sai-feedback-send{ background: var(--sai-user-bg, #4f46e5); border-color: var(--sai-user-bg, #4f46e5); color:#fff; }
/* Hover states – accent-tinted */
.sai-feedback-actions .sai-feedback-cancel:hover{
  background: color-mix(in srgb, var(--sai-accent, #4f46e5) 12%, #ffffff);
  border-color: color-mix(in srgb, var(--sai-accent, #4f46e5) 40%, #e5e7eb);
  color: var(--sai-accent, #4f46e5);
}
.sai-feedback-actions .sai-feedback-send:hover{
  background: color-mix(in srgb, var(--sai-user-bg, #4f46e5) 90%, #000 10%);
  border-color: color-mix(in srgb, var(--sai-user-bg, #4f46e5) 90%, #000 10%);
}

/* Align actions left and Sources button right in one row */
.sai-meta-row{ display:flex; align-items:flex-end; justify-content:space-between; gap:10px; margin-top:8px; flex-wrap:wrap; }
.sai-meta-row .sai-sources-meta{ margin-top:0; }
.sai-meta-row .sai-sources-toggle{ margin-top:0; }

/* When sources are expanded, make the block take full width of the next line */
.sai-meta-row .sai-sources-meta.is-open{ flex-basis: 100%; }
.sai-meta-row .sai-sources-meta.is-open .sai-sources-list{ display:block; width:100%; }

/* Icon colors */
.sai-actions .sai-act-up, .sai-actions .sai-act-down{ color:#9aa4b2; }
.sai-actions .sai-act-up:hover, .sai-actions .sai-act-down:hover{ color:#6b7280; }
.sai-actions .sai-act-copy:hover, .sai-actions .sai-act-retry:hover{ color:#1f2937; background:#f3f4f6; }
.sai-actions button svg{ display:block; }

/* =========================================
   Floating popup tweaks
   (popup koristi potpuno isti markup pa ovime
   pazimo da se ponaša isto)
   ========================================= */

/* Chat wrapper inside popup should be flexible and fill */
.sai-floating-popup-inner .sai-chat-wrapper {
    flex: 1 1 auto;
    min-height: 0;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    max-width: 100% !important;
    display: flex;
    flex-direction: column;
}

/* Messages area inside popup just inherits the same rules
   (padding 12/16 već dolazi iz .sai-messages iznad) */
.sai-floating-popup-inner .sai-chat-wrapper .sai-messages {
    flex: 1 1 auto;
    min-height: 0;
    max-height: var(--sai-messages-max-h, 320px);
    overflow-y: auto;
}

/* Input row should stay pinned at the bottom of popup */
.sai-floating-popup-inner .sai-chat-wrapper .sai-input-row {
    flex-shrink: 0;
}

/* Floating header actions */
.sai-floating-header-right {
    display:flex;
    align-items:center;
    gap:12px;
    font-size:14px;
    font-weight:600;
    line-height:1;
    color:inherit;
}
.sai-floating-header-clear,
.sai-floating-header-close {
    cursor:pointer;
    user-select:none;
}
.sai-floating-header-clear:hover,
.sai-floating-header-close:hover {
    opacity:.7;
}

.sai-quick-tags {
    display:flex;
    flex-wrap:wrap;
    gap:6px;
    margin:8px 0;
}

.sai-tag-chip {
    border:1px solid var(--sai-border, #e5e7eb);
    background:#fff;
    border-radius:9999px;
    font-family:inherit;
    font-size:12px;
    line-height:1.3;
    padding:4px 10px;
    cursor:pointer;
    color:#111;
    white-space:nowrap;
}

.sai-tag-chip.active {
    background:var(--sai-accent, #4f46e5);
    border-color:var(--sai-accent, #4f46e5);
    color:#fff;
    font-weight:600;
    box-shadow:0 2px 8px color-mix(in srgb, var(--sai-accent, #4f46e5) 40%, transparent);
}

/* Quick topic chips – base */
.sai-tag-chip{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border-radius:9999px;
  border:1px solid var(--sai-border);
  background:#f3f4f6;
  color:#111827;
  font-family:inherit;
  font-size:12px;
  line-height:1;
  cursor:pointer;
  transition:background .15s ease, color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

/* Active (selected) state inherits widget vars */
.sai-tag-chip.active{
  background:var(--sai-accent, #4f46e5);
  color:#fff;
  border-color:var(--sai-accent, #4f46e5);
  font-weight:600;
  box-shadow:0 2px 8px color-mix(in srgb, var(--sai-accent, #4f46e5) 40%, transparent);
}

/* Keyboard focus */
.sai-tag-chip:focus-visible{
  outline:2px solid var(--sai-accent);
  outline-offset:2px;
}

/* Label inside chip */
.sai-tag-chip .sai-chip-label{
  line-height:1.1;
  pointer-events:none;
}

@media (max-width:480px){
  .sai-tag-chip{ padding:5px 9px; font-size:11px; }
}

.sai-chip-heading{ font-size:12px; font-weight:600; color:#334155; }
.sai-tags-heading{ margin-bottom:6px; }
.sai-topics-heading{ margin-top:10px; margin-bottom:6px; }

.sai-custom-topics-below{ display:flex; flex-wrap:wrap; gap:6px; margin-top:6px; }

/* ---------------------------------------------------------
   Tags heading tooltip (? icon)
--------------------------------------------------------- */
.sai-tags-tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 1px solid #6b7280;
  background: transparent;
  color: #6b7280;
  font-size: 10px;
  font-weight: 700;
  cursor: help;
  position: relative;
  vertical-align: middle;
  margin-left: 3px;
  line-height: 1;
  transition: color .15s ease, border-color .15s ease;
}
.sai-tags-tip:hover {
  color: var(--sai-accent, #4f46e5);
  border-color: var(--sai-accent, #4f46e5);
}
/* Pure CSS tooltip via ::after */
.sai-tags-tip::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(100% + 8px);
  width: 240px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #1f2937;
  color: #f9fafb;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.4;
  white-space: normal;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
}
.sai-tags-tip:hover::after {
  opacity: 1;
}
/* On small screens, shift tooltip left so it doesn't overflow */
@media (max-width: 480px) {
  .sai-tags-tip::after {
    left: 0;
    transform: none;
    width: 200px;
  }
}

/* =========================================================
   CHIPS (TAG & TOPIC) — usklađeno s sai-chat-widget.js
   ========================================================= */

/* Grupa kontejnera (gap, wrap) */
.sai-hero-wrapper .sai-quick-tags,
.sai-hero-wrapper .sai-custom-topics-below {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: -7px!important;
}

/* Heading stil (koristi postojeće klase koje JS ubacuje) */
.sai-hero-wrapper .sai-chip-heading { font-size:12px; font-weight:600; color:#334155; }
.sai-hero-wrapper .sai-tags-heading { margin:2px 0 6px 0; }
.sai-hero-wrapper .sai-topics-heading { margin:10px 0 0; }

/* Red s tags chips */
.sai-quick-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: -7px;
    margin-right: 0px;
    margin-bottom: 8px;
    margin-left: 0px;
}

/* ---------------------------------------------------------
   Shared chip primitiv
--------------------------------------------------------- */
.sai-hero-wrapper .sai-tag-chip {
  --chip-radius: 999px;
  --chip-font: 12.5px;
  --chip-pad-y: 6px;
  --chip-pad-x: 10px;
  --chip-shadow: 0 2px 8px rgb(0 0 0 / .06);

  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--chip-radius);
  font-family: inherit;
  font-size: var(--chip-font);
  line-height: 1;
  padding: var(--chip-pad-y) var(--chip-pad-x);
  user-select: none;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, box-shadow .2s ease, transform .05s ease;
  white-space: nowrap;

  /* Fallback base */
  background: #fff;
  border: 1px solid var(--sai-border, #e5e7eb);
  color: var(--sai-assistant-text, #111827);
}
.sai-hero-wrapper .sai-tag-chip:active { transform: translateY(1px); }
.sai-hero-wrapper .sai-tag-chip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sai-accent, #4f46e5) 22%, transparent);
}

/* ---------------------------------------------------------
   TAG CHIPS (gore): .sai-tag-chip.sai-chip-tag
   — “glassy filled” + dot
--------------------------------------------------------- */
.sai-hero-wrapper .sai-tag-chip.sai-chip-tag {
  --tag-bg: color-mix(in srgb, var(--sai-accent, #4f46e5) 10%, #ffffff);
  --tag-border: color-mix(in srgb, var(--sai-accent, #4f46e5) 30%, var(--sai-border, #e5e7eb));
  --tag-text: color-mix(in srgb, var(--sai-accent, #4f46e5) 80%, #0b1020);

  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--sai-accent, #4f46e5) 12%, #fff) 0%,
    color-mix(in srgb, var(--sai-accent, #4f46e5) 5%, #fff) 100%
  );
  border: 1px solid var(--tag-border);
  color: var(--tag-text);
  box-shadow: var(--chip-shadow);
  backdrop-filter: saturate(1.1) blur(2px);
}
@supports not (background: color-mix(in srgb, #000 10%, #fff)) {
  .sai-hero-wrapper .sai-tag-chip.sai-chip-tag {
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    border-color: var(--sai-accent, #4f46e5);
    color: #182037;
  }
}
/* mala točkica (koristi pseudo ili dodatni span ako želiš) */
.sai-hero-wrapper .sai-tag-chip.sai-chip-tag::before {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--sai-accent, #4f46e5);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sai-accent, #4f46e5) 25%, transparent);
  display: inline-block;
}
.sai-hero-wrapper .sai-tag-chip.sai-chip-tag:hover {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--sai-accent, #4f46e5) 18%, #fff) 0%,
    color-mix(in srgb, var(--sai-accent, #4f46e5) 8%, #fff) 100%
  );
  border-color: color-mix(in srgb, var(--sai-accent, #4f46e5) 45%, #d1d5db);
}
/* Hover na aktivnom chipu — zadrži punu accent boju */
.sai-hero-wrapper .sai-tag-chip.sai-chip-tag.active:hover {
  background: var(--sai-accent, #4f46e5) !important;
  background-image: none !important;
  border-color: var(--sai-accent, #4f46e5);
  opacity: 0.9;
}
.sai-hero-wrapper .sai-tag-chip.sai-chip-tag.active {
  background: var(--sai-accent, #4f46e5) !important;
  background-image: none !important;
  backdrop-filter: none;
  border-color: var(--sai-accent, #4f46e5);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 16px color-mix(in srgb, var(--sai-accent, #4f46e5) 40%, transparent);
}
.sai-hero-wrapper .sai-tag-chip.sai-chip-tag.active::before {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255,255,255,.25);
}

/* ---------------------------------------------------------
   TOPIC CHIPS (dolje): .sai-tag-chip.sai-chip-custom
   — gradient accent stil kao tag chips + ? pločica
--------------------------------------------------------- */
.sai-hero-wrapper .sai-tag-chip.sai-chip-custom {
  --topic-border: color-mix(in srgb, var(--sai-accent, #4f46e5) 30%, var(--sai-border, #e5e7eb));
  --topic-text: color-mix(in srgb, var(--sai-accent, #4f46e5) 80%, #0b1020);

  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--sai-accent, #4f46e5) 12%, #fff) 0%,
    color-mix(in srgb, var(--sai-accent, #4f46e5) 5%, #fff) 100%
  );
  border: 1px solid var(--topic-border);
  color: var(--topic-text);
  box-shadow: var(--chip-shadow);
  backdrop-filter: saturate(1.1) blur(2px);
}
@supports not (background: color-mix(in srgb, #000 10%, #fff)) {
  .sai-hero-wrapper .sai-tag-chip.sai-chip-custom {
    background: linear-gradient(180deg, #ffffff 0%, #fafafa 100%);
    border-color: var(--sai-accent, #4f46e5);
    color: #182037;
  }
}
/* upitnik pločica */
.sai-hero-wrapper .sai-tag-chip.sai-chip-custom::before {
  content: "?";
  width: 16px; height: 16px; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--sai-accent, #4f46e5) 30%, var(--topic-border, #e5e7eb));
}
.sai-hero-wrapper .sai-tag-chip.sai-chip-custom:hover {
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--sai-accent, #4f46e5) 18%, #fff) 0%,
    color-mix(in srgb, var(--sai-accent, #4f46e5) 8%, #fff) 100%
  );
  border-color: color-mix(in srgb, var(--sai-accent, #4f46e5) 45%, #d1d5db);
}
.sai-hero-wrapper .sai-tag-chip.sai-chip-custom.active {
  background: var(--sai-accent, #4f46e5) !important;
  background-image: none !important;
  backdrop-filter: none;
  border-color: var(--sai-accent, #4f46e5);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 16px color-mix(in srgb, var(--sai-accent, #4f46e5) 40%, transparent);
}
.sai-hero-wrapper .sai-tag-chip.sai-chip-custom.active::before {
  background: #fff;
  border-color: rgba(255,255,255,.25);
  color: var(--sai-accent, #4f46e5);
}

/* Kompaktna varijanta (ako zatreba) */
.sai-hero-wrapper .sai-tag-chip.sai--sm {
  --chip-font: 11.5px; --chip-pad-y: 5px; --chip-pad-x: 9px;
}

/* ---------------------------------------------------------
   Dark mode
--------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  .sai-hero-wrapper .sai-tag-chip.sai-chip-tag {
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--sai-accent, #4f46e5) 22%, #0b1020) 0%,
      color-mix(in srgb, var(--sai-accent, #4f46e5) 12%, #0b1020) 100%
    );
    border-color: color-mix(in srgb, var(--sai-accent, #4f46e5) 45%, #1f2937);
    color: #eef2ff;
  }
  .sai-hero-wrapper .sai-tag-chip.sai-chip-custom {
    background: linear-gradient(
      180deg,
      color-mix(in srgb, var(--sai-accent, #4f46e5) 22%, #0b1020) 0%,
      color-mix(in srgb, var(--sai-accent, #4f46e5) 12%, #0b1020) 100%
    );
    border-color: color-mix(in srgb, var(--sai-accent, #4f46e5) 45%, #1f2937);
    color: #eef2ff;
  }
  .sai-hero-wrapper .sai-tag-chip.sai-chip-custom::before {
    background:#0b1020; border-color:#374151; color:#9aa4b2;
  }
}

/* ---------------------------------------------------------
   A11y / RTL / Reduced motion
--------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .sai-hero-wrapper .sai-tag-chip { transition: none !important; }
}
:root[dir="rtl"] .sai-hero-wrapper .sai-tag-chip { direction: rtl; }

/* =========================================================
   Related Content — In-Chat Full-Width Slider
   ========================================================= */

/* Slider row — full width, no avatar column */
.sai-msg-rc-carousel {
  margin-top: 4px;
  display: block !important;
  padding: 0 12px 0 0;
}

/* Slider bubble — full width from left avatar margin to right edge */
.sai-rc-chat-bubble {
  background: var(--sai-assistant-bg, #f3f4f6);
  border-radius: 12px;
  padding: 10px;
  margin-left: 40px; /* align with assistant bubble text (avatar 28px + gap 12px) */
  overflow: hidden;
}

/* Heading */
.sai-rc-chat-heading {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.55;
  margin-bottom: 8px;
  padding: 0 2px;
}

/* Slider viewport — clips overflow, holds arrows */
.sai-rc-slider-viewport {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
}

/* Track: all slides in a row, moved via translateX */
.sai-rc-slider-track {
  display: flex;
  transition: transform 0.35s ease;
}

/* Each slide takes 100% of viewport width */
a.sai-rc-slide,
a.sai-rc-slide:visited {
  flex: 0 0 100%;
  display: block;
  text-decoration: none;
  color: var(--sai-rc-text, #374151);
}
a.sai-rc-slide:hover .sai-rc-slide-title {
  color: var(--sai-accent, #4f46e5);
}

/* Slide image — large, full width */
.sai-rc-slide-img {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 65%; /* wider/taller image */
  overflow: hidden;
  background: #e5e7eb;
  border-radius: 8px 8px 0 0;
}
.sai-rc-slide-img img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* No-image slide: title-only card with accent left border */
.sai-rc-slide-noimg {
  border-left: 3px solid var(--sai-accent, #4f46e5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 64px;
}
.sai-rc-slide-noimg .sai-rc-slide-title {
  -webkit-line-clamp: 3;
  padding: 12px 44px 4px;
}

/* Slide title — below image */
.sai-rc-slide-title {
  padding: 8px 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--sai-rc-text, #374151);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  transition: color 0.2s;
}

/* Slide excerpt — below title */
.sai-rc-slide-excerpt {
  padding: 0 10px;
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.4;
  color: #6b7280;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sai-rc-slide-noimg .sai-rc-slide-excerpt {
  padding: 0 44px 0;
  margin-bottom: 10px;
}

/* Arrow zone — overlay that matches the image aspect ratio so arrows center on image */
.sai-rc-arrow-zone {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 0;
  padding-bottom: 65%; /* matches image ratio */
  pointer-events: none;
  z-index: 2;
}

/* Navigation arrows — centered vertically on the image via arrow-zone */
.sai-rc-arrow-zone > button.sai-rc-arrow,
.sai-rc-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: auto;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  max-width: 32px;
  max-height: 32px;
  border-radius: 50% !important;
  border: none !important;
  background: var(--sai-accent, #4f46e5) !important;
  background-color: var(--sai-accent, #4f46e5) !important;
  opacity: 0.8;
  color: #fff !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: opacity 0.2s;
  z-index: 2;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 1 !important;
  font-size: 0 !important;
  text-indent: 0 !important;
  letter-spacing: 0 !important;
  text-decoration: none !important;
  outline: none !important;
  box-sizing: border-box !important;
}
.sai-rc-arrow-zone > button.sai-rc-arrow:hover,
.sai-rc-arrow:hover {
  opacity: 1;
}
.sai-rc-arrow svg {
  width: 20px;
  height: 20px;
  stroke: #fff;
  fill: none;
}
.sai-rc-arrow-prev { left: 6px; }
.sai-rc-arrow-next { right: 6px; }

/* Dot indicators — aggressive reset to prevent Elementor/theme overrides */
.sai-rc-dots {
  display: flex !important;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 8px 0 2px;
  margin: 0;
  list-style: none !important;
}
.sai-rc-chat-bubble button.sai-rc-dot,
.sai-rc-dots > button.sai-rc-dot,
button.sai-rc-dot {
  appearance: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  width: 7px !important;
  height: 7px !important;
  min-width: 7px !important;
  min-height: 7px !important;
  max-width: 7px !important;
  max-height: 7px !important;
  border-radius: 50% !important;
  border: none !important;
  background: #d1d5db !important;
  background-color: #d1d5db !important;
  cursor: pointer;
  padding: 0 !important;
  margin: 0 !important;
  line-height: 0 !important;
  font-size: 0 !important;
  text-indent: -9999px !important;
  outline: none !important;
  box-shadow: none !important;
  transition: background-color 0.2s, transform 0.2s;
  display: block !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}
.sai-rc-chat-bubble button.sai-rc-dot:hover,
.sai-rc-dots > button.sai-rc-dot:hover,
button.sai-rc-dot:hover {
  background: #9ca3af !important;
  background-color: #9ca3af !important;
}
.sai-rc-chat-bubble button.sai-rc-dot.sai-rc-dot-active,
.sai-rc-dots > button.sai-rc-dot.sai-rc-dot-active,
button.sai-rc-dot-active {
  background: var(--sai-accent, #4f46e5) !important;
  background-color: var(--sai-accent, #4f46e5) !important;
  transform: scale(1.3);
}


/* ----- Hero chat: larger image ----- */
.sai-hero-wrapper .sai-rc-slide-img {
  padding-bottom: 60%; /* wider aspect on hero */
}
.sai-hero-wrapper .sai-rc-arrow-zone {
  padding-bottom: 60%;
}
.sai-hero-wrapper .sai-rc-chat-bubble {
  margin-left: 0; /* hero has no avatar column */
}

/* ----- Floating chat: slightly smaller ----- */
.sai-floating-chat .sai-rc-slide-img {
  padding-bottom: 55%; /* shorter aspect in floating chat */
}
.sai-floating-chat .sai-rc-arrow-zone {
  padding-bottom: 55%;
}
.sai-floating-chat .sai-rc-slide-title {
  font-size: 12px;
  padding: 6px 8px;
}
.sai-floating-chat .sai-rc-slide-noimg .sai-rc-slide-title {
  padding: 10px 40px 4px;
}
.sai-floating-chat .sai-rc-slide-noimg .sai-rc-slide-excerpt {
  padding: 0 40px;
}
.sai-floating-chat .sai-rc-slide-excerpt {
  font-size: 11px;
  padding: 0 8px;
  margin-bottom: 6px;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}
.sai-floating-chat .sai-rc-arrow {
  width: 28px;
  height: 28px;
}

/* ----- Responsive: small screens ----- */
@media (max-width: 480px) {
  .sai-rc-chat-bubble {
    margin-left: 0;
    border-radius: 8px;
  }
}

/* ----- Reduced motion ----- */
@media (prefers-reduced-motion: reduce) {
  .sai-msg-rc-carousel {
    transition: none !important;
  }
  .sai-rc-slider-track {
    transition: none !important;
  }
}

/* =========================================
   Busy state: disable all interactive elements
   while waiting for AI response
   ========================================= */
.sai-busy .sai-input,
.sai-busy .sai-hero-input {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}
.sai-busy .sai-send-btn,
.sai-busy .sai-hero-send-btn {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
}
.sai-busy .sai-mic-btn {
  opacity: 0.4;
  pointer-events: none;
  cursor: not-allowed;
}
.sai-busy .sai-tag-chip {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

/* ===== Phobs Booking Slider ===== */
.sai-booking-slider {
  margin: 8px 0 0;
  border: 1px solid var(--sai-border, #e2e8f0);
  border-radius: 12px;
  background: var(--sai-card-bg, #f8fafc);
  overflow: hidden;
}
/* Remove trailing space when slider is last element in the bubble */
.sai-booking-slider:last-child {
  margin-bottom: 0; /* keep 10px breathing room at bottom (bubble has ~10px padding) */
  border-radius: 0 0 12px 12px;
  border-bottom: none;
}
.sai-booking-slider-viewport {
  position: relative;
  overflow: hidden;
}
.sai-booking-slider-track {
  display: flex;
  transition: transform 0.35s ease;
}
.sai-booking-slide {
  flex: 0 0 100%;
  display: flex;
  flex-direction: column;
}
.sai-booking-slide-img {
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: #e5e7eb;
}
.sai-booking-slide-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sai-booking-slide-info {
  padding: 10px 12px 6px;
}
.sai-booking-slide-name {
  font-weight: 600;
  font-size: 0.95em;
  color: var(--sai-text, #1e293b);
  margin-bottom: 2px;
}
.sai-booking-slide-desc {
  font-size: 0.82em;
  color: var(--sai-text-muted, #64748b);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sai-booking-slide-dates {
  font-size: 0.8em;
  color: var(--sai-text-muted, #64748b);
}
/* Book Now button */
.sai-chat-wrapper .sai-booking-btn,
.sai-hero-wrapper .sai-booking-btn,
.sai-floating-popup-inner .sai-booking-btn,
a.sai-booking-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 10px 18px !important;
  margin: 6px 12px 12px !important;
  background: var(--sai-accent, #4f46e5) !important;
  background-color: var(--sai-accent, #4f46e5) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  font-family: inherit !important;
  font-size: 0.88em !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
  transition: background 0.15s ease, transform 0.1s ease !important;
  text-align: center !important;
  box-shadow: none !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
}
.sai-chat-wrapper .sai-booking-btn:hover,
.sai-hero-wrapper .sai-booking-btn:hover,
.sai-floating-popup-inner .sai-booking-btn:hover,
a.sai-booking-btn:hover {
  background: var(--sai-accent-700, #4338ca) !important;
  background-color: var(--sai-accent-700, #4338ca) !important;
  color: #fff !important;
  transform: translateY(-1px);
}
.sai-booking-btn:active { transform: translateY(0); }
/* Navigation arrows — overlaid on image area */
.sai-booking-arrow-zone {
  position: absolute;
  top: 0; left: 0; right: 0;
  aspect-ratio: 16/9;
  pointer-events: none;
  z-index: 2;
}
.sai-booking-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: auto;
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  border: none !important;
  background: var(--sai-accent, #4f46e5) !important;
  opacity: 0.8;
  color: #fff !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  transition: opacity 0.2s;
  padding: 0 !important;
  margin: 0 !important;
  min-width: 0 !important;
  max-width: 32px !important;
  min-height: 0 !important;
  max-height: 32px !important;
  box-sizing: border-box !important;
  line-height: 0 !important;
  overflow: hidden;
}
.sai-booking-arrow:hover { opacity: 1; }
.sai-booking-arrow svg { width: 20px; height: 20px; stroke: #fff; fill: none; }
.sai-booking-arrow-prev { left: 6px; }
.sai-booking-arrow-next { right: 6px; }
/* Dot indicators */
.sai-booking-dots {
  display: flex !important;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 6px 0 8px;
}
.sai-booking-dot {
  width: 7px !important; height: 7px !important;
  border-radius: 50% !important;
  border: none !important;
  background: #d1d5db !important;
  cursor: pointer;
  padding: 0 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  transition: background-color 0.2s, transform 0.2s;
}
.sai-booking-dot:hover { background: #9ca3af !important; }
.sai-booking-dot-active {
  background: var(--sai-accent, #4f46e5) !important;
  transform: scale(1.3);
}

/* ---- Booking: "Choose your dates" in-message button ---- */
.sai-booking-datepicker-wrap {
  position: relative;
  margin-top: 8px;
}
/* High-specificity selectors to beat Elementor/theme button resets */
.sai-chat-wrapper .sai-booking-choose-dates,
.sai-hero-wrapper .sai-booking-choose-dates,
.sai-floating-popup-inner .sai-booking-choose-dates,
button.sai-booking-choose-dates {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 8px 16px !important;
  background: var(--sai-accent, #6366f1) !important;
  background-color: var(--sai-accent, #6366f1) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 8px !important;
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  cursor: pointer !important;
  transition: background 0.15s, opacity 0.15s !important;
  box-shadow: none !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  text-decoration: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  margin: 0 !important;
  min-height: 0 !important;
  width: auto !important;
}
.sai-chat-wrapper .sai-booking-choose-dates:hover,
.sai-hero-wrapper .sai-booking-choose-dates:hover,
.sai-floating-popup-inner .sai-booking-choose-dates:hover,
button.sai-booking-choose-dates:hover {
  background: var(--sai-accent-700, #4338ca) !important;
  background-color: var(--sai-accent-700, #4338ca) !important;
  color: #fff !important;
}
.sai-booking-choose-dates.sai-bdp-active {
  background: var(--sai-accent-700, #4338ca) !important;
  background-color: var(--sai-accent-700, #4338ca) !important;
}
.sai-booking-choose-dates.sai-bdp-used {
  opacity: 0.5 !important;
  cursor: default !important;
  pointer-events: none !important;
}
.sai-booking-choose-dates svg {
  flex-shrink: 0;
}

/* ---- Booking date picker popover (in-message) ---- */
.sai-booking-date-popover {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 100;
  background: var(--sai-bg, #fff);
  border: 1px solid var(--sai-border, #e2e8f0);
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  min-width: 220px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--sai-font, inherit) !important;
}
.sai-bdp-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sai-bdp-label {
  font-family: var(--sai-font, inherit) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--sai-text-muted, #64748b) !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
  line-height: 1.3 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: none !important;
}
.sai-bdp-label input[type="date"],
.sai-bdp-label input[type="number"] {
  font-family: var(--sai-font, inherit) !important;
  font-size: 13px !important;
  padding: 5px 8px !important;
  border: 1px solid var(--sai-border, #e2e8f0) !important;
  border-radius: 6px !important;
  background: var(--sai-input-bg, #f8fafc) !important;
  color: var(--sai-text, #1e293b) !important;
  outline: none !important;
  box-shadow: none !important;
  min-height: 0 !important;
  height: auto !important;
  width: 100% !important;
  line-height: 1.4 !important;
  margin: 0 !important;
}
.sai-bdp-label input[type="date"]:focus,
.sai-bdp-label input[type="number"]:focus {
  border-color: var(--sai-accent, #6366f1) !important;
}
/* iOS Safari: font-size >= 16px prevents auto-zoom on input focus */
@supports (-webkit-touch-callout: none) {
  .sai-bdp-label input[type="date"],
  .sai-bdp-label input[type="number"] {
    font-size: 16px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
  }
}
/* Guests two-column layout: Adults | Children */
.sai-bdp-guests-row {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
}
.sai-bdp-col {
  display: flex !important;
  flex-direction: column !important;
  gap: 2px !important;
}
/* Child age dropdowns */
.sai-bdp-age-rows {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
}
.sai-bdp-age-row {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}
.sai-bdp-age-row .sai-bdp-age-lbl {
  font-family: var(--sai-font, inherit) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--sai-text-muted, #64748b) !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}
/* Wrapper provides the custom dropdown arrow via ::after pseudo-element */
.sai-bdp-age-wrap {
  position: relative !important;
  flex: 1 1 auto !important;
  display: block !important;
}
.sai-bdp-age-wrap::after {
  content: '' !important;
  position: absolute !important;
  right: 8px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 0 !important;
  height: 0 !important;
  border-left: 4px solid transparent !important;
  border-right: 4px solid transparent !important;
  border-top: 5px solid var(--sai-text-muted, #64748b) !important;
  pointer-events: none !important;
}
.sai-bdp-age {
  font-family: var(--sai-font, inherit) !important;
  font-size: 13px !important;
  padding: 4px 24px 4px 8px !important;
  border: 1px solid var(--sai-border, #e2e8f0) !important;
  border-radius: 6px !important;
  background: var(--sai-input-bg, #f8fafc) !important;
  color: var(--sai-text, #1e293b) !important;
  outline: none !important;
  box-shadow: none !important;
  width: 100% !important;
  cursor: pointer !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
}
.sai-bdp-age:focus {
  border-color: var(--sai-accent, #6366f1) !important;
}
/* Validation error: red border on empty required fields */
.sai-bdp-label input.sai-bdp-field-error,
.sai-bdp-age.sai-bdp-field-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239,68,68,0.15) !important;
}
/* Confirm button — high specificity to beat Elementor */
.sai-chat-wrapper .sai-bdp-confirm,
.sai-hero-wrapper .sai-bdp-confirm,
.sai-floating-popup-inner .sai-bdp-confirm,
button.sai-bdp-confirm {
  margin-top: 4px !important;
  padding: 6px 12px !important;
  background: var(--sai-accent, #6366f1) !important;
  background-color: var(--sai-accent, #6366f1) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 6px !important;
  font-family: var(--sai-font, inherit) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 1.3 !important;
  cursor: pointer !important;
  transition: background 0.15s !important;
  box-shadow: none !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  width: 100% !important;
  min-height: 0 !important;
  display: block !important;
}
.sai-chat-wrapper .sai-bdp-confirm:hover,
.sai-hero-wrapper .sai-bdp-confirm:hover,
.sai-floating-popup-inner .sai-bdp-confirm:hover,
button.sai-bdp-confirm:hover {
  background: var(--sai-accent-700, #4338ca) !important;
  background-color: var(--sai-accent-700, #4338ca) !important;
  color: #fff !important;
}

/* ===== CARD LOADING PLACEHOLDER (shimmer skeleton for booking/weather) ===== */
/* Inserted as a sibling of .sai-msg-assistant in messagesEl (NOT inside the flex row),
   so it appears full-width below the bubble. Left margin = avatar(28px) + gap(8px). */
.sai-card-placeholder {
  border-radius: 10px;
  border: 1px solid var(--sai-border, #e2e8f0);
  padding: 14px 16px;
  margin: 4px 0 0 36px;
  max-width: calc(80% - 36px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--sai-bg, #fff);
  min-height: 76px;
  box-sizing: border-box;
}
/* Two-layer background: solid base color + animated shimmer overlay on top */
.sai-ph-bar {
  height: 13px;
  border-radius: 6px;
  background-color: var(--sai-border, #e2e8f0);
  background-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.55) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: sai-shimmer 1.4s infinite linear;
  width: 100%;
}
.sai-ph-bar--60 { width: 60%; }
.sai-ph-bar--40 { width: 40%; }
@keyframes sai-shimmer {
  0%   { background-position:  200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== WEATHER CARD (Live Data) ===== */
.sai-weather-card {
  margin: 8px 0 0;
  border: 1px solid var(--sai-border, #e2e8f0);
  border-radius: 12px;
  background: var(--sai-card-bg, #f8fafc);
  overflow: hidden;
  animation: saiWeatherFadeIn 0.3s ease;
}
@keyframes saiWeatherFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.sai-weather-card:last-child {
  margin-bottom: 0;
  border-radius: 0 0 12px 12px;
  border-bottom: none;
}
.sai-weather-current {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 8px;
}
.sai-weather-icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  color: var(--sai-accent, #3b82f6);
}
.sai-weather-icon svg {
  width: 100%;
  height: 100%;
}
.sai-weather-temp {
  font-size: 1.6em;
  font-weight: 700;
  color: var(--sai-text, #1e293b);
  line-height: 1;
  flex-shrink: 0;
}
.sai-weather-info {
  flex: 1;
  min-width: 0;
}
.sai-weather-condition {
  font-size: 0.9em;
  color: var(--sai-text, #1e293b);
  font-weight: 500;
}
.sai-weather-location {
  font-size: 0.78em;
  color: var(--sai-text-muted, #64748b);
}
.sai-weather-details {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 4px 14px 10px;
  font-size: 0.8em;
  color: var(--sai-text-muted, #64748b);
}
.sai-weather-details span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.sai-weather-details svg {
  flex-shrink: 0;
}
.sai-weather-forecast {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(52px, 1fr));
  gap: 2px;
  padding: 8px 10px;
  border-top: 1px solid var(--sai-border, #e2e8f0);
  background: rgba(0,0,0,0.02);
}
.sai-weather-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 2px;
}
.sai-weather-day-name {
  font-size: 0.72em;
  font-weight: 600;
  color: var(--sai-text-muted, #64748b);
  text-transform: uppercase;
}
.sai-weather-day-icon {
  width: 20px;
  height: 20px;
  color: var(--sai-text, #1e293b);
}
.sai-weather-day-icon svg {
  width: 100%;
  height: 100%;
}
.sai-weather-day-temp {
  font-size: 0.75em;
  color: var(--sai-text, #1e293b);
  font-weight: 500;
}
.sai-weather-updated {
  font-size: 0.68em;
  color: var(--sai-text-muted, #94a3b8);
  text-align: right;
  padding: 4px 14px 6px;
}
@media (max-width: 320px) {
  .sai-weather-forecast {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* =========================================
   Escalation contact buttons
   ========================================= */
.sai-escalation-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--sai-border, #e2e8f0);
}
.sai-escalation-note {
  margin: 0 0 4px;
  font-size: 0.83em;
  color: var(--sai-assistant-text, #111827);
  line-height: 1.4;
}
.sai-escalation-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.sai-escalate-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.82em;
  font-weight: 500;
  text-decoration: none!important;
  line-height: 1.4;
  transition: filter 0.15s;
  white-space: nowrap;
}
.sai-escalate-btn--email {
  background: var(--sai-accent, #4f46e5);
  color: #fff!important;
  text-decoration: none;
}
.sai-escalate-btn--wa {
  background: #25d366;
  color: #fff!important;
  text-decoration: none;
}
.sai-escalate-btn--email:hover,
.sai-escalate-btn--wa:hover {
  filter: brightness(0.9);
  text-decoration: none!important;
  color: #fff!important;
}

/* =========================================
   Newsletter subscribe button
   ========================================= */
.sai-newsletter-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--sai-border, #e2e8f0);
}
.sai-newsletter-note {
  margin: 0 0 4px;
  font-size: 0.83em;
  color: var(--sai-assistant-text, #111827);
  line-height: 1.4;
}
.sai-newsletter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.82em;
  font-weight: 500;
  text-decoration: none!important;
  line-height: 1.4;
  transition: filter 0.15s;
  white-space: nowrap;
  background: var(--sai-accent, #4f46e5);
  color: #fff!important;
  align-self: flex-start;
}
.sai-newsletter-btn:hover {
  filter: brightness(0.9);
  text-decoration: none!important;
  color: #fff!important;
}


