/* === Obiimy Chat Widget — brand styles === */
:root {
  --ob-bg: #FAF9F5;
  --ob-card: #FFFFFF;
  --ob-text: #17100A;
  --ob-text-soft: rgba(23,16,10,.65);
  --ob-text-mute: rgba(23,16,10,.45);
  --ob-line: rgba(23,16,10,.10);
  --ob-gold: #E8B23A;
  --ob-gold-2: #F4C24C;
  --ob-gold-deep: #C7902A;
  --ob-orange: #E8862C;
  --ob-orange-2: #F19A3F;
  --ob-orange-tint: rgba(232,134,44,.08);
  --ob-accent: #977FC2;
  --ob-shadow: 0 24px 60px rgba(23,16,10,.18), 0 4px 16px rgba(23,16,10,.08);
  --ob-app-height: 100vh;
}

#obiimy-chat-root, #obiimy-chat-root * {
  box-sizing: border-box;
  font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#obiimy-chat-root.ob-bubble {
  position: fixed; z-index: 2147483600;
  bottom: 22px; right: 22px;
  pointer-events: none;
}
#obiimy-chat-root.ob-bubble.left { right: auto; left: 22px; }

#obiimy-chat-root.ob-fullscreen {
  position: fixed; inset: 0;
  z-index: 2147483600;
  pointer-events: auto;
}

.ob-bubble {
  pointer-events: auto;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ob-gold-2) 0%, var(--ob-gold) 50%, var(--ob-gold-deep) 100%);
  box-shadow: 0 12px 32px rgba(232,178,58,.45), 0 4px 12px rgba(23,16,10,.18);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none; color: #fff;
  transition: transform .25s cubic-bezier(.2,.9,.3,1.4), box-shadow .25s ease;
  position: relative;
}
.ob-bubble:hover { transform: scale(1.06); }
.ob-bubble:active { transform: scale(.96); }
.ob-bubble svg { width: 30px; height: 30px; }

.ob-bubble.pulse::before, .ob-bubble.pulse::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--ob-gold);
  opacity: 0; animation: ob-pulse 2.4s ease-out infinite;
}
.ob-bubble.pulse::after { animation-delay: 1.2s; }
@keyframes ob-pulse {
  0%   { transform: scale(.9); opacity: .55; }
  60%  { transform: scale(1.55); opacity: 0; }
  100% { transform: scale(1.55); opacity: 0; }
}

.ob-greeter {
  pointer-events: auto;
  position: absolute; bottom: 78px; right: 0;
  background: var(--ob-card); color: var(--ob-text);
  padding: 12px 14px 12px 16px;
  border-radius: 16px 16px 4px 16px;
  box-shadow: 0 12px 32px rgba(23,16,10,.12);
  font-size: 14px; line-height: 1.45;
  max-width: 240px;
  opacity: 0; transform: translateY(8px);
  transition: opacity .35s ease, transform .35s ease;
}
.ob-greeter.show { opacity: 1; transform: translateY(0); }
.ob-greeter .ob-close { position: absolute; top: 4px; right: 6px; background: none; border: none; color: var(--ob-text-mute); cursor: pointer; font-size: 16px; padding: 2px 4px; }
#obiimy-chat-root.left .ob-greeter { right: auto; left: 0; border-radius: 16px 16px 16px 4px; }

.ob-panel {
  pointer-events: auto;
  background: var(--ob-card);
  display: flex; flex-direction: column;
  overflow: hidden;
}
#obiimy-chat-root.ob-bubble .ob-panel {
  position: absolute;
  bottom: 80px; right: 0;
  width: 380px; height: 580px;
  max-height: calc(var(--ob-app-height, 100vh) - 110px);
  border-radius: 22px;
  box-shadow: var(--ob-shadow);
  transform-origin: bottom right;
  opacity: 0; transform: translateY(16px) scale(.96);
  transition: opacity .28s ease, transform .28s cubic-bezier(.2,.8,.2,1);
}
#obiimy-chat-root.ob-bubble .ob-panel.open { opacity: 1; transform: translateY(0) scale(1); }
#obiimy-chat-root.ob-bubble.left .ob-panel { right: auto; left: 0; transform-origin: bottom left; }

.ob-panel.ob-panel-fs {
  position: fixed; inset: 0;
  width: 100%;
  height: 100dvh;
  height: var(--ob-app-height, 100dvh);
  min-height: 100dvh;
  min-height: var(--ob-app-height, 100dvh);
  border-radius: 0;
  background:
    radial-gradient(circle at 12% 8%, #FFF1CF 0%, transparent 50%),
    radial-gradient(circle at 88% 92%, #F1E5FF 0%, transparent 50%),
    var(--ob-bg);
}

/* === Header === */
.ob-header {
  padding: 14px 18px;
  background: linear-gradient(135deg, #FFF8E6 0%, #FAF1D9 100%);
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--ob-line);
  flex-shrink: 0;
  padding-top: max(14px, env(safe-area-inset-top));
}
.ob-logo-wrap {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFFAF0, #FFF1CF);
  display: flex; align-items: center; justify-content: center;
  position: relative; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(232,178,58,.32);
  overflow: hidden;
}
/* removed: green online-dot decoration on logo */
.ob-logo { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.ob-htext { line-height: 1.2; flex: 1; min-width: 0; }
.ob-htext .ob-name { font-weight: 600; font-size: 15px; color: var(--ob-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ob-htext .ob-status { font-size: 11px; color: var(--ob-text-soft); margin-top: 2px; display: flex; align-items: center; gap: 5px; }
.ob-htext .ob-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #4ade80; }
.ob-hclose {
  margin-left: auto;
  background: rgba(23,16,10,.04); border: none;
  width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; color: var(--ob-text-soft);
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease;
  flex-shrink: 0;
}
.ob-hclose:hover { background: rgba(23,16,10,.10); }

/* === Body === */
.ob-body {
  flex: 1 1 auto; overflow-y: auto;
  padding: 18px 16px 8px;
  background: transparent;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.ob-panel:not(.ob-panel-fs) .ob-body { background: var(--ob-bg); }
.ob-body::-webkit-scrollbar { width: 6px; }
.ob-body::-webkit-scrollbar-thumb { background: rgba(23,16,10,.15); border-radius: 4px; }

/* === Messages === */
.ob-msg { display: flex; margin-bottom: 12px; }
.ob-msg.ob-pop { animation: ob-pop .4s cubic-bezier(.2,.9,.3,1.3); }
.ob-msg.user { justify-content: flex-end; }
.ob-msg .ob-mavt {
  width: 30px; height: 30px; border-radius: 50%;
  background: #FFFAF0; border: 1px solid var(--ob-line);
  color: var(--ob-gold-deep);
  display:flex; align-items:center; justify-content:center;
  font-size: 12px; font-weight: 600; flex-shrink: 0;
  margin-right: 8px; overflow: hidden;
}
.ob-msg .ob-mavt img { width: 110%; height: 110%; object-fit: contain; padding: 2px; }
.ob-bubble-msg {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px; line-height: 1.5;
  word-wrap: break-word; white-space: pre-wrap;
}
.ob-msg.bot .ob-bubble-msg {
  background: #fff; color: var(--ob-text);
  border: 1px solid var(--ob-line);
  border-top-left-radius: 4px;
}
.ob-msg.user .ob-bubble-msg {
  background: linear-gradient(135deg, var(--ob-gold-2), var(--ob-gold));
  color: #fff;
  border-top-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(232,178,58,.3);
}
.ob-bubble-msg p { margin: 0 0 8px; }
.ob-bubble-msg p:last-child { margin-bottom: 0; }
.ob-bubble-msg ul, .ob-bubble-msg ol { padding-left: 20px; margin: 4px 0; }
.ob-bubble-msg a { color: var(--ob-gold-deep); text-decoration: underline; word-break: break-all; }
.ob-msg.user .ob-bubble-msg a { color: #fff; }
.ob-bubble-msg strong { font-weight: 600; }
.ob-bubble-msg code { background: rgba(23,16,10,.06); padding: 1px 5px; border-radius: 4px; font-family: ui-monospace, monospace; font-size: 13px; }

@keyframes ob-pop {
  0%   { opacity: 0; transform: translateY(8px) scale(.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* === Scene gallery === */
.ob-msg-scene .ob-scene { display: grid; gap: 6px; grid-template-columns: 1fr; max-width: 78%; }
.ob-msg-scene .ob-scene-grid { grid-template-columns: 1fr 1fr; }
.ob-scene-img {
  width: 100%; aspect-ratio: 1 / 1.25;
  object-fit: cover; border-radius: 12px;
  cursor: zoom-in; background: #f3eee2;
  border: 1px solid var(--ob-line);
  transition: transform .18s ease;
}
.ob-scene-img:hover { transform: scale(1.02); }

.ob-lightbox {
  position: fixed; inset: 0; z-index: 2147483646;
  background: rgba(23,16,10,.85);
  display: flex; align-items: center; justify-content: center;
  padding: 20px; cursor: zoom-out;
  animation: ob-lb-fade .2s ease;
}
.ob-lightbox img { max-width: 100%; max-height: 100%; border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.ob-lb-close { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border: none; border-radius: 50%; background: #fff; color: var(--ob-text); cursor: pointer; font-size: 20px; }
@keyframes ob-lb-fade { from { opacity: 0; } to { opacity: 1; } }

/* === Typing === */
.ob-typing {
  display: flex; gap: 4px; padding: 12px 14px;
  background: #fff; border: 1px solid var(--ob-line);
  border-radius: 16px; border-top-left-radius: 4px;
  width: fit-content;
}
.ob-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--ob-gold); opacity: .4; animation: ob-dot 1.2s infinite ease-in-out; }
.ob-typing span:nth-child(2) { animation-delay: .15s; }
.ob-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes ob-dot {
  0%, 80%, 100% { transform: scale(.7); opacity: .35; }
  40%           { transform: scale(1); opacity: 1; }
}

/* === Initial quick replies === */
.ob-quicks { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 14px 38px; }
.ob-quick {
  background: #fff;
  border: 1px solid var(--ob-line);
  color: var(--ob-text);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
  font-family: inherit;
}
.ob-quick:hover { background: #FFF8E6; border-color: var(--ob-gold); transform: translateY(-1px); }

/* === Smart follow-ups (right-aligned outline-orange pills) === */
.ob-followups {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: 6px;
  margin: -2px 0 14px 38px;
  max-width: 100%;
}
.ob-followup {
  background: transparent;
  border: 1.5px solid var(--ob-orange);
  color: var(--ob-orange);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px; font-weight: 500;
  cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 80%;
  text-align: right;
  line-height: 1.3;
  opacity: 0;
  transform: translateY(6px) scale(.94);
  animation: ob-pill-in .35s cubic-bezier(.2,.9,.3,1.3) forwards;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .18s ease, box-shadow .2s ease;
  white-space: normal; word-break: break-word;
}
.ob-followup .ob-arrow { flex-shrink: 0; width: 14px; height: 14px; opacity: .55; transition: opacity .2s ease, transform .2s ease; }
.ob-followup:hover { background: var(--ob-orange); color: #fff; box-shadow: 0 6px 18px rgba(232,134,44,.35); transform: translateY(-1px); }
.ob-followup:hover .ob-arrow { opacity: 1; transform: translateX(2px); }
.ob-followup:active { transform: translateY(0) scale(.97); }
.ob-followup.ob-clicked { animation: ob-pill-pick .25s ease forwards; pointer-events: none; }
.ob-followups.ob-pills-leaving .ob-followup:not(.ob-clicked) { animation: ob-pill-out .2s ease forwards; }
@keyframes ob-pill-in   { to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes ob-pill-out  { to { opacity: 0; transform: translateY(-3px) scale(.96); } }
@keyframes ob-pill-pick {
  0%   { background: var(--ob-orange); color: #fff; transform: translateY(-1px) scale(1); }
  100% { background: linear-gradient(135deg, var(--ob-gold-2), var(--ob-gold)); color: #fff; transform: translateY(0) scale(.92); opacity: 0; }
}

/* === Footer / input — DEFAULT (used in bubble desktop) === */
.ob-foot {
  border-top: 1px solid var(--ob-line);
  padding: 10px 12px calc(12px + env(safe-area-inset-bottom));
  background: #fff;
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
}
.ob-input-wrap {
  display: flex; align-items: center; gap: 10px;
  background: #fff;
  border: 1.5px solid var(--ob-line);
  border-radius: 24px;
  padding: 6px 6px 6px 16px;
  transition: border-color .15s ease, box-shadow .15s ease;
  box-shadow: 0 1px 2px rgba(23,16,10,.04);
  flex-shrink: 0;
}
.ob-input-wrap:focus-within {
  border-color: var(--ob-orange);
  box-shadow: 0 0 0 3px rgba(232,134,44,.15), 0 1px 4px rgba(23,16,10,.06);
}
.ob-input {
  flex: 1 1 auto;
  resize: none; border: none; outline: none;
  background: transparent;
  font-size: 16px;
  font-family: inherit;
  color: var(--ob-text);
  max-height: 120px; min-height: 22px;
  line-height: 1.45;
  padding: 6px 0;
  min-width: 0;
}
.ob-input::placeholder { color: var(--ob-text-mute); }
.ob-send {
  width: 36px; height: 36px;
  border-radius: 50%; border: none;
  background: linear-gradient(135deg, var(--ob-orange-2), var(--ob-orange));
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform .12s ease, opacity .12s ease, box-shadow .15s ease;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(232,134,44,.32);
}
.ob-send:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }
.ob-send:not(:disabled):hover { transform: scale(1.06); box-shadow: 0 6px 16px rgba(232,134,44,.45); }
.ob-send:not(:disabled):active { transform: scale(.94); }
.ob-send svg { width: 18px; height: 18px; }
.ob-footnote { text-align: center; font-size: 10.5px; color: var(--ob-text-mute); margin-top: 6px; letter-spacing: .02em; }
.ob-footnote span { color: var(--ob-gold-deep); font-weight: 500; }

/* === FULLSCREEN MODE — always-on mobile-first input UX (no media query) === */
#obiimy-chat-root.ob-fullscreen .ob-foot {
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
}
#obiimy-chat-root.ob-fullscreen .ob-input-wrap {
  border-radius: 26px;
  padding: 6px 6px 6px 18px;
  gap: 8px;
  min-height: 52px;
}
#obiimy-chat-root.ob-fullscreen .ob-input {
  min-height: 24px;
  padding: 12px 0;
  line-height: 1.4;
}
#obiimy-chat-root.ob-fullscreen .ob-send {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--ob-orange-2), var(--ob-orange));
  box-shadow: 0 4px 12px rgba(232,134,44,.32);
}
#obiimy-chat-root.ob-fullscreen .ob-send:disabled { opacity: .55; box-shadow: none; }
#obiimy-chat-root.ob-fullscreen .ob-send svg { width: 20px; height: 20px; }
#obiimy-chat-root.ob-fullscreen .ob-footnote { display: none !important; }

/* === BUBBLE on small screens — converts to fullscreen-like === */
@media (max-width: 480px) {
  #obiimy-chat-root.ob-bubble { bottom: 14px; right: 14px; }
  #obiimy-chat-root.ob-bubble .ob-bubble { width: 56px; height: 56px; }
  #obiimy-chat-root.ob-bubble .ob-bubble svg { width: 26px; height: 26px; }
  #obiimy-chat-root.ob-bubble .ob-greeter { max-width: 200px; font-size: 13px; }
  #obiimy-chat-root.ob-bubble .ob-panel {
    position: fixed; inset: 0;
    width: 100%;
    height: 100dvh;
    height: var(--ob-app-height, 100dvh);
    max-height: 100dvh;
    max-height: var(--ob-app-height, 100dvh);
    border-radius: 0;
    bottom: 0; right: 0;
  }
  #obiimy-chat-root.ob-bubble .ob-panel.open ~ .ob-bubble { display: none; }
  #obiimy-chat-root.ob-bubble .ob-foot { padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); }
  #obiimy-chat-root.ob-bubble .ob-input-wrap { border-radius: 26px; padding: 6px 6px 6px 18px; gap: 8px; min-height: 52px; }
  #obiimy-chat-root.ob-bubble .ob-input { min-height: 24px; padding: 12px 0; line-height: 1.4; }
  #obiimy-chat-root.ob-bubble .ob-send { width: 44px; height: 44px; }
  #obiimy-chat-root.ob-bubble .ob-send svg { width: 20px; height: 20px; }
  #obiimy-chat-root.ob-bubble .ob-footnote { display: none !important; }
}

#obiimy-chat-root.ob-bubble .ob-panel.open + .ob-bubble { transform: scale(0); pointer-events: none; }

/* === Header action (clear chat) === */
.ob-haction {
  background: transparent; border: none; color: var(--ob-text, #17100A);
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  margin-right: 4px; opacity: .72; transition: opacity .15s, background .15s;
}
.ob-haction:hover { opacity: 1; background: rgba(23,16,10,.07); }
.ob-haction:focus-visible { outline: 2px solid #b78a5e; outline-offset: 1px; }

/* === Lightbox A11y focus === */
.ob-lightbox:focus { outline: none; }
.ob-lb-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* === Consent bar === */
.ob-consent {
  font-size: 12px; line-height: 1.4; color: #5a4a3a;
  padding: 8px 12px;
  background: linear-gradient(0deg, rgba(250,249,245,.96), rgba(250,249,245,.96));
  border-top: 1px solid rgba(23,16,10,.06);
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
}
.ob-consent a { color: #b78a5e; text-decoration: underline; }
.ob-consent-btn {
  border: 1px solid rgba(23,16,10,.18); background: #fff; color: #17100A;
  padding: 4px 10px; border-radius: 999px; font-size: 12px; cursor: pointer;
}
.ob-consent-btn:hover { background: #f7f1ea; }
.ob-consent-btn.ob-consent-decline { color: #5a4a3a; }

/* === Turn wrapper (does not affect layout) === */
.ob-turn { display: contents; }
