/* Smart ChatBot — Chat Widget v1.5
   Self-contained. Zero external dependencies. */

/* ── Variables ───────────────────────────────────────────────────────────────── */
:root {
  --scb-primary:       #1a6b3c;
  --scb-primary-light: #2d9056;
  --scb-primary-dark:  #0f4527;
  --scb-bg:            #ffffff;
  --scb-surface:       #f8faf9;
  --scb-border:        #e4ede9;
  --scb-text:          #1c2b22;
  --scb-text-muted:    #6b7c73;
  --scb-user-bg:       linear-gradient(135deg, var(--scb-primary) 0%, var(--scb-primary-light) 100%);
  --scb-user-text:     #ffffff;
  --scb-bot-bg:        #f1f5f2;
  --scb-shadow:        0 12px 48px rgba(26,107,60,0.18), 0 4px 12px rgba(0,0,0,0.08);
  --scb-radius:        18px;
  --scb-bubble-r:      14px;
  --scb-font:          -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --scb-z:             9999;
  --scb-w:             380px;
  --scb-h:             560px;
}

/* ── Root ────────────────────────────────────────────────────────────────────── */
#scb-root {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--scb-z);
  font-family: var(--scb-font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--scb-text);
  box-sizing: border-box;
}
#scb-root *, #scb-root *::before, #scb-root *::after { box-sizing: border-box; }

/* ── Bubble button ───────────────────────────────────────────────────────────── */
#scb-bubble {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--scb-primary) 0%, var(--scb-primary-light) 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 24px rgba(26,107,60,0.4), 0 2px 8px rgba(0,0,0,0.1);
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .25s ease, background .2s;
  outline: none;
}
#scb-bubble:hover  { transform: scale(1.1); box-shadow: 0 8px 32px rgba(26,107,60,.5), 0 4px 12px rgba(0,0,0,.15); }
#scb-bubble:active { transform: scale(.92); }
#scb-bubble svg    { width: 28px; height: 28px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.15)); }
#scb-bubble::after {
  content: ''; position: absolute; inset: -5px; border-radius: 50%;
  border: 2px solid var(--scb-primary); opacity: 0;
  animation: scb-pulse 2.5s ease-out infinite; pointer-events: none;
}
@keyframes scb-pulse { 0% { opacity:.6; transform:scale(1); } 100% { opacity:0; transform:scale(1.5); } }

/* Badge */
#scb-badge {
  position: absolute; top: -2px; right: -2px; min-width: 18px; height: 18px;
  border-radius: 9px; background: #e53e3e; color: white;
  font-size: 11px; font-weight: 700; display: flex; align-items: center;
  justify-content: center; padding: 0 4px; border: 2px solid white;
  animation: scb-badge-pop .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes scb-badge-pop { from { transform:scale(0); } to { transform:scale(1); } }

/* Proactive tooltip */
.scb-proactive-tip {
  position: absolute; bottom: 68px; right: 0; white-space: nowrap;
  background: #1c2b22; color: white; font-size: 12px; padding: 7px 12px;
  border-radius: 10px; box-shadow: 0 4px 16px rgba(0,0,0,.2);
  animation: scb-fade-in .3s ease;
}
.scb-proactive-tip::after {
  content: ''; position: absolute; bottom: -6px; right: 18px;
  border: 6px solid transparent; border-top-color: #1c2b22; border-bottom: 0;
}
@keyframes scb-fade-in { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }

/* ── Chat window ─────────────────────────────────────────────────────────────── */
#scb-window {
  position: absolute; bottom: 70px; right: 0;
  width: var(--scb-w); max-width: calc(100vw - 32px);
  height: var(--scb-h); max-height: calc(100vh - 120px);
  background: var(--scb-bg); border-radius: var(--scb-radius);
  box-shadow: 0 12px 48px rgba(26,107,60,0.2), 0 4px 16px rgba(0,0,0,0.1);
  display: flex; flex-direction: column;
  overflow: hidden; border: 1px solid rgba(26,107,60,0.1);
  transform: scale(.85) translateY(20px); transform-origin: bottom right;
  opacity: 0; pointer-events: none;
  transition: transform .3s cubic-bezier(.34,1.4,.64,1), opacity .25s ease;
  backdrop-filter: blur(1px);
}
#scb-window.scb-window--open { transform: scale(1) translateY(0); opacity: 1; pointer-events: all; }

/* ── Header ──────────────────────────────────────────────────────────────────── */
#scb-header {
  display: flex; align-items: center; gap: 6px; padding: 12px 12px;
  background: linear-gradient(135deg, var(--scb-primary) 0%, var(--scb-primary-light) 50%, #34d399 100%);
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
#scb-header::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255,255,255,0.1) 0%, transparent 50%);
  pointer-events: none;
}
.scb-header-avatar {
  width: 35px; height: 35px; border-radius: 50%;
  background: rgba(255,255,255,.15); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.scb-header-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.scb-header-title { font-weight: 700; font-size: 15px; color: white; letter-spacing: -.01em; }
.scb-header-status { font-size: 11px; color: rgba(255,255,255,.8); display: flex; align-items: center; gap: 5px; }
.scb-status-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #4ade80;
  animation: scb-online 2s ease-in-out infinite;
}
@keyframes scb-online { 0%,100% { opacity:1; } 50% { opacity:.5; } }
#scb-minimize {
  background: rgba(255,255,255,.12); border: none; border-radius: 8px;
  width: 34px; height: 34px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s; flex-shrink: 0;
  color: white;          /* ensures currentColor on SVG strokes resolves correctly */
  padding: 0;            /* kill any browser-default button padding */
  line-height: 1;
}
#scb-minimize svg { display: block; pointer-events: none; }
#scb-minimize:hover { background: rgba(255,255,255,.28); }

/* ── Messages area ───────────────────────────────────────────────────────────── */
#scb-messages {
  flex: 1; overflow-y: auto; padding: 14px 12px 8px;
  display: flex; flex-direction: column; gap: 10px;
  scroll-behavior: smooth; background: var(--scb-surface);
  -webkit-overflow-scrolling: touch;
}
#scb-messages::-webkit-scrollbar { width: 4px; }
#scb-messages::-webkit-scrollbar-thumb { background: #c8d8ce; border-radius: 2px; }

/* ── Message rows ────────────────────────────────────────────────────────────── */
.scb-msg {
  display: flex; align-items: flex-end; gap: 8px; max-width: 100%;
  animation: scb-msg-in .28s cubic-bezier(.22,1,.36,1);
}
@keyframes scb-msg-in { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:none; } }
.scb-msg--user { justify-content: flex-end; }
.scb-msg--bot  { justify-content: flex-start; }

.scb-bot-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: white;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; box-shadow: 0 1px 4px rgba(0,0,0,.1); margin-bottom: 2px;
}

.scb-bubble {
  max-width: 98%; padding: 10px 12px;
  border-radius: var(--scb-bubble-r); font-size: 13.5px; line-height: 1.55;
  word-wrap: break-word; overflow-wrap: break-word;
}
.scb-bubble--user { background: linear-gradient(135deg, var(--scb-primary) 0%, var(--scb-primary-light) 100%); color: white; border-bottom-right-radius: 4px; margin-left: auto; box-shadow: 0 2px 8px rgba(26,107,60,0.2); }
.scb-bubble--bot  { background: var(--scb-bot-bg); color: var(--scb-text); border-bottom-left-radius: 4px; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }

/* ── Answer block ────────────────────────────────────────────────────────────── */
.scb-answer-block { display: flex; flex-direction: column; gap: 7px; }
.scb-answer-label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--scb-primary); font-weight: 600; }
.scb-answer-text  { font-size: 13.5px; line-height: 1.65; color: var(--scb-text); }

/* Rich text inside answers */
.scb-num    { display: inline-block; font-weight: 700; color: var(--scb-primary); margin-right: 2px; }
.scb-bullet { color: var(--scb-primary); margin-right: 4px; }

/* Clickable links inside bot messages */
.scb-link,
.scb-bubble--bot a {
  color: var(--scb-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  word-break: break-all;
  font-weight: 500;
  transition: opacity 0.15s;
}
.scb-link:hover,
.scb-bubble--bot a:hover { opacity: 0.75; }

/* Fuzzy match label */
.scb-fuzzy-label {
  font-size: 12px; color: var(--scb-text-muted); margin-bottom: 6px;
  padding: 5px 8px; background: rgba(26,107,60,.06); border-radius: 6px;
  border-left: 2px solid var(--scb-primary);
}

/* ── Fallback block ──────────────────────────────────────────────────────────── */
.scb-fallback-block { display: flex; flex-direction: column; gap: 10px; }
.scb-fallback-msg { display: flex; align-items: flex-start; gap: 6px; font-size: 13px; color: var(--scb-text-muted); }
.scb-suggestions-label { font-size: 11.5px; font-weight: 700; color: var(--scb-text-muted); text-transform: uppercase; letter-spacing: .05em; }
.scb-suggestions-list  { display: flex; flex-direction: column; gap: 6px; }

.scb-suggestion-btn {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  background: white; border: 1.5px solid var(--scb-border); border-radius: 10px;
  cursor: pointer; font-size: 12.5px; font-family: var(--scb-font); color: var(--scb-primary);
  text-align: left; line-height: 1.4; font-weight: 500;
  transition: background .15s, border-color .15s, transform .1s;
}
.scb-suggestion-btn:hover  { background: #f0faf4; border-color: var(--scb-primary-light); transform: translateX(2px); }
.scb-suggestion-btn:active { transform: scale(.98); }
.scb-suggestion-btn svg { flex-shrink: 0; opacity: .6; }

/* ── CTA ─────────────────────────────────────────────────────────────────────── */
.scb-cta {
  display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--scb-text-muted);
  padding: 8px 10px; background: rgba(26,107,60,.06); border-radius: 8px; border-left: 3px solid var(--scb-primary);
}
.scb-cta a { color: var(--scb-primary); text-decoration: none; font-weight: 700; transition: color .15s; }
.scb-cta a:hover { color: var(--scb-primary-light); text-decoration: underline; }

/* ── Feedback buttons ────────────────────────────────────────────────────────── */
.scb-feedback {
  display: flex; align-items: center; gap: 8px; margin-top: 10px; padding-top: 8px;
  border-top: 1px solid var(--scb-border);
}
.scb-fb-label  { font-size: 11.5px; color: var(--scb-text-muted); }
.scb-fb-btn {
  background: none; border: 1.5px solid var(--scb-border); border-radius: 6px;
  padding: 3px 8px; cursor: pointer; font-size: 14px; transition: background .15s, border-color .15s, transform .1s;
}
.scb-fb-btn:hover  { background: #f0faf4; border-color: var(--scb-primary-light); transform: scale(1.1); }
.scb-fb-btn:active { transform: scale(.95); }
.scb-fb-thanks { font-size: 12px; font-weight: 600; }
.scb-fb-up   { color: var(--scb-primary); }
.scb-fb-down { color: #e53e3e; }

/* ── Category grid (onboarding) ──────────────────────────────────────────────── */
.scb-category-row { width: 100%; }
.scb-category-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; padding: 4px 0;
}
.scb-cat-chip {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 10px 6px; background: #aaffb5; border: 1.5px solid var(--scb-border); border-radius: 10px;
  cursor: pointer; font-size: 12px; font-family: var(--scb-font); color: var(--scb-text); font-weight: 600;
  transition: background .15s, border-color .15s, transform .1s; text-align: center;
}
.scb-cat-chip:hover  { background: #f0faf4; border-color: var(--scb-primary); transform: translateY(-2px); }
.scb-cat-chip:active { transform: scale(.97); }
.scb-cat-chip span   { font-size: 11.5px; }

/* Category results heading */
.scb-category-heading { font-size: 13px; font-weight: 700; color: var(--scb-primary); margin-bottom: 10px; }
.scb-category-results { display: flex; flex-direction: column; gap: 4px; }

/* ── Chips bar ───────────────────────────────────────────────────────────────── */
#scb-chips-bar {
  display: flex; gap: 6px; padding: 8px 12px; overflow-x: auto;
  background: var(--scb-surface); border-top: 1px solid var(--scb-border);
  flex-shrink: 0; scrollbar-width: none;
  animation: scb-msg-in .2s ease;
}
#scb-chips-bar::-webkit-scrollbar { display: none; }

.scb-chip {
  flex-shrink: 0; padding: 6px 12px; background: white; border: 1.5px solid var(--scb-border);
  border-radius: 20px; cursor: pointer; font-size: 12px; font-family: var(--scb-font);
  color: var(--scb-primary); white-space: nowrap; font-weight: 500;
  transition: background .15s, border-color .15s, transform .1s;
  max-width: 200px; overflow: hidden; text-overflow: ellipsis;
}
.scb-chip:hover  { background: #f0faf4; border-color: var(--scb-primary-light); }
.scb-chip:active { transform: scale(.97); }

/* ── Typing indicator ────────────────────────────────────────────────────────── */
.scb-typing-bubble { display: flex; align-items: center; gap: 5px; padding: 12px 16px; }
.scb-typing-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #aabfb3;
  animation: scb-typing 1.2s ease-in-out infinite;
}
.scb-typing-dot:nth-child(2) { animation-delay: .2s; }
.scb-typing-dot:nth-child(3) { animation-delay: .4s; }
@keyframes scb-typing { 0%,80%,100% { transform:translateY(0);opacity:.4; } 40% { transform:translateY(-6px);opacity:1; } }

/* ── Input area ──────────────────────────────────────────────────────────────── */
#scb-input-area {
  display: flex; align-items: flex-end; gap: 6px; padding: 10px 12px;
  background: var(--scb-bg); border-top: 1px solid var(--scb-border); flex-shrink: 0;
  margin-top: 6px;
}
#scb-input {
  flex: 1; padding: 11px 16px; background: var(--scb-surface); border: 1.5px solid var(--scb-border);
  border-radius: 22px; font-size: 14.5px; font-family: var(--scb-font); color: var(--scb-text);
  resize: none; outline: none; line-height: 1.55; min-height: 44px; max-height: 120px;
  transition: border-color .2s, box-shadow .2s, background .2s;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: #b5b5b5 transparent;
}
#scb-input:focus   { border-color: var(--scb-primary); box-shadow: 0 0 0 3px rgba(26,107,60,.08); background: white; }
#scb-input::placeholder { color: #9bb5a5; }

/* ── Voice input & voice output toggle buttons ──────────────────────────────── */
#scb-voice-in,
#scb-voice-out {
  position: relative;                  /* anchor the reactive rings */
  flex-shrink: 0;
  width: 36px; height: 36px;
  padding: 0;                          /* remove all default button padding */
  border: 1.5px solid var(--scb-border);
  border-radius: 50%;
  background: var(--scb-surface);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; line-height: 1;
  transition: background .15s, border-color .15s, transform .1s, color .15s;
  color: var(--scb-text);              /* override any theme colour */
}
#scb-voice-in .scb-mic-icon { display: block; pointer-events: none; transition: transform .12s ease-out; }
#scb-voice-in:hover,
#scb-voice-out:hover  { background: #e8f5ee; border-color: var(--scb-primary); }
#scb-voice-in:hover .scb-mic-icon { color: var(--scb-primary); }
#scb-voice-in:active,
#scb-voice-out:active { transform: scale(.93); }

/* ── Listening state: modern reactive microphone ──────────────────────────── */
#scb-voice-in.scb-recording {
  background: #fee2e2;
  border-color: #ef4444;
  color: #ef4444;
}
#scb-voice-in.scb-recording .scb-mic-icon {
  color: #ef4444;
  /* gently scale the mic glyph with live loudness */
  transform: scale(calc(1 + var(--scb-mic-level, 0) * 0.22));
}
/* Steady blink ring — pulses while listening even in silence */
#scb-voice-in.scb-recording::before {
  content: ""; position: absolute; inset: -2px; border-radius: 50%;
  border: 2px solid rgba(239,68,68,.6);
  animation: scb-mic-blink 1s ease-in-out infinite;
  pointer-events: none;
}
/* Voice-reactive halo — expands & brightens with detected noise/voice level */
#scb-voice-in.scb-recording::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  box-shadow: 0 0 0 calc(2px + var(--scb-mic-level, 0) * 11px) rgba(239,68,68, calc(.06 + var(--scb-mic-level, 0) * .35));
  transition: box-shadow .08s ease-out;
  pointer-events: none;
}
@keyframes scb-mic-blink {
  0%,100% { opacity: .25; transform: scale(1); }
  50%     { opacity: 1;   transform: scale(1.16); }
}

/* ── Send button ─────────────────────────────────────────────────────────────── */
#scb-send {
  flex-shrink: 0;
  width: 42px; height: 42px; border-radius: 50%;
  background: linear-gradient(135deg, var(--scb-primary) 0%, var(--scb-primary-light) 100%);
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: white;
  padding: 0;
  box-shadow: 0 3px 12px rgba(26,107,60,0.25);
  transition: background .15s, transform .15s, box-shadow .15s;
}
#scb-send svg { display: block; pointer-events: none; }
#scb-send:hover:not(:disabled)  { transform: scale(1.08); box-shadow: 0 4px 16px rgba(26,107,60,0.35); }
#scb-send:disabled               { background: #c8d8ce; cursor: not-allowed; box-shadow: none; }
#scb-send:active:not(:disabled)  { transform: scale(.92); }

/* ── Guided Flow options ─────────────────────────────────────────────────────── */
.scb-flow-message {
  font-size: 13.5px; line-height: 1.55; color: var(--scb-text);
  margin-bottom: 10px; font-weight: 500;
}
.scb-flow-options {
  display: flex; flex-direction: column; gap: 7px;
  margin-top: 6px;
}
.scb-flow-opt {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 10px 14px;
  background: white; border: 1.5px solid var(--scb-border);
  border-radius: 10px; cursor: pointer;
  font-size: 13.5px; font-family: var(--scb-font); color: var(--scb-text);
  font-weight: 500; text-align: left; line-height: 1.4;
  transition: border-color .15s, background .15s, transform .1s, box-shadow .15s;
}
.scb-flow-opt:hover  {
  border-color: var(--scb-primary); background: #f0faf4;
  box-shadow: 0 2px 8px rgba(26,107,60,.12); transform: translateX(2px);
}
.scb-flow-opt:active { transform: scale(.98); }
.scb-flow-opt--selected {
  border-color: var(--scb-primary); background: #e8f5ee;
  color: var(--scb-primary); font-weight: 600;
}
.scb-flow-opt:disabled { cursor: default; }
.scb-flow-arrow { color: var(--scb-primary); font-size: 16px; font-weight: 700; margin-left: 6px; }

/* ── Footer ──────────────────────────────────────────────────────────────────── */
#scb-footer {
  text-align: center; font-size: 10.5px; color: #b0c4ba; padding: 5px;
  background: var(--scb-bg); flex-shrink: 0; letter-spacing: .02em;
}

/* ── Related posts ───────────────────────────────────────────────────────────── */
.scb-posts-block { display: flex; flex-direction: column; gap: 6px; width: 100%; }

/* Toggle button */
.scb-posts-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  background: white;
  border: 1.5px solid var(--scb-primary);
  border-radius: 20px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--scb-font);
  color: var(--scb-primary);
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
  align-self: flex-start;
}
.scb-posts-toggle:hover  { background: #f0faf4; box-shadow: 0 2px 8px rgba(26,107,60,.15); }
.scb-posts-toggle:active { transform: scale(0.97); }
.scb-posts-toggle svg    { flex-shrink: 0; }
.scb-posts-chevron       { transition: transform 0.2s ease; margin-left: 2px; }

/* Hidden / visible post list */
.scb-posts-list { display: flex; flex-direction: column; gap: 6px; }
.scb-posts-list--hidden { display: none; }

.scb-post-card {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  background: white; border: 1.5px solid var(--scb-border); border-radius: 10px;
  text-decoration: none !important; color: var(--scb-text);
  transition: border-color .15s, box-shadow .15s, transform .1s; min-width: 0;
  animation: scb-msg-in 0.2s ease;
}
.scb-post-card:hover { border-color: var(--scb-primary); box-shadow: 0 2px 10px rgba(26,107,60,.12); transform: translateY(-1px); }
.scb-post-card:active { transform: scale(.99); }
.scb-post-thumb { width: 44px; height: 44px; border-radius: 7px; object-fit: cover; flex-shrink: 0; }
.scb-post-thumb--placeholder {
  width: 44px; height: 44px; border-radius: 7px; background: var(--scb-surface);
  border: 1px solid var(--scb-border); display: flex; align-items: center; justify-content: center;
  color: #c8d8ce; flex-shrink: 0;
}
.scb-post-info    { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.scb-post-title   { font-size: 12.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.scb-post-excerpt { font-size: 11.5px; color: var(--scb-text-muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.scb-post-arrow   { color: var(--scb-primary); flex-shrink: 0; opacity: .5; transition: opacity .15s, transform .15s; }
.scb-post-card:hover .scb-post-arrow { opacity: 1; transform: translateX(2px); }

/* ── Restored history label ──────────────────────────────────────────────────── */
.scb-restored-label { display: block; font-size: 10px; color: #b0c4ba; margin-top: 4px; font-style: italic; }

/* ── Tablet ───────────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  :root { --scb-w: 340px; --scb-h: 500px; }
  #scb-root { bottom: 16px; right: 16px; left: auto !important; }
  #scb-window { right: 0; bottom: 68px; width: calc(100vw - 32px); max-width: 100%; }
}

/* ── Mobile full-screen ──────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  #scb-root { bottom: 0; right: 0; left: auto; width: auto; }
  #scb-bubble { position: fixed; bottom: 18px; right: 18px; left: auto !important; width: 54px; height: 54px; z-index: calc(var(--scb-z) + 2); }
  #scb-window {
    position: fixed; bottom: 0; left: 0; right: 0; top: 0;
    width: 100%; max-width: 100%; height: 100%; max-height: 100%;
    border-radius: 0; transform-origin: bottom center;
    transform: translateY(100%);
    transition: transform .35s cubic-bezier(.22,1,.36,1), opacity .25s ease;
  }
  #scb-window.scb-window--open { transform: translateY(0); opacity: 1; }
  #scb-header { padding: max(16px, env(safe-area-inset-top)) 16px 16px; }
  #scb-input  { font-size: 16px; padding: 12px 16px; min-height: 48px; }
  #scb-input-area { padding: 8px 10px; padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  #scb-footer { padding-bottom: max(6px, env(safe-area-inset-bottom)); }
  #scb-send        { width: 46px; height: 46px; }
  #scb-voice-in,
  #scb-voice-out   { width: 40px; height: 40px; font-size: 17px; }
  .scb-bubble { font-size: 14px; padding: 11px 14px; }
  .scb-suggestion-btn:hover { transform: none; }
  .scb-category-grid { grid-template-columns: repeat(3,1fr); gap: 6px; }
  .scb-cat-chip { padding: 9px 4px; font-size: 11px; }
}
@media (max-width: 360px) {
  #scb-bubble { width: 50px; height: 50px; bottom: 14px; right: 14px; left: auto !important; }
  .scb-category-grid { grid-template-columns: repeat(2,1fr); }
}

/* ── Language toggle button ──────────────────────────────────────────────────── */
.scb-lang-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 6px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
  font-family: inherit;
  letter-spacing: 0.02em;
}
.scb-lang-btn:hover  { background: rgba(255,255,255,0.25); }
.scb-lang-btn:active { transform: scale(0.95); }

/* ── Exit Satisfaction Survey ────────────────────────────────────────────────── */
#scb-survey {
  position: absolute;
  bottom: 70px;
  right: 0;
  z-index: calc(var(--scb-z) + 1);
  width: 280px;
  animation: scb-survey-in 0.3s cubic-bezier(0.34,1.4,0.64,1);
}

@keyframes scb-survey-in {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.scb-survey-card {
  background: white;
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(26,107,60,0.18), 0 2px 8px rgba(0,0,0,0.1);
  padding: 18px 16px 16px;
  border: 1px solid var(--scb-border);
  position: relative;
}

.scb-survey-close {
  position: absolute;
  top: 10px; right: 10px;
  background: none; border: none;
  cursor: pointer; font-size: 14px;
  color: var(--scb-text-muted);
  width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.scb-survey-close:hover { background: var(--scb-surface); }

.scb-survey-q {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--scb-text);
  line-height: 1.4;
  margin-bottom: 14px;
  padding-right: 18px;
}

.scb-survey-btns {
  display: flex;
  gap: 6px;
}

.scb-survey-btn {
  flex: 1;
  padding: 8px 4px;
  border-radius: 8px;
  border: 1.5px solid var(--scb-border);
  background: var(--scb-surface);
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  font-weight: 600;
  color: var(--scb-text);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  text-align: center;
}
.scb-survey-btn:hover  { background: #f0faf4; border-color: var(--scb-primary); }
.scb-survey-btn:active { transform: scale(0.96); }
.scb-survey-yes:hover  { border-color: #16a34a; color: #16a34a; }
.scb-survey-no:hover   { border-color: #dc2626; color: #dc2626; }

.scb-survey-thanks {
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--scb-primary);
  padding: 12px 0;
}

/* Mobile: survey full width */
@media (max-width: 480px) {
  #scb-survey { width: calc(100vw - 32px); bottom: 80px; right: 16px; }
}

/* ── Welcome Screen ───────────────────────────────────────────────────────────── */
#scb-welcome-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  position: relative;
}
.scb-welcome-bg {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(145deg, var(--scb-primary) 0%, color-mix(in srgb, var(--scb-primary) 70%, #000) 100%);
  border-radius: 0;
  padding: 28px 24px 20px;
  position: relative;
  overflow: hidden;
}
.scb-welcome-bg::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -30%;
  width: 80%;
  height: 80%;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
}
.scb-welcome-bg::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: -20%;
  width: 60%;
  height: 60%;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}
.scb-welcome-logo {
  position: relative;
  z-index: 1;
  margin-bottom: 20px;
}
.scb-welcome-logo-img {
  max-width: 80px;
  max-height: 50px;
  object-fit: contain;
  border-radius: 8px;
}
.scb-welcome-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 28px 22px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.12);
}
.scb-welcome-title {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 10px;
  line-height: 1.3;
}
.scb-welcome-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.8);
  margin: 0;
  line-height: 1.5;
}
.scb-welcome-start-wrap {
  position: relative;
  z-index: 1;
  margin-top: 20px;
}
.scb-welcome-start-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  background: #fff;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transition: box-shadow 0.2s, transform 0.15s;
}
.scb-welcome-start-btn:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,0.18);
  transform: translateY(-1px);
}
.scb-welcome-start-btn:active { transform: scale(0.98); }
.scb-welcome-start-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--scb-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.scb-welcome-start-text {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.scb-welcome-start-text strong {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}
.scb-welcome-start-text small {
  font-size: 11px;
  color: #6b7280;
  font-weight: 400;
}

/* ── Chat Main Container ──────────────────────────────────────────────────────── */
#scb-chat-main {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  position: relative;
  overflow: hidden;
  border-radius: inherit;
}

/* ── Email Capture Popup (centered overlay inside panel) ──────────────────────── */
#scb-email-popup {
  position: absolute;
  inset: 0;
  z-index: calc(var(--scb-z) + 2);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  border-radius: inherit;
}

#scb-email-popup.scb-email-popup--visible {
  opacity: 1;
  pointer-events: auto;
  backdrop-filter: blur(5px);
}

.scb-email-popup-card {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  padding: 20px 20px;
  width: stretch;
  max-width: 95%;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  position: relative;
  animation: scbEmailIn 0.25s ease;
}
@keyframes scbEmailIn { from { opacity:0; transform:scale(0.95); } to { opacity:1; transform:scale(1); } }

.scb-email-popup-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #9ca3af;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.scb-email-popup-close:hover { background: #f3f4f6; color: #374151; }

.scb-email-popup-title {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 5px;
  padding-right: 24px;
  line-height: 1.35;
}

.scb-email-popup-sub {
  font-size: 12.5px;
  color: #6b7280;
  margin-bottom: 14px;
  line-height: 1.4;
}

.scb-email-popup-input {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
  color: #111827;
  background: #f9fafb;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  margin-bottom: 4px;
}
.scb-email-popup-input:focus {
  border-color: var(--scb-primary);
  box-shadow: 0 0 0 3px rgba(26,107,60,0.1);
  background: #fff;
}
.scb-email-popup-input::placeholder { color: #b0b7c3; }

.scb-email-popup-error {
  font-size: 11.5px;
  color: #dc2626;
  margin-bottom: 6px;
  padding-left: 2px;
}

.scb-email-popup-submit {
  width: 100%;
  margin-top: 10px;
  padding: 10px 0;
  background: var(--scb-primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}
.scb-email-popup-submit:hover  { opacity: 0.9; }
.scb-email-popup-submit:active { transform: scale(0.98); }

@media (max-width: 480px) {
  #scb-email-popup { width: 100%; }
  .scb-email-popup-card { width: 90%; }
}



/* ── WhatsApp Escalation Card ────────────────────────────────────────────────── */
.scb-wa-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1.5px solid #86efac;
  border-radius: 12px;
  animation: scb-msg-in 0.3s ease;
}

.scb-wa-card--no-link {
  background: var(--scb-surface);
  border-color: var(--scb-border);
}

.scb-wa-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #25D366;
  box-shadow: 0 3px 12px rgba(37,211,102,0.35);
  flex-shrink: 0;
  align-self: flex-start;
}

.scb-wa-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scb-wa-heading {
  font-size: 13.5px;
  font-weight: 700;
  color: #14532d;
  line-height: 1.4;
}

.scb-wa-subtext {
  font-size: 12.5px;
  color: #166534;
  line-height: 1.5;
  opacity: 0.85;
}

.scb-wa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  background: #25D366;
  color: white !important;
  font-size: 13.5px;
  font-weight: 700;
  font-family: var(--scb-font);
  text-decoration: none !important;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  box-shadow: 0 3px 14px rgba(37,211,102,0.4);
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  letter-spacing: 0.01em;
}

.scb-wa-btn:hover {
  background: #1db954;
  transform: translateY(-1px);
  box-shadow: 0 5px 18px rgba(37,211,102,0.5);
}

.scb-wa-btn:active {
  transform: scale(0.97);
}

/* ── Mobile WhatsApp ─────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .scb-wa-card  { padding: 12px; gap: 8px; }
  .scb-wa-btn   { padding: 12px 14px; font-size: 14px; }
}

/* ═══════════════════════════════════════════════════════════════════════════════
   Contact Form — in-chatbot mini form
   ─────────────────────────────────────────────────────────────────────────── */

/* Header button to open the form */
.scb-cf-header-btn {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  color: #fff;
  font-size: 11px;
  padding: 4px 6px;
  cursor: pointer;
  margin-right: 2px;
  line-height: 1.4;
  white-space: nowrap;
  transition: background 0.15s;
  font-family: var(--scb-font);
}
.scb-cf-header-btn:hover { background: rgba(255,255,255,0.30); }

/* Card wrapper — sits inside a bot message bubble */
.scb-cf-card {
  font-size: 12px;
  line-height: 1.5;
  padding: 0;
}

.scb-cf-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--scb-primary, #1a6b3c);
  margin-bottom: 3px;
}

.scb-cf-desc {
  font-size: 11.5px;
  color: #666;
  margin: 0 0 10px;
  line-height: 1.4;
}

/* Fields wrapper */
.scb-cf-fields {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 10px;
}

.scb-cf-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.scb-cf-label {
  font-size: 11px;
  font-weight: 600;
  color: #444;
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
}

.scb-cf-req {
  color: #d0342c;
  font-size: 11px;
}

.scb-cf-math-q {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--scb-primary, #1a6b3c);
  background: rgba(26,107,60,0.08);
  border-radius: 4px;
  padding: 1px 6px;
  margin-left: 2px;
}

/* Input / textarea */
.scb-cf-input {
  font-size: 12px;
  font-family: var(--scb-font);
  padding: 5px 8px;
  border: 1px solid #d4d4d4;
  border-radius: 6px;
  background: #fff;
  color: #222;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
  box-sizing: border-box;
  -webkit-appearance: none;
}
.scb-cf-input:focus {
  border-color: var(--scb-primary, #1a6b3c);
  box-shadow: 0 0 0 2px rgba(26,107,60,0.12);
}

.scb-cf-textarea {
  resize: vertical;
  min-height: 52px;
  line-height: 1.4;
}

/* Error message */
.scb-cf-error {
  font-size: 11.5px;
  color: #c0392b;
  background: #fdecea;
  border: 1px solid #f5c6c3;
  border-radius: 5px;
  padding: 5px 8px;
  margin-bottom: 8px;
  line-height: 1.4;
}

/* Submit button */
.scb-cf-submit {
  width: 100%;
  background: var(--scb-primary, #1a6b3c);
  color: #fff;
  border: none;
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: var(--scb-font);
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background 0.15s, transform 0.1s;
}
.scb-cf-submit:hover:not(:disabled)  { filter: brightness(1.08); }
.scb-cf-submit:active:not(:disabled) { transform: scale(0.98); }
.scb-cf-submit:disabled              { opacity: 0.6; cursor: not-allowed; }

/* Success state */
.scb-cf-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 0 4px;
  text-align: center;
}
.scb-cf-success-icon { font-size: 26px; }
.scb-cf-success-msg  { font-size: 12.5px; color: #2d6a2d; font-weight: 600; line-height: 1.4; }

/* ── Appointment Form ────────────────────────────────────────────────────────── */
.scb-appt-card {
  background: rgba(255, 255, 255, 0.15);
  border: 1.5px solid var(--scb-border);
  border-radius: 12px;
  padding: 14px;
  width: 100%;
}
.scb-appt-card .scb-cf-input[type="date"],
.scb-appt-card select.scb-cf-input {
  appearance: auto;
  -webkit-appearance: auto;
}
.scb-appt-submit {
  width: 100%;
  padding: 10px 16px;
  background: var(--scb-primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--scb-font);
  cursor: pointer;
  margin-top: 10px;
  transition: background .15s, transform .1s;
}
.scb-appt-submit:hover:not(:disabled) { background: var(--scb-primary-light); transform: scale(1.01); }
.scb-appt-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* ── Doctors List in Chat ────────────────────────────────────────────────────── */
.scb-doctors-list { width: 100%; }
.scb-dept-group { margin-bottom: 5px; }
.scb-dept-toggle {
  display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 6px 12px; background: #fff;
  border: none; border-radius: 8px; cursor: pointer; font-family: var(--scb-font);
  font-size: 12px; font-weight: 600; color: #1a6b3c;
  text-transform: uppercase; letter-spacing: 0.3px;
  box-shadow: 0 1px 4px rgba(26,107,60,0.2);
  transition: background .15s, box-shadow .15s;
  border: none !important;
  margin-left: -8px !important;
}
.scb-dept-toggle:hover { background: #f0faf4; box-shadow: 0 2px 8px rgba(26,107,60,0.12); }
.scb-dept-open { background: #f0faf4; box-shadow: 0 2px 8px rgba(26,107,60,0.14); }
.scb-dept-icon {
  width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--scb-primary); color: white; border-radius: 4px;
  font-size: 13px; font-weight: 700; line-height: 1; flex-shrink: 0;
}
.scb-dept-name { flex: 1; text-align: left; }
.scb-dept-count { font-size: 11px; color: #6b8c7a; font-weight: 500; }
.scb-dept-doctors { padding: 6px 0 2px 0; }

.scb-doctor-item { margin-bottom: 4px; }
.scb-doctor-toggle {
  display: flex; align-items: center; gap: 6px; width: 100%;
  padding: 6px 12px; background: #fff; border: none;
  border-radius: 6px; cursor: pointer; font-family: var(--scb-font);
  font-size: 12px; font-weight: 600; color: var(--scb-text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: background .15s, box-shadow .15s;
  border: none !important;
  margin-left: 5px !important;
}
.scb-doctor-toggle:hover { background: #f8fdfb; box-shadow: 0 2px 6px rgba(26,107,60,0.1); }
.scb-doc-open { background: #f0faf4; box-shadow: 0 2px 6px rgba(26,107,60,0.12); }
.scb-doc-expand-icon {
  width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center;
  background: #e4ede9; color: #445c4e; border-radius: 3px;
  font-size: 12px; font-weight: 700; line-height: 1; flex-shrink: 0;
}
.scb-doc-open .scb-doc-expand-icon { background: var(--scb-primary); color: white; }
.scb-doc-name-label { flex: 1; text-align: left; }

.scb-doctor-detail {
  margin: 4px 0 4px 10px; padding: 8px;
  background: #f8fdfb; border-radius: 8px;
  box-shadow: inset 0 1px 3px rgba(26,107,60,0.06), 0 1px 4px rgba(0,0,0,0.04);
  animation: scb-msg-in 0.2s ease;
}
.scb-doc-info-row { font-size: 12px; color: #445c4e; line-height: 1.8; }
.scb-doc-info-label { font-weight: 600; color: #1c2b22; }
.scb-doc-appt-btn {
  display: inline-block; margin-top: 0px; padding: 7px 16px;
  background: var(--scb-primary); color: white; border: none; border-radius: 6px;
  font-size: 12px; font-weight: 600; font-family: var(--scb-font);
  cursor: pointer; box-shadow: 0 2px 6px rgba(26,107,60,0.2);
  transition: background .15s, transform .1s, box-shadow .15s;
}

.scb-doc-appt-btn:hover { background: var(--scb-primary-light); transform: scale(1.02); box-shadow: 0 3px 10px rgba(26,107,60,0.25); }
.scb-doc-appt-btn:active { transform: scale(0.97); }

/* Doctor on-leave badge */
.scb-doc-on-leave {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 8px; padding: 6px 12px;
  background: #fff7ed; border: 1.5px solid #fed7aa;
  border-radius: 8px; font-size: 12px; font-weight: 600;
  color: #c2410c;
}

/* Appointment form leave notice */
.scb-doc-leave-notice {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 12px; background: #fff7ed;
  border: 1.5px solid #fed7aa; border-radius: 8px;
  font-size: 13px; font-weight: 600; color: #c2410c;
  margin-top: 4px;
}

/* Doctor photo in detail */
.scb-doc-photo {
  width: 64px; height: 64px; border-radius: 50%; object-fit: cover;
  border: 2px solid var(--scb-border); margin-bottom: 8px; display: block;
}
.scb-doc-photo-placeholder {
  display: flex; width: 64px; height: 64px; border-radius: 50%;
  background: var(--scb-surface); border: 2px dashed #c8d8ce;
  align-items: center; justify-content: center; font-size: 24px; margin-bottom: 8px;
}

/* ── Tests/Pricing Table in Chat ─────────────────────────────────────────────── */
.scb-tests-list { width: 100%; }
.scb-tests-grid { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.scb-test-card {
  background: #fff; border: 1px solid var(--scb-border); border-radius: 8px;
  padding: 8px 10px;
}
.scb-test-package { border-left: 3px solid var(--scb-primary); }
.scb-chat-table {
  width: 100%; border-collapse: collapse; font-size: 12px;
}
.scb-chat-table th {
  background: var(--scb-surface); padding: 6px 8px; text-align: left;
  font-size: 11px; font-weight: 600; color: var(--scb-text-muted);
  border-bottom: 1.5px solid var(--scb-border);
}
.scb-chat-table td {
  padding: 6px 8px; border-bottom: 1px solid var(--scb-border);
  font-size: 12px; color: var(--scb-text); vertical-align: top;
}

/* ── Category Action Buttons ─────────────────────────────────────────────────── */
.scb-cat-action-btns {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px;
  padding-top: 10px; border-top: 1px dashed var(--scb-border);
}
.scb-cat-action-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 8px 14px; background: var(--scb-primary); color: white;
  border: none; border-radius: 8px; cursor: pointer;
  font-size: 12.5px; font-weight: 600; font-family: var(--scb-font);
  box-shadow: 0 2px 6px rgba(26,107,60,0.2);
  transition: background .15s, transform .1s, box-shadow .15s;
}
.scb-cat-action-btn:hover { background: var(--scb-primary-light); transform: scale(1.02); box-shadow: 0 3px 10px rgba(26,107,60,0.25); }
.scb-cat-action-btn:active { transform: scale(0.97); }

/* ── Main Menu Button ────────────────────────────────────────────────────────── */
.scb-main-menu-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; background: white; border: 1.5px solid var(--scb-primary);
  border-radius: 20px; cursor: pointer; font-size: 13px; font-weight: 600;
  font-family: var(--scb-font); color: var(--scb-primary);
  transition: background .15s, transform .1s, box-shadow .15s;
}
.scb-main-menu-btn:hover { background: #f0faf4; box-shadow: 0 2px 8px rgba(26,107,60,0.15); transform: translateY(-1px); }
.scb-main-menu-btn:active { transform: scale(0.97); }

/* ── Report Download Form ────────────────────────────────────────────────────── */
.scb-report-form { width: 100%; }
.scb-report-error {
  font-size: 11.5px; color: #c0392b; background: #fdecea;
  border: 1px solid #f5c6c3; border-radius: 5px;
  padding: 5px 8px; margin-bottom: 8px; line-height: 1.4;
}

/* Report results */
.scb-report-results { width: 100%; }
.scb-report-download-card {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  background: white; border: 1.5px solid var(--scb-border); border-radius: 10px;
  text-decoration: none !important; color: var(--scb-text); margin-bottom: 6px;
  transition: border-color .15s, box-shadow .15s, transform .1s;
}
.scb-report-download-card:hover { border-color: var(--scb-primary); box-shadow: 0 2px 10px rgba(26,107,60,0.12); transform: translateY(-1px); }
.scb-report-icon { font-size: 22px; flex-shrink: 0; }
.scb-report-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.scb-report-title { font-size: 13px; font-weight: 600; color: var(--scb-text); }
.scb-report-date { font-size: 11px; color: var(--scb-text-muted); }
.scb-report-dl-icon { font-size: 16px; flex-shrink: 0; opacity: .6; transition: opacity .15s; }
.scb-report-download-card:hover .scb-report-dl-icon { opacity: 1; }

/* ── Live Agent Offer Card ───────────────────────────────────────────────────── */
.scb-live-offer {
  display: flex; flex-direction: column; gap: 8px; padding: 12px;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1.5px solid #93c5fd; border-radius: 12px;
}
.scb-live-offer-text { font-size: 13px; color: #1e40af; line-height: 1.5; font-weight: 500; }
.scb-live-offer-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; background: #2563eb; color: white; border: none;
  border-radius: 8px; font-size: 13px; font-weight: 600; font-family: var(--scb-font);
  cursor: pointer; transition: background .15s, transform .1s;
}
.scb-live-offer-btn:hover { background: #1d4ed8; transform: scale(1.02); }
.scb-live-offer-btn:active { transform: scale(0.97); }
.scb-live-offer-btn:disabled { background: #93c5fd; cursor: not-allowed; }

/* Mobile tweaks */
@media (max-width: 480px) {
  .scb-cf-title        { font-size: 12.5px; }
  .scb-cf-input        { font-size: 13px; padding: 6px 9px; }
  .scb-cf-submit       { font-size: 13px; padding: 9px 14px; }
}

/* ── Custom Appointment Calendar ─────────────────────────────────────────────── */
.scb-cal-wrap { width: 100%; }

/* Collapsed / open states */
.scb-cal-collapsed { display: none; }
.scb-cal-open      { display: block; margin-top: 6px; animation: scb-msg-in .2s ease; }

/* Trigger button (replaces the plain date input) */
.scb-cal-trigger {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  padding: 9px 12px;
  background: var(--scb-surface);
  border: 1.5px solid var(--scb-border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-family: var(--scb-font);
  color: var(--scb-text-muted);
  text-align: left;
  transition: border-color .15s, background .15s;
}
.scb-cal-trigger:hover { border-color: var(--scb-primary); background: white; }
.scb-cal-trigger--selected {
  border-color: var(--scb-primary);
  color: var(--scb-primary);
  font-weight: 600;
  background: white;
}

.scb-cal {
  width: 100%;
  border: 1.5px solid var(--scb-border);
  border-radius: 10px;
  overflow: hidden;
  background: white;
  font-size: 12px;
  user-select: none;
}

/* Header: month nav */
.scb-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--scb-primary);
  color: white;
  padding: 8px 10px;
}
.scb-cal-month {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .01em;
}
.scb-cal-nav {
  background: rgba(255,255,255,.15);
  border: none;
  color: white;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.scb-cal-nav:hover:not(:disabled) { background: rgba(255,255,255,.3); }
.scb-cal-nav:disabled { opacity: .35; cursor: not-allowed; }

/* Grid */
.scb-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
  background: var(--scb-border);
  padding: 0;
}

/* Day-of-week headers */
.scb-cal-dh {
  background: #f8faf9;
  text-align: center;
  padding: 5px 0;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--scb-text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* Day cells */
.scb-cal-day {
  background: white;
  text-align: center;
  padding: 7px 2px;
  cursor: pointer;
  font-size: 12px;
  color: var(--scb-text);
  transition: background .12s, color .12s;
  position: relative;
}
.scb-cal-day:hover:not(.scb-cal-disabled) {
  background: #f0faf4;
  color: var(--scb-primary);
  font-weight: 700;
}
.scb-cal-empty { background: #fafafa; cursor: default; }

/* Today highlight */
.scb-cal-today {
  font-weight: 700;
  color: var(--scb-primary);
}
.scb-cal-today::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--scb-primary);
}

/* Selected */
.scb-cal-selected {
  background: var(--scb-primary) !important;
  color: white !important;
  font-weight: 700;
  border-radius: 4px;
}
.scb-cal-selected::after { display: none; }

/* Disabled (past / beyond max) */
.scb-cal-disabled {
  color: #c8d8ce;
  cursor: not-allowed;
  background: #fafafa;
}

/* Unavailable (doctor not available that day) */
.scb-cal-unavail {
  background: #fef2f2 !important;
  color: #fca5a5 !important;
  cursor: not-allowed;
  position: relative;
}
.scb-cal-unavail::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: rgba(239,68,68,.08);
}

/* Legend */
.scb-cal-legend {
  padding: 6px 10px;
  font-size: 10.5px;
  color: var(--scb-text-muted);
  background: #f8faf9;
  border-top: 1px solid var(--scb-border);
  display: flex;
  align-items: center;
  gap: 4px;
}
.scb-cal-leg-avail  { color: var(--scb-primary); font-size: 14px; }
.scb-cal-leg-unavail { color: #fca5a5; font-size: 14px; }

/* Mobile */
@media (max-width: 480px) {
  .scb-cal-day { padding: 6px 1px; font-size: 11px; }
  .scb-cal-dh  { font-size: 9.5px; padding: 4px 0; }
}
