/* Simon — MeritChart assistant widget.
   Brand: navy #0F2A44, white, paper #FAF7F0, border #E5DDC9;
   gold #B8860B / #E8C766 appear ONLY as micro-accents (the mark's
   bars, focus rings, the header subtitle) per the design system.
   Self-contained: no dependency on page CSS variables.
   z-index 80: above the mobile sticky CTA bar (50) and the sticky
   nav, below any modal, so checkout always covers Simon, never
   the reverse. */
/* Mobile scroll lock (sibling-Simon lesson): while the panel is
   open, JS pins <body> with position:fixed at the pre-open scroll
   offset and restores it exactly on close, so the page behind
   cannot move; overscroll-behavior stops residual chaining. */
html.simon-locked{overscroll-behavior:none}
body.simon-locked{position:fixed;left:0;right:0;width:100%;overflow:hidden;
  overscroll-behavior:none}
.simon-btn{position:fixed;right:20px;bottom:20px;z-index:80;display:inline-flex;
  align-items:center;gap:9px;background:#0F2A44;color:#fff;border:1px solid #0F2A44;
  border-radius:999px;padding:10px 18px 10px 11px;font:650 15px/1.2 system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  cursor:pointer;box-shadow:0 12px 30px rgba(15,42,68,.30);transition:background .18s ease,transform .12s ease}
.simon-btn:hover{background:#1B3A5C}
.simon-btn:active{transform:scale(.98)}
.simon-btn:focus-visible{outline:2px solid #B8860B;outline-offset:2px}
.simon-btn .simon-mark{flex:none;display:block}
.simon-btn[hidden]{display:none!important}

/* padding/margin reset is load-bearing: site stylesheets pad
   <section> elements and Simon's panel IS a <section> — without
   this the chat content floats inside a phantom inset and the
   reading area silently shrinks. */
.simon-panel{position:fixed;right:24px;bottom:24px;z-index:80;width:420px;max-width:calc(100vw - 24px);
  padding:0;margin:0;
  height:min(680px,90dvh);overscroll-behavior:contain;display:flex;flex-direction:column;background:#FAF7F0;
  border:1px solid #E5DDC9;border-radius:18px;box-shadow:0 28px 64px rgba(15,42,68,.35),0 4px 16px rgba(15,42,68,.20);
  overflow:hidden;font-family:system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;color:#1C2B3A}
.simon-panel[hidden]{display:none!important}
.simon-head{display:flex;align-items:center;gap:10px;background:#0F2A44;color:#fff;
  padding:13px 16px;flex:none}
.simon-head .simon-mark{flex:none;display:block}
.simon-head-txt{flex:1;min-width:0}
.simon-head-name{font-weight:800;font-size:16.5px;letter-spacing:-.01em;line-height:1.15}
.simon-head-sub{font-size:12.5px;color:#E8C766;line-height:1.2}
.simon-close{background:transparent;border:0;color:#fff;font-size:22px;line-height:1;
  cursor:pointer;padding:6px 8px;border-radius:8px;flex:none}
.simon-close:hover{background:rgba(255,255,255,.12)}
.simon-close:focus-visible{outline:2px solid #B8860B;outline-offset:1px}
.simon-msgs{flex:1;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:16px 14px 8px;display:flex;flex-direction:column;gap:10px}
.simon-msg{max-width:88%;padding:11px 14px;border-radius:14px;font-size:16px;line-height:1.55;
  overflow-wrap:anywhere;white-space:pre-wrap}
.simon-msg.bot{background:#fff;border:1px solid #E5DDC9;border-bottom-left-radius:5px;align-self:flex-start}
.simon-msg.user{background:#0F2A44;color:#fff;border-bottom-right-radius:5px;align-self:flex-end}
.simon-msg.typing{color:#6B7686;font-style:italic}
.simon-link{display:inline-block;margin-top:9px;background:#F5EEDA;color:#0F2A44;font-weight:650;
  font-size:13.5px;text-decoration:none;border:1px solid rgba(15,42,68,.28);border-radius:9px;
  padding:8px 13px;min-height:36px}
.simon-link:hover{background:#EFE3C2}
.simon-chips{display:flex;flex-wrap:wrap;gap:7px;padding:2px 14px 10px;flex:none}
.simon-chips[hidden]{display:none!important}
.simon-chip{background:#F5EEDA;border:1px solid #E5DDC9;color:#0F2A44;border-radius:999px;
  font:600 12.5px/1.25 system-ui,sans-serif;padding:8px 12px;cursor:pointer;text-align:left}
.simon-chip:hover{background:#EFE3C2;border-color:#B8860B}
.simon-chip:focus-visible{outline:2px solid #B8860B;outline-offset:1px}
.simon-form{display:flex;gap:8px;padding:11px 12px calc(11px + env(safe-area-inset-bottom));
  background:#fff;border-top:1px solid #E5DDC9;flex:none}
.simon-input{flex:1;min-width:0;border:1px solid #E5DDC9;border-radius:11px;padding:11px 12px;
  font:400 16px/1.35 system-ui,sans-serif;color:#1C2B3A;background:#fff}
.simon-input:focus{outline:2px solid #B8860B;outline-offset:0;border-color:#B8860B}
.simon-send{flex:none;background:#0F2A44;color:#fff;border:1px solid #0F2A44;border-radius:11px;
  padding:11px 17px;font:650 15px/1.35 system-ui,sans-serif;cursor:pointer;min-height:44px}
.simon-send:hover{background:#1B3A5C}
.simon-send:disabled{opacity:.45;cursor:default}
.simon-note{flex:none;padding:0 14px 9px;background:#fff;font-size:11.5px;color:#6B7686;line-height:1.35}

@media (max-width:680px){
  .simon-btn{right:14px;bottom:calc(20px + env(safe-area-inset-bottom));padding:9px 15px 9px 10px;font-size:14.5px}
  /* Full-screen sheet: the chat IS the screen while open — no
     floating card, no dead space, message list takes everything
     between the header and the input row. */
  .simon-panel{left:0;right:0;top:0;bottom:0;width:auto;max-width:none;
    height:100dvh;max-height:none;border:0;border-radius:0}
  .simon-note{font-size:11px;white-space:nowrap;overflow:hidden;
    text-overflow:ellipsis;padding:0 12px 7px}
}
