/* App Purchase Vault — contact widget (assets/contact.js builds the markup).
   Loaded by every page; tokens come from the page's own :root (homepage <style>
   and assets/site.css share them), with fallbacks for any page without them. */

/* ---------- floating button ---------- */
.cw-fab{position:fixed;z-index:60;right:max(20px,env(safe-area-inset-right));bottom:calc(20px + env(safe-area-inset-bottom));
  display:inline-flex;align-items:center;gap:8px;min-height:48px;padding:0 20px 0 16px;border:0;border-radius:999px;
  background:var(--cta,#1a56c4);color:#fff;font:inherit;font-weight:700;font-size:14.5px;line-height:1.2;letter-spacing:-.01em;
  cursor:pointer;box-shadow:0 12px 26px -12px rgba(26,86,196,.6),0 2px 6px rgba(19,23,34,.12)}
.cw-fab:hover{background:var(--cta-press,#12408f)}
.cw-fab:focus-visible,.cw-dialog :focus-visible,.cw-foot-btn:focus-visible{outline:2px solid var(--brand-blue,#1a56c4);outline-offset:3px}
.cw-fab .cw-ic{width:22px;height:22px;flex:none}
html.cw-open .cw-fab{visibility:hidden}
/* nothing at the very end of a page sits permanently under the button */
html.cw-ready .site-foot{padding-bottom:104px}

/* ---------- footer entry (next to the email address, styled like its links) ---------- */
.cw-foot-btn{display:block;padding:6px 0;min-height:24px;border:0;background:none;font:inherit;color:var(--text-tertiary,rgba(19,23,34,.62));
  text-align:start;cursor:pointer;transition:color .18s}
.cw-foot-btn:hover{color:var(--brand-blue-dark,#12408f)}

/* ---------- dialog ---------- */
.cw-dialog{position:fixed;inset:auto;right:max(24px,env(safe-area-inset-right));bottom:calc(24px + env(safe-area-inset-bottom));
  z-index:200;margin:0;padding:0;border:0;background:transparent;color:var(--text-primary,#131722);
  width:min(420px,calc(100vw - 32px));max-width:none;max-height:calc(100dvh - 48px);overflow:visible}
.cw-dialog::backdrop{background:rgba(19,23,34,.28)}
.cw-fallback-dialog[hidden]{display:none}
.cw-panel{display:flex;flex-direction:column;max-height:inherit;height:100%;background:var(--surface,#fff);border:1px solid var(--border,rgba(19,23,34,.09));
  border-radius:var(--radius,16px);box-shadow:0 30px 64px -30px rgba(11,44,107,.30),0 14px 34px -16px rgba(11,44,107,.22);overflow:hidden}
.cw-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 18px 12px 22px;border-bottom:1px solid var(--border,rgba(19,23,34,.09))}
.cw-title{font-size:18px;font-weight:800;letter-spacing:-.02em;line-height:1.3;margin:0;overflow-wrap:anywhere}
.cw-x{flex:none;display:inline-flex;align-items:center;justify-content:center;width:40px;height:40px;border:0;border-radius:999px;background:transparent;
  color:var(--text-secondary,rgba(19,23,34,.66));cursor:pointer}
.cw-x:hover{background:var(--brand-blue-050,#edf3fc);color:var(--text-primary,#131722)}
.cw-x .cw-ic{width:20px;height:20px}
.cw-body{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:16px 22px 20px}
.cw-intro{margin:0 0 14px;font-size:14.5px;line-height:1.55;color:var(--text-secondary,rgba(19,23,34,.66))}
.cw-field{margin-bottom:14px}
.cw-label{display:block;margin-bottom:6px;font-size:14px;font-weight:700;line-height:1.4}
.cw-req{color:var(--brand-blue,#1a56c4)}
.cw-input{display:block;width:100%;min-width:0;padding:12px 14px;border:1.5px solid rgba(19,23,34,.18);border-radius:var(--radius-sm,12px);
  background:var(--surface,#fff);color:inherit;font:inherit;font-size:16px;line-height:1.45;transition:border-color .18s}
.cw-input:focus{border-color:var(--brand-blue,#1a56c4);outline:none}
.cw-input:focus-visible{outline:2px solid var(--brand-blue,#1a56c4);outline-offset:1px}
.cw-input[aria-invalid="true"]{border-color:#b42318}
select.cw-input{appearance:none;-webkit-appearance:none;padding-right:40px;cursor:pointer;
  /* chevron drawn with gradients: no data: image, so the CSP (img-src 'self') stays as it is */
  background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);
  background-repeat:no-repeat;background-position:calc(100% - 21px) 52%,calc(100% - 15px) 52%;background-size:6px 6px,6px 6px}
textarea.cw-input{resize:vertical;min-height:120px;max-height:40vh}
.cw-row{display:flex;justify-content:space-between;align-items:flex-start;gap:12px}
.cw-count{margin-left:auto;padding-top:4px;font-size:12px;color:var(--text-tertiary,rgba(19,23,34,.62));font-variant-numeric:tabular-nums;white-space:nowrap}
.cw-count.cw-over{color:#b42318}
.cw-err{margin:6px 0 0;font-size:13px;line-height:1.45;color:#b42318;font-weight:600}
.cw-hp{position:absolute;left:-10000px;top:auto;width:1px;height:1px;overflow:hidden}
.cw-ts:empty{display:none}
.cw-ts{margin:0 0 12px}
.cw-status{margin:0 0 10px;padding:10px 12px;border-radius:var(--radius-sm,12px);background:#fef3f2;color:#b42318;font-size:14px;line-height:1.5;font-weight:600}
.cw-fallback{margin:0 0 12px;font-size:14px;line-height:1.5;color:var(--text-secondary,rgba(19,23,34,.66));overflow-wrap:anywhere}
.cw-fallback a{color:var(--brand-blue-dark,#12408f);text-decoration:underline}
.cw-send{display:flex;align-items:center;justify-content:center;width:100%;min-height:48px;padding:12px 20px;border:0;border-radius:999px;
  background:var(--cta,#1a56c4);color:#fff;font:inherit;font-weight:700;font-size:15.5px;cursor:pointer;
  box-shadow:0 12px 26px -12px rgba(26,86,196,.6)}
.cw-send:hover{background:var(--cta-press,#12408f)}
.cw-send:disabled{opacity:.7;cursor:progress}
.cw-fine{margin:12px 0 0;font-size:12.5px;line-height:1.55;color:var(--text-tertiary,rgba(19,23,34,.62))}
.cw-done{padding:12px 0 4px;text-align:center}
.cw-done-ic{display:inline-flex;align-items:center;justify-content:center;width:52px;height:52px;margin-bottom:12px;border-radius:999px;
  background:rgba(15,122,61,.1);color:var(--success,#0f7a3d)}
.cw-done-ic .cw-ic{width:26px;height:26px}
.cw-done-title{margin:0 0 6px;font-size:20px;font-weight:800;letter-spacing:-.02em}
.cw-done-title:focus{outline:none}
.cw-done p{margin:0 0 18px;color:var(--text-secondary,rgba(19,23,34,.66));font-size:15px;line-height:1.55}
[hidden].cw-done,[hidden].cw-form,.cw-err[hidden],.cw-status[hidden],.cw-fallback[hidden]{display:none}

/* ---------- phones (portrait and landscape): icon-only button, full-screen sheet ---------- */
@media (max-width:600px),(max-height:520px){
  .cw-fab{right:max(16px,env(safe-area-inset-right));bottom:calc(16px + env(safe-area-inset-bottom));width:52px;height:52px;min-height:0;padding:0;justify-content:center}
  .cw-fab .cw-fab-label{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}
  .cw-fab .cw-ic{width:24px;height:24px}
  html.cw-ready .site-foot{padding-bottom:92px}
  .cw-dialog{inset:0;width:100%;height:100%;max-height:none;max-width:none}
  .cw-panel{border-radius:0;border:0;padding-bottom:env(safe-area-inset-bottom)}
  .cw-head{padding-left:max(18px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right));padding-top:max(14px,env(safe-area-inset-top))}
  .cw-body{padding-left:max(18px,env(safe-area-inset-left));padding-right:max(18px,env(safe-area-inset-right))}
  html.cw-open,html.cw-open body{overflow:hidden}
}

/* ---------- motion: only when the visitor has not asked for less ---------- */
@media (prefers-reduced-motion:no-preference){
  .cw-fab{transition:background .18s,transform .18s,box-shadow .18s}
  .cw-fab:hover{transform:translateY(-1px)}
  .cw-dialog[open] .cw-panel,.cw-fallback-dialog:not([hidden]) .cw-panel{animation:cw-in .18s ease-out}
  @keyframes cw-in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
}

@media print{.cw-fab,.cw-dialog,.cw-foot-btn{display:none!important}}
