/* ============================================================================
   SchoolNotes - sn30-chat.css  (v33)
   Full-screen-capable "Nova" consultant panel + the compact WhatsApp picker.
   Presentation only: no layout of the page itself is touched.
   ============================================================================ */

/* legacy chat launchers are retired - Nova is the single entry point */
[class*="sn26-chat-fab"], [id*="sn26-chat-fab"], [class*="sn24-chat-launch"],
#sn24-launcher, #sn26-launcher, .sn-chat-fab, #sn-chat-launcher, .chat-launcher {
  display: none !important;
}

.sn30-root { position: fixed; z-index: 12000; right: 0; bottom: 0; }

/* ------------------------------------------------------------------ launcher */
.sn30-fab {
  position: fixed; right: 16px; bottom: calc(74px + env(safe-area-inset-bottom, 0px));
  display: inline-flex; align-items: center; gap: 9px;
  padding: 13px 18px; border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(135deg, #1A67C4, #14335c);
  color: #fff; font-weight: 800; font-size: .92rem; font-family: inherit;
  box-shadow: 0 14px 30px -12px rgba(20, 51, 92, .7);
  transition: transform .16s ease, box-shadow .16s ease;
}
.sn30-fab:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -14px rgba(20, 51, 92, .8); }
.sn30-fab i { font-size: 1.1rem; }
.sn30-fab-dot {
  position: absolute; top: 6px; right: 10px; width: 9px; height: 9px; border-radius: 50%;
  background: #22c55e; box-shadow: 0 0 0 3px rgba(255, 255, 255, .55);
}
.sn30-root.is-open .sn30-fab { opacity: 0; pointer-events: none; }
@media (max-width: 560px) { .sn30-fab-label { display: none; } }
@media (min-width: 900px) { .sn30-fab { right: 24px; bottom: 24px; } }

/* --------------------------------------------------------------------- panel */
.sn30-panel {
  position: fixed; right: 16px; bottom: 16px;
  width: min(392px, calc(100vw - 24px));
  height: min(588px, calc(100vh - 40px));
  display: flex; flex-direction: column; overflow: hidden;
  background: #fff; border: 1px solid #dbe6f6; border-radius: 18px;
  box-shadow: 0 30px 70px -24px rgba(8, 30, 80, .45);
  font-family: Inter, Arial, Helvetica, sans-serif;
}
.sn30-panel[hidden] { display: none; }
@media (max-width: 700px) {
  .sn30-panel { right: 0; left: 0; bottom: 0; width: 100%; height: 88vh; border-radius: 18px 18px 0 0; }
}

.sn30-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: linear-gradient(120deg, #1A67C4, #14335c); color: #fff;
}
.sn30-avatar {
  flex: 0 0 auto; width: 36px; height: 36px; border-radius: 11px;
  background: rgba(255, 255, 255, .18); display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.sn30-head-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.sn30-head-txt strong { font-size: .98rem; }
.sn30-head-txt small { font-size: .72rem; opacity: .9; }
.sn30-online { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #22c55e; margin-right: 4px; }
.sn30-head-wa, .sn30-head-x {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; border: 0; cursor: pointer;
  background: rgba(255, 255, 255, .16); color: #fff; display: flex; align-items: center; justify-content: center;
}
.sn30-head-wa:hover, .sn30-head-x:hover { background: rgba(255, 255, 255, .28); }

.sn30-feed { flex: 1 1 auto; overflow-y: auto; padding: 14px; background: #F7F9FC; }
.sn30-msg { display: flex; gap: 8px; margin-bottom: 12px; align-items: flex-end; }
.sn30-me { justify-content: flex-end; }
.sn30-ava {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 8px; background: #1A67C4; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: .7rem;
}
.sn30-bubble {
  max-width: 86%; background: #fff; border: 1px solid #e3ebf7; border-radius: 14px;
  padding: 10px 13px; font-size: .87rem; line-height: 1.5; color: #232733;
  box-shadow: 0 2px 8px rgba(20, 51, 92, .05);
}
.sn30-me .sn30-bubble { background: #1A67C4; border-color: #1A67C4; color: #fff; }
.sn30-bubble p { margin: 0 0 7px; }
.sn30-bubble p:last-child { margin-bottom: 0; }

.sn30-points { list-style: none; margin: 6px 0 0; padding: 0; }
.sn30-points li { display: flex; gap: 8px; align-items: flex-start; padding: 3px 0; }
.sn30-points li i { flex: 0 0 auto; margin-top: 3px; font-size: .74rem; color: #1A67C4; }
.sn30-points li span { flex: 1 1 auto; }
.sn30-link { color: #1A67C4; font-weight: 700; text-decoration: underline; }

@keyframes sn30dots { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-4px); opacity: .9; } }
.sn30-typing .sn30-bubble { display: inline-flex; gap: 4px; }
.sn30-typing .sn30-bubble span { width: 6px; height: 6px; border-radius: 50%; background: #9aa9c0; animation: sn30dots 1.1s infinite; }
.sn30-typing .sn30-bubble span:nth-child(2) { animation-delay: .18s; }
.sn30-typing .sn30-bubble span:nth-child(3) { animation-delay: .36s; }

/* product cards inside the transcript */
.sn30-cards { display: flex; flex-direction: column; gap: 9px; margin: 9px 0 2px; }
.sn30-card { background: #fff; border: 1px solid #e3ebf7; border-radius: 12px; padding: 11px 12px; }
.sn30-card-top strong { display: block; font-size: .84rem; line-height: 1.35; color: #14335c; }
.sn30-card-meta { font-size: .71rem; color: #64748b; margin: 3px 0 5px; }
.sn30-card-price { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.sn30-price { font-weight: 900; color: #0b3f7a; font-size: 1rem; }
.sn30-off { background: #dcfce7; color: #15803d; font-size: .66rem; font-weight: 800; padding: 2px 7px; border-radius: 999px; }
.sn30-buy {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center; width: 100%;
  background: linear-gradient(135deg, #0f8c50, #0b7a43); color: #fff !important; text-decoration: none;
  padding: 9px 12px; border-radius: 10px; font-weight: 800; font-size: .82rem;
}

/* quick-reply chips */
.sn30-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 9px 12px 0; background: #fff; border-top: 1px solid #eef3fb; }
.sn30-chips:empty { display: none; }
.sn30-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #F1F6FE; border: 1px solid #cfe1f8; color: #1A67C4;
  font-family: inherit; font-size: .78rem; font-weight: 700;
  padding: 7px 12px; border-radius: 999px; cursor: pointer;
  transition: background .14s ease, transform .14s ease;
}
.sn30-chip:hover { background: #e2eefc; transform: translateY(-1px); }
.sn30-chip i { font-size: .74rem; }

.sn30-input { display: flex; gap: 8px; padding: 10px 12px; background: #fff; }
.sn30-input input {
  flex: 1 1 auto; min-width: 0; border: 1px solid #dbe6f6; border-radius: 999px;
  padding: 11px 15px; font-family: inherit; font-size: 16px; outline: none;
}
.sn30-input input:focus { border-color: #1A67C4; box-shadow: 0 0 0 3px rgba(26, 103, 196, .12); }
.sn30-input button {
  flex: 0 0 auto; width: 42px; height: 42px; border: 0; border-radius: 50%; cursor: pointer;
  background: linear-gradient(135deg, #1A67C4, #14335c); color: #fff;
}
.sn30-foot { margin: 0; padding: 0 14px 11px; font-size: .68rem; color: #94a3b8; background: #fff; }
.sn30-foot a { color: #1A67C4; font-weight: 700; }

/* ------------------------------------------------------ WhatsApp picker */
.sn30-wa-modal {
  position: fixed; inset: 0; z-index: 13000; display: flex; align-items: center; justify-content: center;
  background: rgba(9, 20, 40, .55); padding: 16px;
}
.sn30-wa-card {
  width: min(430px, 100%); background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 30px 70px -20px rgba(8, 30, 80, .6); font-family: Inter, Arial, sans-serif;
}
.sn30-wa-card header {
  display: flex; align-items: center; gap: 10px; padding: 13px 14px; background: #0b7a43; color: #fff;
}
.sn30-wa-ico { width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .18); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.sn30-wa-card header div { flex: 1 1 auto; display: flex; flex-direction: column; }
.sn30-wa-card header strong { font-size: .95rem; }
.sn30-wa-card header small { font-size: .72rem; opacity: .9; }
.sn30-wa-x { width: 28px; height: 28px; border: 0; border-radius: 8px; cursor: pointer; background: rgba(255, 255, 255, .16); color: #fff; }
.sn30-wa-list { max-height: 56vh; overflow-y: auto; padding: 7px; }
.sn30-wa-item {
  width: 100%; display: flex; align-items: center; gap: 11px; text-align: left;
  background: #fff; border: 0; border-radius: 11px; padding: 10px 11px; cursor: pointer; font-family: inherit;
  transition: background .13s ease;
}
.sn30-wa-item:hover { background: #F1F6FE; }
.sn30-wa-item-ico { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; background: #eaf7ee; color: #0b7a43; display: flex; align-items: center; justify-content: center; }
.sn30-wa-item-txt { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.sn30-wa-item-txt strong { font-size: .86rem; color: #14335c; }
.sn30-wa-item-txt small { font-size: .72rem; color: #64748b; }
.sn30-wa-go { flex: 0 0 auto; color: #94a3b8; font-size: .78rem; }
.sn30-wa-foot { margin: 0; padding: 9px 14px 13px; font-size: .72rem; color: #64748b; background: #F7F9FC; text-align: center; }

/* =====================================================================
   v34  -  MOBILE LAUNCHER: small icon pinned to the MIDDLE-LEFT edge
   ---------------------------------------------------------------------
   Desktop keeps the labelled "Need help?" pill at the bottom-right.
   On mobile (<=900px) the label is dropped and the launcher becomes a
   small 40x46 icon centred vertically on the left screen edge, so it never
   collides with the bottom app-nav, the cart mini-bar or the sticky buy bar.
   ===================================================================== */
@media (max-width: 900px) {
  .sn30-fab {
    right: auto;
    left: 0;
    top: 50%;
    bottom: auto;
    transform: translateY(-50%);
    width: 38px;
    height: 46px;
    padding: 0 0 0 3px;
    border-radius: 0 13px 13px 0;
    font-size: .95rem;
    opacity: .94;
    z-index: 12001;
  }
  .sn30-fab:hover,
  .sn30-fab:active { transform: translateY(-50%) scale(.96); }
  .sn30-fab-label { display: none !important; }
  .sn30-fab i { font-size: 1rem; }
  .sn30-fab-dot { top: 7px; right: 7px; width: 8px; height: 8px; }
  .sn30-root.is-open .sn30-fab { opacity: 0; pointer-events: none; }
  .sn30-panel { left: 0; right: 0; bottom: 0; width: 100vw; height: 92vh; max-height: 92vh; border-radius: 16px 16px 0 0; }
  .sn30-chips { padding-bottom: calc(9px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 900px) and (max-height: 520px) {
  .sn30-fab { width: 34px; height: 40px; }
}
@media (max-width: 360px) {
  .sn30-fab { width: 34px; height: 42px; }
}

/* transcript restore divider (v34) */
.sn30-resumed {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  margin: 0 0 12px; font-size: .66rem; font-weight: 800; letter-spacing: .05em;
  text-transform: uppercase; color: #94a3b8;
}
.sn30-resumed span { white-space: nowrap; }
.sn30-resumed i { font-size: .7rem; color: #b6c2d4; }

/* =====================================================================
   v34  -  FOOTER support column: "Ask Nova" button + WhatsApp picker link
   ===================================================================== */
.footer-nova-btn {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 4px 0 9px; padding: 9px 14px;
  border: 0; border-radius: 10px; cursor: pointer;
  background: linear-gradient(120deg, #1A67C4, #14335c);
  color: #fff; font-family: inherit; font-weight: 700; font-size: .84rem;
  box-shadow: 0 8px 18px -10px rgba(20, 51, 92, .85);
  transition: transform .15s ease, box-shadow .15s ease;
}
.footer-nova-btn:hover { transform: translateY(-1px); box-shadow: 0 12px 22px -12px rgba(20, 51, 92, .95); }
.footer-nova-btn i { font-size: .95rem; }
.footer-wa-link { display: inline-flex; align-items: center; gap: 7px; color: #7ef0ab !important; font-weight: 600; }
.footer-wa-link i { color: #25D366; }
.footer-ai-note { display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; color: #b8c2d6; }
.footer-ai-note i { color: #E8A93A; }
@media (max-width: 900px) {
  .footer-ai-note { display: none; }
  .footer-nova-btn { width: 100%; justify-content: center; }
}
