/* W-02 chat button + panel + /soule-ops prompt + the W-02 form (brief W-02_PLACEMENT_AND_SITTINGS_2026-10-11 P1–P8; W-02 decisions
   2026-10-11). First-party only. Loaded on every page except /pay. The intake switch lives in /assets/chat-panel.js (INTAKE). */

/* ── intake switch: one attribute on <html>, set by chat-panel.js before the body renders ── */
html:not([data-intake="w02"]) .ds-chat-btn{display:none!important}
html:not([data-intake="w02"]) [data-intake-only="w02"]{display:none!important}
html[data-intake="w02"] [data-intake-only="typebot"]{display:none!important}

/* ── P1 floating button: bottom right, fixed while the page scrolls, ≥ 48 × 48 px ── */
.ds-chat-btn{position:fixed;right:calc(16px + env(safe-area-inset-right,0px));bottom:calc(16px + env(safe-area-inset-bottom,0px));z-index:60;
  display:inline-flex;align-items:center;gap:9px;min-height:48px;min-width:48px;padding:0 18px;border-radius:24px;
  background:var(--gold);color:var(--ink);border:1px solid var(--gold);font-family:inherit;font-size:.94rem;font-weight:500;line-height:1;
  text-decoration:none;cursor:pointer;box-shadow:0 6px 22px rgba(0,0,0,.45)}
.ds-chat-btn:hover{background:var(--gold2);border-color:var(--gold2)}
.ds-chat-btn:focus-visible{outline:2px solid var(--paper);outline-offset:3px}
.ds-chat-btn svg{width:20px;height:20px;flex-shrink:0}
.ds-chat-btn[hidden]{display:none}

/* ── P4 prompt (/soule-ops only): beside the button, never focused automatically ── */
.ds-chat-prompt{position:fixed;right:calc(16px + env(safe-area-inset-right,0px));bottom:calc(76px + env(safe-area-inset-bottom,0px));z-index:60;
  display:flex;align-items:center;gap:2px;background:var(--ink2);border:1px solid var(--gold-border);border-radius:3px;
  box-shadow:0 6px 22px rgba(0,0,0,.45);max-width:calc(100vw - 32px)}
.ds-chat-prompt:empty{display:none}
.ds-chat-prompt-go{background:none;border:0;color:var(--paper);font-family:inherit;font-size:.92rem;padding:0 6px 0 16px;min-height:44px;cursor:pointer}
.ds-chat-prompt-x{background:none;border:0;color:var(--dim);font-family:inherit;font-size:1.2rem;width:44px;height:44px;cursor:pointer}
.ds-chat-prompt button:focus-visible{outline:2px solid var(--gold);outline-offset:-2px}

/* ── P2 panel: desktop 400 px × min(640 px, 80vh) bottom right; ≤ 640 px full screen ── */
.ds-chat-panel{position:fixed;right:calc(16px + env(safe-area-inset-right,0px));bottom:calc(16px + env(safe-area-inset-bottom,0px));z-index:70;
  width:400px;max-width:calc(100vw - 32px);height:min(640px,80vh);display:flex;flex-direction:column;
  background:var(--ink);border:1px solid var(--line2);border-radius:3px;box-shadow:0 10px 40px rgba(0,0,0,.6)}
.ds-chat-panel[hidden]{display:none}
.ds-chat-panel:focus{outline:none}
.ds-chat-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:6px 6px 6px 18px;border-bottom:1px solid var(--line);background:var(--ink2)}
.ds-chat-title{font-family:"DM Serif Display",Georgia,serif;font-size:1.12rem;color:var(--paper)}
.ds-chat-close{background:none;border:1px solid transparent;color:var(--dim);font-family:inherit;font-size:1.4rem;line-height:1;width:44px;height:44px;border-radius:2px;cursor:pointer}
.ds-chat-close:hover{color:var(--paper);border-color:var(--line2)}
.ds-chat-close:focus-visible{outline:2px solid var(--gold);outline-offset:-2px}
.ds-chat-body{flex:1;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;padding:18px}
.ds-chat-body p{max-width:none}
@media(max-width:640px){
  .ds-chat-panel{inset:0;right:0;bottom:0;width:100%;max-width:none;height:100vh;height:100dvh;border:0;border-radius:0;
    padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) env(safe-area-inset-bottom,0px) env(safe-area-inset-left,0px)}
  /* P8: the last footer links scroll clear of the button (button 48 px + 16 px offset + 24 px) */
  html[data-intake="w02"] body{padding-bottom:calc(88px + env(safe-area-inset-bottom,0px))}
}
html.ds-chat-lock,html.ds-chat-lock body{overflow:hidden}

/* ── the W-02 form (inline on /soule-ops #try and /enquire; inside the panel elsewhere) ── */
.dsf fieldset{border:0;margin:0 0 22px;padding:0}
.dsf legend,.dsf label.q{display:block;font-weight:500;margin-bottom:10px;color:var(--paper)}
.dsf .opt{display:flex;align-items:flex-start;gap:10px;margin:4px 0;padding:10px 0;min-height:44px;color:var(--dim);cursor:pointer}
.dsf .opt input{margin-top:4px;width:18px;height:18px;flex-shrink:0;accent-color:var(--gold)}
.dsf input[type=text],.dsf input[type=email],.dsf input[type=tel],.dsf input[type=url],.dsf textarea{width:100%;max-width:520px;padding:11px 12px;font:inherit;
  background:var(--ink2);color:var(--paper);border:1px solid var(--line2);border-radius:2px;min-height:44px}
.dsf input:focus-visible,.dsf textarea:focus-visible{outline:2px solid var(--gold);outline-offset:1px}
.dsf .cta-row .btn{min-height:44px}
.dsf .err{color:#F28B82;margin-top:10px}
.dsf .note{margin-top:8px}
.dsf .prompt-extra{white-space:pre-line;margin-bottom:10px;color:var(--dim)}
.dsf [hidden],#done[hidden],#closed[hidden],#idlewarn[hidden]{display:none}
#idlewarn{border-left:2px solid var(--gold);padding:8px 0 8px 14px;margin-top:16px}
#idlewarn .btn,#closed .btn{margin-top:10px}
.ds-form-wrap{margin-top:20px;max-width:640px}
.ds-chat-body .ds-form-wrap{margin-top:0}

/* ── C7: reduced motion — no slide, no fade, no smooth scroll ── */
@media (prefers-reduced-motion: no-preference){
  .ds-chat-panel:not([hidden]){animation:ds-chat-in .18s ease-out}
  .ds-chat-prompt:not(:empty){animation:ds-chat-in .25s ease-out}
  @keyframes ds-chat-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
}
@media (prefers-reduced-motion: reduce){
  .ds-chat-btn,.ds-chat-panel,.ds-chat-prompt{animation:none!important;transition:none!important}
  html{scroll-behavior:auto}
}
