/* The website assistant (docs/CC-BRIEF-nov28-website-assistant.md section 2). ONE SOURCE for both websites: site/assets/assist.css
   and habitstack/assets/assist.css are the same bytes (tools/site-check.js). Its own tokens, light by default; dark where the page's
   <html> says data-theme="dark" (hydroprotracker.com's theme.js). No CSS filters (ARCH-15). */
.hpa{
  --hpa-bg:#FFFFFF; --hpa-s1:#F4F7F9; --hpa-line:#D3DBE3; --hpa-text:#101A24; --hpa-muted:#44566A;
  --hpa-accent:#0C857E; --hpa-on-accent:#FFFFFF; --hpa-you:#E3F4F2; --hpa-shadow:0 12px 40px rgba(16,26,36,.22);
  --hpa-font:Figtree,"Plus Jakarta Sans",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  font-family:var(--hpa-font); color:var(--hpa-text);
}
.hpa[data-site="habitstack"]{ --hpa-accent:#0369A1; --hpa-you:#E0F2FE; }
html[data-theme="dark"] .hpa{
  --hpa-bg:#151A21; --hpa-s1:#1B222B; --hpa-line:#26313E; --hpa-text:#FFF6DB; --hpa-muted:#9FB0C4;
  --hpa-accent:#3DD9D0; --hpa-on-accent:#062624; --hpa-you:#1E3A3A; --hpa-shadow:0 12px 40px rgba(0,0,0,.55);
}
.hpa *,.hpa *::before,.hpa *::after{ box-sizing:border-box; }
.hpa-btn{
  position:fixed; right:20px; bottom:20px; z-index:2147483000; width:56px; height:56px; border-radius:50%; border:0;
  background:var(--hpa-accent); color:var(--hpa-on-accent); box-shadow:var(--hpa-shadow); cursor:pointer;
  display:flex; align-items:center; justify-content:center; padding:0;
}
.hpa-btn:hover{ transform:translateY(-1px); }
.hpa-btn:focus-visible,.hpa button:focus-visible,.hpa a:focus-visible,.hpa textarea:focus-visible{ outline:3px solid var(--hpa-accent); outline-offset:2px; }
.hpa-btn svg{ width:26px; height:26px; }
html.hpa-open .hpa-btn{ display:none; }
.hpa-panel{
  position:fixed; right:20px; bottom:20px; z-index:2147483001; width:380px; max-width:calc(100vw - 32px);
  height:min(620px, calc(100vh - 40px)); display:flex; flex-direction:column; background:var(--hpa-bg);
  border:1px solid var(--hpa-line); border-radius:18px; box-shadow:var(--hpa-shadow); overflow:hidden;
}
.hpa-panel[hidden]{ display:none; }
.hpa-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 14px 12px 18px; border-bottom:1px solid var(--hpa-line); }
.hpa-title h2{ margin:0; font-size:17px; line-height:1.2; font-weight:700; color:var(--hpa-text); letter-spacing:0; }
.hpa-small{ display:block; font-size:12px; color:var(--hpa-muted); margin-top:2px; }
.hpa-x{ width:40px; height:40px; border-radius:50%; border:0; background:transparent; color:var(--hpa-muted); cursor:pointer; display:flex; align-items:center; justify-content:center; }
.hpa-x:hover{ background:var(--hpa-s1); color:var(--hpa-text); }
.hpa-x svg{ width:20px; height:20px; }
.hpa-body{ flex:1; overflow-y:auto; padding:14px 16px; display:flex; flex-direction:column; gap:12px; }
.hpa-notice{ margin:0; font-size:13px; line-height:1.5; color:var(--hpa-muted); background:var(--hpa-s1); border-radius:12px; padding:10px 12px; }
.hpa-notice b{ color:var(--hpa-text); font-weight:600; }
.hpa-notice a{ color:var(--hpa-accent); font-weight:600; }
.hpa-starters{ display:flex; flex-direction:column; gap:8px; }
.hpa-starters:empty{ display:none; }
.hpa-starter{
  text-align:left; font:inherit; font-size:14px; font-weight:600; color:var(--hpa-accent); background:transparent;
  border:1px solid var(--hpa-line); border-radius:12px; padding:10px 12px; cursor:pointer; min-height:44px;
}
.hpa-starter:hover{ border-color:var(--hpa-accent); }
.hpa-log{ display:flex; flex-direction:column; gap:10px; }
.hpa-msg{ max-width:88%; border-radius:14px; padding:9px 12px; font-size:14.5px; line-height:1.5; }
.hpa-msg p{ margin:0; white-space:pre-wrap; overflow-wrap:anywhere; }
.hpa-you{ align-self:flex-end; background:var(--hpa-you); color:var(--hpa-text); }
.hpa-bot{ align-self:flex-start; background:var(--hpa-s1); color:var(--hpa-text); }
.hpa-vh{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.hpa-after{ display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-top:8px; }
.hpa-chip{ font-size:12.5px; font-weight:600; color:var(--hpa-accent); border:1px solid var(--hpa-line); border-radius:999px; padding:4px 10px; text-decoration:none; background:var(--hpa-bg); }
.hpa-chip:hover{ border-color:var(--hpa-accent); }
.hpa-person{ font-size:13px; font-weight:700; color:var(--hpa-on-accent); background:var(--hpa-accent); border-radius:999px; padding:6px 12px; text-decoration:none; }
.hpa-thumbs{ display:flex; gap:2px; margin-left:auto; }
.hpa-thumb{ width:32px; height:32px; border:0; border-radius:8px; background:transparent; color:var(--hpa-muted); cursor:pointer; display:flex; align-items:center; justify-content:center; }
.hpa-thumb svg{ width:16px; height:16px; }
.hpa-thumb[aria-pressed="true"]{ color:var(--hpa-accent); background:var(--hpa-bg); }
.hpa-thumb:disabled{ cursor:default; }
.hpa-wait{ display:flex; gap:4px; padding:12px 14px; }
.hpa-wait span{ width:7px; height:7px; border-radius:50%; background:var(--hpa-muted); opacity:.5; animation:hpa-dot 1s infinite ease-in-out; }
.hpa-wait span:nth-child(2){ animation-delay:.15s; } .hpa-wait span:nth-child(3){ animation-delay:.3s; }
@keyframes hpa-dot{ 0%,100%{ opacity:.3; } 50%{ opacity:1; } }
@media (prefers-reduced-motion: reduce){ .hpa-wait span{ animation:none; } .hpa-btn:hover{ transform:none; } }
.hpa-status{ margin:0; min-height:0; font-size:12px; color:var(--hpa-muted); }
.hpa-status:empty{ display:none; }
.hpa-form{ display:flex; align-items:flex-end; gap:8px; padding:10px 12px 12px; border-top:1px solid var(--hpa-line); }
.hpa-input{
  flex:1; resize:none; font:inherit; font-size:16px; line-height:1.4; color:var(--hpa-text); background:var(--hpa-s1);
  border:1px solid var(--hpa-line); border-radius:12px; padding:10px 12px; min-height:44px; max-height:120px;
}
.hpa-input::placeholder{ color:var(--hpa-muted); }
.hpa-send{ width:44px; height:44px; flex:none; border:0; border-radius:12px; background:var(--hpa-accent); color:var(--hpa-on-accent); cursor:pointer; display:flex; align-items:center; justify-content:center; }
.hpa-send:disabled{ opacity:.5; cursor:default; }
.hpa-send svg{ width:20px; height:20px; }
@media (max-width:520px){
  .hpa-btn{ right:16px; bottom:16px; }
  .hpa-panel{ left:0; right:0; bottom:0; width:100%; max-width:none; height:min(88vh, 100%); border-radius:18px 18px 0 0; border-left:0; border-right:0; border-bottom:0; }
}
/* Habit on habitstackhealth.com (docs/CC-BRIEF-habit-concierge.md section 3). The door under an answer: */
.hpa-next{ display:inline-flex; align-items:center; min-height:36px; padding:6px 14px; border-radius:999px; background:var(--hpa-accent); color:var(--hpa-on-accent); font-size:13px; font-weight:700; text-decoration:none; }
.hpa-next:hover{ text-decoration:underline; }
/* The corner button on a narrow screen only (data-corner="mobile"), or never ("off"). */
@media (min-width:768px){ .hpa[data-corner="mobile"] .hpa-btn{ display:none; } }
.hpa[data-corner="off"] .hpa-btn{ display:none; }
/* The inline bars: in the page, outside .hpa, so their own tokens; light by default, light text on a section marked on-dark. */
[data-assist-bar][hidden]{ display:none; }
[data-assist-bar]{ margin:22px 0 0; max-width:640px; }
.hpa-bar{ --bar-bg:#FFFFFF; --bar-line:#D3DBE3; --bar-text:#101A24; --bar-muted:#44566A; --bar-accent:#0369A1; --bar-on-accent:#FFFFFF;
  display:flex; gap:8px; align-items:center; background:var(--bar-bg); border:1px solid var(--bar-line); border-radius:999px; padding:6px 6px 6px 18px;
  font-family:Figtree,"Plus Jakarta Sans",system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif; box-shadow:0 6px 20px rgba(16,26,36,.10); }
.on-dark .hpa-bar{ --bar-bg:rgba(255,255,255,.08); --bar-line:rgba(255,255,255,.22); --bar-text:#FFFFFF; --bar-muted:rgba(255,255,255,.72); --bar-accent:#38BDF8; --bar-on-accent:#062236; box-shadow:none; }
.hpa-bar-input{ flex:1; min-width:0; border:0; background:transparent; color:var(--bar-text); font:inherit; font-size:16px; padding:10px 0; }
.hpa-bar-input::placeholder{ color:var(--bar-muted); opacity:1; }
.hpa-bar-input:focus{ outline:none; }
.hpa-bar:focus-within{ outline:3px solid var(--bar-accent); outline-offset:2px; }
.hpa-bar-send{ flex:none; min-height:44px; border:0; border-radius:999px; padding:0 18px; background:var(--bar-accent); color:var(--bar-on-accent); font:inherit; font-size:15px; font-weight:700; cursor:pointer; }
.hpa-bar-send:focus-visible{ outline:3px solid var(--bar-text); outline-offset:2px; }
@media (max-width:420px){ .hpa-bar{ padding-left:14px; } .hpa-bar-send{ padding:0 14px; } }
/* Aura, Habit's mark (docs/design/habit-aura.md): the orbit turns slowly; the corner button's halo is a box-shadow (ARCH-15); both still
   under reduced motion. */
.hpa-btn.hpa-btn-aura{ background:transparent; padding:0; overflow:visible; animation:hpaHalo 3.2s ease-out infinite; }
.hpa-btn.hpa-btn-aura svg{ width:56px; height:56px; }
.hpa-aura .habit-aura-orbit{ transform-origin:32px 32px; animation:hpaSpin 14s linear infinite; }
.hpa-title-aura{ display:flex; align-items:center; gap:10px; }
.hpa-title-aura .hpa-aura{ flex:none; width:36px; height:36px; }
@keyframes hpaSpin{ from{ transform:rotate(0deg); } to{ transform:rotate(360deg); } }
@keyframes hpaHalo{ 0%{ box-shadow:0 0 0 0 rgba(12,133,126,.35), var(--hpa-shadow); } 100%{ box-shadow:0 0 0 14px rgba(12,133,126,0), var(--hpa-shadow); } }
html[data-theme="dark"] .hpa-btn.hpa-btn-aura{ animation-name:hpaHaloDark; }
@keyframes hpaHaloDark{ 0%{ box-shadow:0 0 0 0 rgba(61,217,208,.45), var(--hpa-shadow); } 100%{ box-shadow:0 0 0 14px rgba(61,217,208,0), var(--hpa-shadow); } }
@media (prefers-reduced-motion: reduce){ .hpa-btn.hpa-btn-aura, .hpa-aura .habit-aura-orbit{ animation:none; } }
