/* JBD saruna lapā */
.jbc { position: fixed; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); z-index: 85; font-family: var(--jb-sans, Figtree, -apple-system, sans-serif); color: var(--jb-ink, #111); }
.jbc-launch { position: relative; width: 58px; height: 58px; border: 0; border-radius: 50%; background: var(--jb-ink, #111); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 10px 28px rgba(0,0,0,.24); transition: transform .2s ease; }
.jbc-launch:hover { transform: translateY(-2px); }
.jbc-launch__close { display: none; }
.jbc.is-open .jbc-launch__open { display: none; }
.jbc.is-open .jbc-launch__close { display: block; }
.jbc-launch__badge { position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #b3261e; color: #fff; font-size: 11px; line-height: 20px; text-align: center; font-weight: 600; }
.jbc-launch__badge[hidden] { display: none; }
.jbc-panel { position: absolute; right: 0; bottom: 72px; width: min(380px, calc(100vw - 24px)); height: min(580px, calc(100dvh - 120px)); display: flex; flex-direction: column; background: var(--jb-paper, #fff); box-shadow: 0 24px 64px rgba(17,17,17,.22); border: 1px solid var(--jb-line, #e4e1da); overflow: hidden; animation: jbcIn .22s cubic-bezier(.2,.8,.2,1); }
.jbc-panel[hidden] { display: none; }
@keyframes jbcIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.jbc-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 12px 16px; background: var(--jb-ink, #111); color: #fff; }
.jbc-avatar { width: 36px; height: 36px; border-radius: 50%; background: #fff; color: var(--jb-ink, #111); display: inline-flex; align-items: center; justify-content: center; font-family: var(--jb-serif, Georgia, serif); font-size: 15px; flex: none; }
.jbc-head__text { flex: 1; min-width: 0; }
.jbc-head__title { margin: 0; font-size: 11px; letter-spacing: .22em; }
.jbc-head__sub { margin: 2px 0 0; font-size: 12px; color: rgba(255,255,255,.72); }
.jbc.is-human .jbc-head__sub::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #5fd38a; vertical-align: 1px; }
.jbc-x { width: 34px; height: 34px; border: 0; background: none; color: #fff; font-size: 24px; line-height: 1; cursor: pointer; }
.jbc-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--jb-tint, #f3f2ef); overscroll-behavior: contain; }
.jbc-msg { max-width: 86%; display: flex; flex-direction: column; gap: 3px; align-self: flex-start; }
.jbc-msg__who { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--jb-grey-2, #8b877f); }
.jbc-msg__b { padding: 10px 13px; background: #fff; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.jbc-msg__b a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.jbc-msg__t { font-size: 10px; color: var(--jb-grey-2, #8b877f); }
.jbc-msg--visitor { align-self: flex-end; align-items: flex-end; }
.jbc-msg--visitor .jbc-msg__b { background: var(--jb-ink, #111); color: #fff; }
.jbc-msg--staff .jbc-msg__b { border-left: 3px solid #2f9e55; }
.jbc-msg--system { align-self: center; max-width: 100%; }
.jbc-msg--system .jbc-msg__b { background: none; padding: 2px 6px; font-size: 12px; color: var(--jb-grey-1, #5f5c57); text-align: center; }
.jbc-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 12px 14px; background: #fff; }
.jbc-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--jb-grey-2, #8b877f); animation: jbcDot 1.2s infinite ease-in-out; }
.jbc-typing span:nth-child(2) { animation-delay: .15s; } .jbc-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes jbcDot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.jbc-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px 0; background: var(--jb-tint, #f3f2ef); }
.jbc-chips[hidden] { display: none; }
.jbc-chip { padding: 7px 11px; border: 1px solid var(--jb-line, #e4e1da); background: #fff; font: inherit; font-size: 12px; cursor: pointer; }
.jbc-chip:hover { border-color: var(--jb-ink, #111); }
.jbc-human { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-top: 1px solid var(--jb-line, #e4e1da); background: #fff; }
.jbc-human[hidden] { display: none; }
.jbc-human__t { margin: 0; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; }
.jbc-human input { height: 40px; padding: 0 10px; border: 1px solid var(--jb-line, #e4e1da); font: inherit; font-size: 14px; }
.jbc-human__btns { display: flex; align-items: center; gap: 12px; }
.jbc-btn { padding: 10px 16px; border: 0; background: var(--jb-ink, #111); color: #fff; font: inherit; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; cursor: pointer; }
.jbc-link { border: 0; background: none; font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; color: var(--jb-grey-1, #5f5c57); }
.jbc-form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--jb-line, #e4e1da); background: #fff; }
.jbc-form textarea { flex: 1; min-height: 40px; max-height: 120px; padding: 10px 12px; border: 1px solid var(--jb-line, #e4e1da); font: inherit; font-size: 14px; resize: none; outline: none; }
.jbc-form textarea:focus { border-color: var(--jb-ink, #111); }
.jbc-send { flex: none; width: 40px; height: 40px; border: 0; background: var(--jb-ink, #111); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.jbc-foot { display: flex; justify-content: space-between; gap: 8px; padding: 8px 12px 12px; background: #fff; }
.jbc-foot__a { flex: 1; padding: 8px 6px; border: 1px solid var(--jb-line, #e4e1da); background: none; font: inherit; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; text-align: center; color: var(--jb-ink, #111); text-decoration: none; cursor: pointer; }
.jbc-foot__a:hover { border-color: var(--jb-ink, #111); }
html.jb-modal-open .jbc, html.jb-printing .jbc { display: none; }
@media (max-width: 560px) {
  .jbc { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); }
  .jbc-launch { width: 52px; height: 52px; }
  .jbc-panel { position: fixed; right: 8px; left: 8px; bottom: calc(76px + env(safe-area-inset-bottom)); width: auto; height: calc(100dvh - 100px); }
}
@media (prefers-reduced-motion: reduce) { .jbc-panel { animation: none; } .jbc-typing span { animation: none; } }

.jbc-note { margin: 0; padding: 8px 14px; background: #fff; border-bottom: 1px solid var(--jb-line, #e4e1da); font-size: 11px; line-height: 1.45; color: var(--jb-grey-1, #5f5c57); }
.jbc-foot__a { flex: 1 1 0; }

/* Lielāks logs datorā, viss ekrāns telefonā */
.jbc-panel { width: min(440px, calc(100vw - 32px)); height: min(780px, calc(100dvh - 110px)); }
@media (max-width: 560px) {
  .jbc-panel { position: fixed; inset: 0; width: auto; height: 100dvh; border: 0; padding-bottom: env(safe-area-inset-bottom); animation-name: jbcUp; }
  .jbc-head { padding-top: calc(14px + env(safe-area-inset-top)); }
  .jbc.is-open .jbc-launch { display: none; }
  html.jbc-lock, html.jbc-lock body { overflow: hidden; }
}
@keyframes jbcUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.jbc-li { display: block; position: relative; padding-left: 14px; margin: 3px 0; }
.jbc-li::before { content: "•"; position: absolute; left: 2px; }
@media (max-width: 560px) { .jbc.is-open { z-index: 100000; } }

/* Saite uz noformēšanu no sarunas */
.jbc-msg__b a.jbc-cta { display: inline-block; margin: 6px 0 2px; padding: 9px 14px; background: var(--jb-ink, #111); color: #fff; text-decoration: none; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
.jbc-msg__b a.jbc-cta:hover { opacity: .88; }

/* Skārienekrāni: 16 px, lai iPhone nepietuvina, ieklikšķinot laukā */
@media (pointer: coarse), (max-width: 900px) { .jbc-form textarea, .jbc-human input { font-size: 16px; } }
