#sharkschat-root { position: fixed; bottom: 20px; right: 20px; z-index: 99999; font-family: system-ui, sans-serif; }
.sc-bubble { width: 64px; height: 64px; border-radius: 50%; background: #fff; color: #111;
  border: 0.75px solid #111; cursor: pointer; box-shadow: 0 6px 20px rgba(0,0,0,.18);
  display: flex; align-items: center; justify-content: center; padding: 0;
  transition: transform .15s ease, box-shadow .15s ease; }
.sc-bubble:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(0,0,0,.26); }
.sc-bubble-icon { width: 32px; height: 32px; display: block; }
.sc-panel { display: none; flex-direction: column; width: 360px; max-width: calc(100vw - 40px); height: 520px;
  max-height: calc(100vh - 120px); background: #fff; border-radius: 14px; overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.28); position: absolute; bottom: 76px; right: 0; }
.sc-panel.open { display: flex; }
.sc-header { background: var(--sc-accent, #0b6efd); color: #fff; padding: 12px 10px 12px 16px; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sc-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sc-close { background: transparent; border: none; color: #fff; font-size: 24px; line-height: 1; cursor: pointer;
  padding: 2px 8px; margin: 0; opacity: .85; border-radius: 6px; }
.sc-close:hover { opacity: 1; background: rgba(255,255,255,.18); }
.sc-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #f7f8fa; }
.sc-msg { padding: 10px 12px; border-radius: 12px; max-width: 80%; line-height: 1.4; white-space: pre-wrap; word-wrap: break-word; }
.sc-msg.user { align-self: flex-end; background: var(--sc-accent, #0b6efd); color: #fff; }
.sc-msg.bot { align-self: flex-start; background: #fff; border: 1px solid #e5e7eb; color: #111; }
.sc-form { display: flex; border-top: 1px solid #e5e7eb; }
/* font-size PEAB olema >=16px, muidu iOS Safari zoomib inputi fookusel sisse
   (zoom muudab vaateava ~352px-ks ja lükkab fixed-paneeli paigast/üle serva). */
.sc-form input { flex: 1; border: none; padding: 14px; font-size: 16px; outline: none; }
.sc-form button { border: none; background: var(--sc-accent, #0b6efd); color: #fff; padding: 0 18px; cursor: pointer; }
.sc-typing { font-style: italic; opacity: .6; }

/* Mobiil: võimalikult LIHTNE ja iOS-kindel. Ainult plain px left/right insetid +
   width:auto. EI ole max()/calc(%)/transform/margin:auto (kõik iOS riskikohad).
   left:24 + right:24 -> kast on definitsiooni järgi vaateava sees ja sümmeetriline
   (keskel), ei saa üle ühegi serva ulatuda ega lehte laiemaks venitada. */
@media (max-width: 600px) {
  /* TÄHTIS: #sharkschat-root EI tohi olla position:fixed mobiilis. Kui paneel (fixed)
     on fixed-esivanema sees, paigutab iOS Safari selle TEISEL avamisel (peale sulgemist)
     valesti — esivanema (right:20px) suhtes -> hüppab paremale. Teeme rooti staatiliseks
     ja mull + paneel ise fixed (otse vaateava suhtes) -> alati keskel, igal avamisel. */
  #sharkschat-root { position: static; }
  .sc-bubble {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 99999;
  }
  .sc-panel {
    position: fixed;
    left: 36px;
    right: 36px;
    bottom: 90px;
    width: auto;
    max-width: none;
    margin: 0;
    transform: none;
    height: auto;
    max-height: calc(100vh - 120px);
    max-height: calc(100dvh - 120px);
    z-index: 99999;
  }
}
/* Vidin ei tohi lehte horisontaalselt laiemaks venitada */
#sharkschat-root { max-width: 100vw; box-sizing: border-box; }
