/* ==========================================================================
   overlays · "Ask about Lexi" help widget, cookie banner, Get started modal.
   Every rule is scoped under #overlays. No green / teal anywhere.
   ========================================================================== */
#overlays{
  --ov-card:#1c1c1c;
  --ov-line:rgba(234,227,221,.10);
  --ov-line-2:rgba(234,227,221,.16);
  --ov-field:#141414;
  --ov-body:#b7b0aa;
  --ov-shadow:0 24px 60px -12px rgba(0,0,0,.6),0 4px 14px rgba(0,0,0,.35);
  --ov-spring:cubic-bezier(.34,1.4,.64,1);
  --ov-out:cubic-bezier(.16,1,.3,1);
  --ov-z-help:800; --ov-z-cookie:850; --ov-z-modal:900;
  font-family:var(--font-display);
}
#overlays .ov-sprite{position:absolute;width:0;height:0;overflow:hidden}
#overlays svg{width:100%;height:100%}
#overlays :focus-visible{outline:2px solid var(--accent);outline-offset:2px}

/* =====================================================================
   HELP WIDGET
   ===================================================================== */
#overlays .ov-help{position:fixed;z-index:var(--ov-z-help);right:24px;bottom:24px;transition:opacity .3s var(--ease),visibility 0s linear .3s}
#overlays .ov-help.is-suppressed{opacity:0;visibility:hidden;pointer-events:none}
#overlays .ov-help.is-tucked .ov-fab{opacity:0;translate:0 calc(100% + 24px);pointer-events:none;transition:translate .35s var(--ease),opacity .25s var(--ease)}
#overlays .ov-help.is-tucked .ov-fab:focus-visible{opacity:1;translate:0 0;pointer-events:auto}
#overlays .ov-help:not(.is-suppressed){transition:opacity .3s var(--ease)}

/* compact launcher: a 56px Lexi-mark button; the label slides out on hover / focus */
#overlays .ov-fab{
  position:relative;display:flex;flex-direction:row-reverse;align-items:center;
  height:56px;min-width:56px;padding:0 11px;border-radius:28px;
  background:rgba(28,28,28,.92);border:1px solid var(--ov-line-2);color:var(--fg);
  box-shadow:0 12px 30px -8px rgba(0,0,0,.6),0 0 0 0 rgba(255,143,90,0);
  -webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px);
  transition:translate .5s var(--ov-spring),opacity .4s var(--ease),box-shadow .3s var(--ease),background-color .2s,border-color .2s;
}
#overlays .ov-help[data-pre] .ov-fab{opacity:0;translate:0 16px}
#overlays .ov-fab:hover{border-color:rgba(255,143,90,.45);box-shadow:0 14px 34px -8px rgba(0,0,0,.65),0 0 0 4px rgba(255,143,90,.10)}
#overlays .ov-fab:focus-visible{outline-offset:3px;border-radius:28px}
#overlays .ov-fab__mark,#overlays .ov-fab__x{flex:none;display:block;width:32px;height:32px;transition:transform .45s var(--ov-out),opacity .25s}
#overlays .ov-fab__mark svg{border-radius:8px}
#overlays .ov-fab__x{position:absolute;right:11px;top:11px;padding:6px;opacity:0;transform:rotate(-90deg) scale(.6);color:var(--fg)}
#overlays .ov-fab__label{
  display:block;overflow:hidden;max-width:0;opacity:0;white-space:nowrap;
  font-family:var(--font-mono);font-weight:500;font-size:12px;line-height:1;text-transform:uppercase;color:var(--fg);
  transition:max-width .45s var(--ov-out),opacity .25s var(--ease),padding .45s var(--ov-out);
}
#overlays .ov-help[data-state="closed"] .ov-fab:is(:hover,:focus-visible) .ov-fab__label{max-width:170px;opacity:1;padding:0 12px 0 8px}
#overlays .ov-help[data-state="open"] .ov-fab__mark{opacity:0;transform:rotate(90deg) scale(.6)}
#overlays .ov-help[data-state="open"] .ov-fab__x{opacity:1;transform:none}

/* panel */
#overlays .ov-panel{
  position:absolute;right:0;bottom:72px;width:384px;height:min(580px,calc(100vh - var(--header-h) - 120px));min-height:360px;
  display:flex;flex-direction:column;overflow:hidden;
  background:var(--ov-card);border:1px solid var(--ov-line-2);border-radius:16px;box-shadow:var(--ov-shadow);
  transform-origin:calc(100% - 28px) 100%;
  opacity:0;visibility:hidden;transform:translateY(10px) scale(.94);
  transition:opacity .2s var(--ease),transform .3s var(--ov-out),visibility 0s linear .3s;
}
#overlays .ov-help[data-state="open"] .ov-panel{opacity:1;visibility:visible;transform:none;transition:opacity .25s var(--ease),transform .5s var(--ov-spring),visibility 0s}
#overlays .ov-panel__head{display:flex;align-items:center;gap:12px;padding:14px 12px 14px 16px;border-bottom:1px solid var(--ov-line)}
#overlays .ov-panel__mark{flex:none;width:32px;height:32px}
#overlays .ov-panel__mark svg{border-radius:8px}
#overlays .ov-panel__who{flex:1;min-width:0}
#overlays .ov-panel__title{font-size:15px;font-weight:600;line-height:1.2;color:var(--fg)}
#overlays .ov-panel__sub{margin-top:4px;font-size:10px;line-height:1;color:var(--taupe)}
#overlays .ov-icon-btn{flex:none;display:grid;place-items:center;width:36px;height:36px;border-radius:8px;color:var(--taupe);transition:background-color .2s,color .2s}
#overlays .ov-icon-btn svg{width:18px;height:18px}
#overlays .ov-icon-btn:hover{background:var(--surface-2);color:var(--fg)}

#overlays .ov-panel__log{flex:1;overflow-y:auto;overscroll-behavior:contain;padding:18px 16px 8px;display:flex;flex-direction:column;gap:12px;scrollbar-width:thin;scrollbar-color:#3a3836 transparent}
#overlays .ov-panel__log:focus-visible{outline-offset:-2px}
#overlays .ov-msg{display:flex;align-items:flex-end;gap:8px;max-width:100%;animation:ov-msg-in .45s var(--ov-out) both}
@keyframes ov-msg-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
#overlays .ov-msg__mark{flex:none;width:22px;height:22px;margin-bottom:2px}
#overlays .ov-msg__mark svg{border-radius:6px}
#overlays .ov-msg__bubble{max-width:86%;padding:10px 13px;border-radius:12px 12px 12px 4px;background:var(--surface-2);font-size:14px;line-height:1.5;color:var(--fg)}
#overlays .ov-msg__bubble p + p{margin-top:6px}
#overlays .ov-msg--user{justify-content:flex-end}
#overlays .ov-msg--user .ov-msg__bubble{border-radius:12px 12px 4px 12px;background:rgba(255,143,90,.16);border:1px solid rgba(255,143,90,.28)}
#overlays .ov-msg__act{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
#overlays .ov-msg__act .btn{height:34px;padding:0 12px;font-size:11px}
#overlays .ov-msg__act .btn-dark{background:#333;}
#overlays .ov-msg__act .btn-dark:hover{background:#3d3d3d}
#overlays .ov-msg__act svg{width:12px;height:10px}
#overlays .ov-typing .ov-msg__bubble{display:flex;gap:4px;align-items:center;height:38px}
#overlays .ov-typing i{width:6px;height:6px;border-radius:50%;background:var(--taupe);animation:ov-dot 1s var(--ease) infinite}
#overlays .ov-typing i:nth-child(2){animation-delay:.15s}
#overlays .ov-typing i:nth-child(3){animation-delay:.3s}
@keyframes ov-dot{0%,60%,100%{opacity:.35;transform:none}30%{opacity:1;transform:translateY(-3px)}}

#overlays .ov-chips{display:flex;flex-wrap:wrap;gap:6px;padding-left:30px;animation:ov-msg-in .45s var(--ov-out) .1s both}
#overlays .ov-chip{height:32px;padding:0 12px;border-radius:16px;border:1px solid var(--ov-line-2);background:transparent;
  font-family:var(--font-mono);font-weight:500;font-size:11px;text-transform:uppercase;color:var(--fg);transition:border-color .2s,background-color .2s,color .2s}
#overlays .ov-chip:hover{border-color:var(--accent);background:var(--accent-soft)}

#overlays .ov-panel__compose{display:flex;align-items:center;gap:8px;margin:8px 12px 12px;padding:6px 6px 6px 14px;border-radius:12px;background:var(--ov-field);border:1px solid var(--ov-line-2);transition:border-color .2s,box-shadow .2s}
#overlays .ov-panel__compose:focus-within{border-color:rgba(255,143,90,.6);box-shadow:0 0 0 3px var(--accent-soft)}
#overlays .ov-panel__input{flex:1;min-width:0;height:34px;background:transparent;border:0;outline:0;font-size:14px;color:var(--fg)}
#overlays .ov-panel__input::placeholder{color:var(--muted)}
#overlays .ov-send{flex:none;display:grid;place-items:center;width:34px;height:34px;border-radius:9px;background:var(--surface-2);color:var(--taupe);transition:background-color .2s,color .2s,scale .3s var(--ov-spring)}
#overlays .ov-send svg{width:16px;height:16px}
#overlays .ov-send.is-ready{background:var(--accent);color:var(--accent-ink)}
#overlays .ov-send.is-ready:hover{background:var(--accent-hover);scale:1.06}

/* =====================================================================
   COOKIE BANNER
   ===================================================================== */
#overlays .ov-cookie{
  position:fixed;z-index:var(--ov-z-cookie);left:24px;bottom:24px;width:420px;max-width:calc(100vw - 48px);max-height:calc(100vh - 48px);overflow:auto;
  padding:22px 22px 20px;border-radius:14px;background:var(--surface);border:1px solid var(--ov-line-2);box-shadow:var(--ov-shadow);color:var(--fg);
  opacity:0;transform:translateY(16px);transition:opacity .3s var(--ease),transform .5s var(--ov-out);
}
#overlays .ov-cookie[hidden]{display:none}
#overlays .ov-cookie.is-in{opacity:1;transform:none}
#overlays .ov-cookie.is-out{opacity:0;transform:translateY(16px);transition-duration:.25s,.3s}
#overlays .ov-cookie__head{display:flex;align-items:center;gap:8px;margin-bottom:10px}
#overlays .ov-cookie__title{flex:1;font-size:17px;font-weight:600;line-height:1.25;outline:0}
#overlays .ov-cookie__x,#overlays .ov-cookie__back{flex:none;display:grid;place-items:center;width:32px;height:32px;margin:-6px -6px -6px 0;border-radius:8px;color:var(--taupe);transition:background-color .2s,color .2s}
#overlays .ov-cookie__back{margin:-6px 0 -6px -8px}
#overlays .ov-cookie__x svg,#overlays .ov-cookie__back svg{width:18px;height:18px}
#overlays .ov-cookie__x:hover,#overlays .ov-cookie__back:hover{background:var(--surface-2);color:var(--fg)}
#overlays .ov-cookie__text{font-size:14px;line-height:1.55;color:var(--ov-body)}
#overlays .ov-cookie__actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:18px}
#overlays .ov-cookie__btn{flex:1 1 auto}
#overlays .ov-cookie__view.is-swap{animation:ov-swap .35s var(--ov-out)}
@keyframes ov-swap{from{opacity:0;transform:translateX(10px)}to{opacity:1;transform:none}}
#overlays .ov-cookie__link{margin-left:auto;padding:4px 2px;border-radius:4px;font-size:13px;color:var(--ov-body);text-decoration:underline;text-underline-offset:3px;text-decoration-color:rgba(234,227,221,.3)}
#overlays .ov-cookie__link:hover{color:var(--fg)}
#overlays .ov-prefs{display:flex;flex-direction:column;border-top:1px solid var(--ov-line)}
#overlays .ov-pref{display:flex;align-items:center;gap:16px;padding:14px 0;border-bottom:1px solid var(--ov-line)}
#overlays .ov-pref__copy{flex:1;display:flex;flex-direction:column;gap:3px}
#overlays .ov-pref__name{font-size:14px;font-weight:600}
#overlays .ov-pref__desc{font-size:13px;line-height:1.45;color:var(--ov-body)}
#overlays .ov-switch{position:relative;flex:none;width:42px;height:24px;border-radius:12px;background:#3a3836;transition:background-color .25s var(--ease)}
#overlays .ov-switch__thumb{position:absolute;left:3px;top:3px;width:18px;height:18px;border-radius:50%;background:var(--cream);display:grid;place-items:center;transition:translate .35s var(--ov-spring)}
#overlays .ov-switch__on{width:12px;height:12px;color:var(--accent-ink);opacity:0;transition:opacity .2s}
#overlays .ov-switch[aria-checked="true"]{background:var(--accent)}
#overlays .ov-switch[aria-checked="true"] .ov-switch__thumb{translate:18px 0}
#overlays .ov-switch[aria-checked="true"] .ov-switch__on{opacity:1}
#overlays .ov-switch[data-locked]{opacity:.55;cursor:not-allowed}
#overlays .ov-switch:focus-visible{outline-offset:3px;border-radius:12px}

/* =====================================================================
   GET STARTED MODAL
   ===================================================================== */
#overlays .ov-modal{position:fixed;inset:0;z-index:var(--ov-z-modal);display:grid;place-items:center;padding:24px}
#overlays .ov-modal[hidden]{display:none}
#overlays .ov-modal__scrim{position:absolute;inset:0;background:rgba(8,8,8,.72);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);opacity:0;transition:opacity .3s var(--ease)}
#overlays .ov-modal__dialog{
  position:relative;width:min(960px,100%);max-height:calc(100dvh - 48px);overflow:auto;overscroll-behavior:contain;
  display:grid;grid-template-columns:minmax(0,.86fr) minmax(0,1.14fr);
  background:var(--surface);border:1px solid var(--ov-line-2);border-radius:var(--r-lg);box-shadow:var(--ov-shadow);
  opacity:0;transform:translateY(18px) scale(.98);transition:opacity .25s var(--ease),transform .5s var(--ov-out);
}
#overlays .ov-modal.is-open .ov-modal__scrim{opacity:1}
#overlays .ov-modal.is-open .ov-modal__dialog{opacity:1;transform:none}
#overlays .ov-modal__x{position:absolute;z-index:2;top:14px;right:14px;display:grid;place-items:center;width:40px;height:40px;border-radius:10px;color:var(--taupe);transition:background-color .2s,color .2s}
#overlays .ov-modal__x svg{width:20px;height:20px}
#overlays .ov-modal__x:hover{background:var(--surface-2);color:var(--fg)}

#overlays .ov-modal__side{position:relative;overflow:hidden;display:flex;flex-direction:column;justify-content:space-between;gap:40px;padding:44px 40px 40px;
  background:#000;border-right:1px solid var(--ov-line);border-radius:var(--r-lg) 0 0 var(--r-lg)}
#overlays .ov-modal__side::before{content:"";position:absolute;left:-30%;bottom:-40%;width:130%;aspect-ratio:1;border-radius:50%;
  background:radial-gradient(closest-side,rgba(255,143,90,.24),rgba(155,156,255,.08) 55%,transparent 75%);pointer-events:none}
#overlays .ov-side__tag{position:relative;font-size:32px;line-height:1.02;letter-spacing:-.03em;text-wrap:balance}
#overlays .ov-side__art{position:relative;height:250px}
#overlays .ov-side__win{position:absolute;left:0;right:28px;bottom:58px;border-radius:12px;background:#151515;border:1px solid #2b2a28;box-shadow:0 20px 40px -16px rgba(0,0,0,.8);
  transform-origin:100% 100%;animation:ov-win 5.4s var(--ov-out) infinite}
#overlays .ov-side__bar{display:flex;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid var(--ov-line);font-size:12px;font-weight:600}
#overlays .ov-side__mark{width:16px;height:16px;flex:none}
#overlays .ov-side__mark,#overlays .ov-side__fab svg{border-radius:5px}
#overlays .ov-side__ill{margin-left:auto;font-size:9px;font-weight:500;color:var(--taupe)}
#overlays .ov-side__ask{margin:12px 12px 0;padding:9px 11px;border-radius:8px;background:var(--surface-2);font-size:12.5px;line-height:1.4;color:var(--fg)}
#overlays .ov-side__steps{display:grid;gap:10px;padding:14px 12px 16px;font-size:11px;color:var(--taupe)}
#overlays .ov-side__steps li{display:flex;align-items:center;gap:10px;animation:ov-step 5.4s var(--ease) infinite;animation-delay:calc(var(--n) * .7s)}
#overlays .ov-side__steps i{width:8px;height:8px;border-radius:50%;background:var(--accent)}
#overlays .ov-side__steps li:nth-child(2) i{background:var(--violet)}
#overlays .ov-side__steps li:nth-child(3) i{background:var(--ok)}
#overlays .ov-side__fab{position:absolute;right:0;bottom:0;width:44px;height:44px;padding:8px;border-radius:50%;background:#1c1c1c;border:1px solid var(--ov-line-2)}
@keyframes ov-win{0%{opacity:0;transform:scale(.6) translate(10px,10px)}10%,86%{opacity:1;transform:none}100%{opacity:0;transform:scale(.96)}}
@keyframes ov-step{0%,14%{opacity:.25;color:var(--taupe)}24%,86%{opacity:1;color:var(--fg)}100%{opacity:.25}}

#overlays .ov-modal__main{position:relative;padding:48px 48px 40px}
#overlays .ov-modal__title{font-size:clamp(32px,3.4vw,44px);line-height:1;letter-spacing:-.03em;padding-right:36px;outline:0}
#overlays .ov-modal__title .hi{white-space:nowrap}
#overlays .ov-modal__intro{margin-top:14px;font-size:16px;line-height:1.5;color:var(--ov-body);max-width:32em}
#overlays .ov-form{display:grid;gap:18px;margin-top:28px}
#overlays .ov-form.is-shake{animation:ov-shake .4s var(--ease)}
@keyframes ov-shake{20%,60%{transform:translateX(-5px)}40%,80%{transform:translateX(5px)}}
#overlays .ov-field{display:flex;flex-direction:column;gap:8px}
#overlays .ov-field label{font-size:14px;font-weight:500;line-height:1.3;color:var(--fg)}
#overlays .ov-opt{color:var(--muted);font-weight:400}
#overlays .ov-field input,#overlays .ov-field textarea{
  width:100%;min-height:48px;padding:12px 14px;border-radius:var(--r);background:var(--ov-field);border:1px solid #3a3633;color:var(--fg);font-size:15px;line-height:1.4;outline:0;
  transition:border-color .2s,box-shadow .2s,background-color .2s}
#overlays .ov-field textarea{resize:vertical;min-height:88px}
#overlays .ov-field input:hover,#overlays .ov-field textarea:hover{border-color:#4d4843}
#overlays .ov-field input:focus,#overlays .ov-field textarea:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
#overlays .ov-field [aria-invalid="true"]{border-color:var(--danger)}
#overlays .ov-field [aria-invalid="true"]:focus{box-shadow:0 0 0 3px rgba(255,122,122,.18)}
#overlays .ov-field__err{display:none;font-size:13px;line-height:1.4;color:var(--danger)}
#overlays .ov-field__err:not(:empty){display:flex;align-items:center;gap:6px;animation:ov-msg-in .3s var(--ov-out)}
#overlays .ov-field__err:not(:empty)::before{content:"!";flex:none;display:grid;place-items:center;width:15px;height:15px;border-radius:50%;background:var(--danger);color:#2a0d0d;font:700 10px/1 var(--font-display)}
#overlays .ov-form__foot{display:flex;flex-direction:column;align-items:flex-start;gap:14px;margin-top:6px}
#overlays .ov-form__submit{position:relative;min-width:180px}
#overlays .ov-form__submit svg{width:12px;height:10px}
#overlays .ov-form__submit.is-loading .ov-form__label,#overlays .ov-form__submit.is-loading .arrow{opacity:0}
#overlays .ov-spin{position:absolute;left:50%;top:50%;width:18px;height:18px;margin:-9px 0 0 -9px;border-radius:50%;border:2px solid rgba(43,17,5,.25);border-top-color:var(--accent-ink);opacity:0;animation:ov-rot .7s linear infinite}
#overlays .ov-form__submit.is-loading .ov-spin{opacity:1}
@keyframes ov-rot{to{transform:rotate(360deg)}}
#overlays .ov-form__note{font-size:13px;line-height:1.5;color:var(--muted)}
#overlays .ov-form__note a{color:var(--ov-body);text-decoration:underline;text-underline-offset:3px;border-radius:2px}
#overlays .ov-form__note a:hover{color:var(--fg)}

#overlays .ov-modal__done{display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:4px;min-height:100%}
#overlays .ov-modal__done[hidden]{display:none}
#overlays .ov-done__mark{width:64px;height:64px;margin-bottom:22px}
#overlays .ov-done__mark circle,#overlays .ov-done__mark path{stroke-dasharray:1;stroke-dashoffset:0}
#overlays .ov-modal__done.is-in .ov-done__mark circle{animation:ov-draw .7s var(--ov-out) both}
#overlays .ov-modal__done.is-in .ov-done__mark path{animation:ov-draw .5s var(--ov-out) .35s both}
@keyframes ov-draw{from{stroke-dashoffset:1}to{stroke-dashoffset:0}}
#overlays .ov-modal__done .ov-modal__title{color:var(--fg)}
#overlays .ov-modal__done .btn{margin-top:28px}
#overlays .ov-modal__done.is-in > :not(svg){animation:ov-msg-in .5s var(--ov-out) .2s both}

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width:1024px){
  #overlays .ov-modal__dialog{grid-template-columns:1fr;width:min(600px,100%)}
  #overlays .ov-modal__side{display:none}
}
@media (max-width:640px){
  #overlays .ov-help{right:16px;bottom:16px}
  #overlays .ov-fab{height:52px;min-width:52px;padding:0 9px;border-radius:26px}
  #overlays .ov-fab__x{right:9px;top:9px}
  #overlays .ov-help[data-state="closed"] .ov-fab:is(:hover,:focus-visible) .ov-fab__label{max-width:0;opacity:0;padding:0}
  /* full-screen sheet on phones */
  #overlays .ov-panel{position:fixed;inset:0;width:auto;height:100%;min-height:0;border-radius:0;border:0;transform:translateY(24px);transform-origin:50% 100%}
  #overlays .ov-panel__head{padding-top:max(14px,env(safe-area-inset-top))}
  #overlays .ov-panel__compose{margin-bottom:max(12px,env(safe-area-inset-bottom))}
  #overlays .ov-help[data-state="open"] .ov-fab{opacity:0;pointer-events:none}
  #overlays .ov-cookie{left:8px;right:8px;bottom:8px;width:auto;max-width:none;padding:20px 18px 18px}
  #overlays .ov-cookie__btn{flex:1 1 100%}
  #overlays .ov-cookie__actions .ov-cookie__btn[data-cookie="decline"],#overlays .ov-cookie__actions .ov-cookie__btn[data-cookie="prefs"]{flex:1 1 40%}
  #overlays .ov-modal{padding:8px;align-items:end}
  #overlays .ov-modal__dialog{max-height:calc(100dvh - 16px);border-radius:14px}
  #overlays .ov-modal__main{padding:36px 20px 24px}
  #overlays .ov-modal__x{top:10px;right:10px}
  #overlays .ov-form__submit{width:100%}
}
/* the help launcher steps aside while the mobile nav menu is open */
body:has(#site-header.is-mobile-open) #overlays .ov-help{opacity:0;visibility:hidden;pointer-events:none}

@media (prefers-reduced-motion:reduce){
  #overlays .ov-side__win,#overlays .ov-side__steps li{animation:none!important}
  #overlays .ov-side__steps li{opacity:1;color:var(--fg)}
  #overlays .ov-modal__dialog,#overlays .ov-cookie,#overlays .ov-panel{transform:none!important}
}

/* phones: 16px text in fields so mobile browsers do not zoom the page on focus */
@media (max-width:767px),(pointer:coarse){
  #overlays .ov-panel__input,#overlays .ov-field input,#overlays .ov-field textarea,#overlays .ov-field select{font-size:16px}
}
