/* =========================================================
   Hearthpaw — FAQ chat bubble
   ========================================================= */
.hp-chat{
  position:fixed;
  right:16px;
  bottom:calc(16px + env(safe-area-inset-bottom, 0px));
  z-index:80;
  font-family:var(--sans, system-ui, sans-serif);
  pointer-events:none;
}
.hp-chat > *{pointer-events:auto}
.hp-chat--above-buybar{
  bottom:calc(76px + env(safe-area-inset-bottom, 0px));
}
@media (min-width:1000px){
  .hp-chat--above-buybar{bottom:calc(16px + env(safe-area-inset-bottom, 0px))}
}

.hp-chat__fab{
  width:56px;
  height:56px;
  border:0;
  border-radius:50%;
  background:var(--accent, #e8743b);
  color:#fff;
  display:grid;
  place-items:center;
  cursor:pointer;
  box-shadow:0 12px 28px -10px rgba(232,116,59,.7), 0 8px 24px -12px rgba(23,24,28,.45);
  transition:transform .2s ease, background .2s ease, box-shadow .2s ease;
}
.hp-chat__fab:hover{background:var(--accent-dark, #cf5f28);transform:translateY(-2px)}
.hp-chat__fab:focus-visible{outline:3px solid var(--ink, #17181c);outline-offset:3px}
.hp-chat__fab svg{width:26px;height:26px;display:block}
.hp-chat.is-open .hp-chat__fab{display:none}

.hp-chat__panel{
  display:none;
  flex-direction:column;
  width:min(360px, calc(100vw - 24px));
  height:min(520px, calc(100vh - 32px - env(safe-area-inset-bottom, 0px)));
  background:var(--cream, #faf7f2);
  border-radius:var(--radius, 22px);
  box-shadow:var(--shadow-lg, 0 40px 80px -30px rgba(23,24,28,.35));
  border:1px solid var(--line, #e6e0d5);
  overflow:hidden;
  transform-origin:bottom right;
}
.hp-chat.is-open .hp-chat__panel{display:flex}
.hp-chat--above-buybar .hp-chat__panel{
  height:min(520px, calc(100vh - 100px - env(safe-area-inset-bottom, 0px)));
}
@media (min-width:1000px){
  .hp-chat--above-buybar .hp-chat__panel{height:min(520px, calc(100vh - 32px - env(safe-area-inset-bottom, 0px)))}
}

.hp-chat__head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  background:var(--ink, #17181c);
  color:#fff;
  padding:14px 14px 14px 16px;
  flex:none;
}
.hp-chat__brand{display:flex;align-items:center;gap:10px;min-width:0}
.hp-chat__mark{width:28px;height:28px;color:var(--accent, #e8743b);flex:none}
.hp-chat__head h2{
  font-family:var(--serif, Georgia, serif);
  font-size:1.05rem;
  font-weight:600;
  letter-spacing:-.02em;
  margin:0;
  color:#fff;
  line-height:1.15;
}
.hp-chat__head p{margin:2px 0 0;font-size:.72rem;color:#bdbab4;font-weight:500;letter-spacing:.02em}
.hp-chat__close{
  width:36px;height:36px;border:0;border-radius:50%;
  background:rgba(255,255,255,.1);color:#fff;cursor:pointer;
  display:grid;place-items:center;flex:none;
}
.hp-chat__close:hover{background:rgba(255,255,255,.18)}
.hp-chat__close svg{width:18px;height:18px}

.hp-chat__log{
  flex:1;
  overflow-y:auto;
  padding:14px 14px 8px;
  display:flex;
  flex-direction:column;
  gap:10px;
  -webkit-overflow-scrolling:touch;
}
.hp-chat__msg{
  max-width:92%;
  padding:10px 13px;
  border-radius:16px;
  font-size:.9rem;
  line-height:1.5;
  color:var(--ink, #17181c);
}
.hp-chat__msg p{margin:0 0 .6em}
.hp-chat__msg p:last-child{margin-bottom:0}
.hp-chat__msg a{color:var(--accent-dark, #cf5f28);font-weight:600}
.hp-chat__msg--bot{
  background:#fff;
  border:1px solid var(--line, #e6e0d5);
  border-bottom-left-radius:6px;
  align-self:flex-start;
}
.hp-chat__msg--user{
  background:var(--accent, #e8743b);
  color:#fff;
  border-bottom-right-radius:6px;
  align-self:flex-end;
}
.hp-chat__buy{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  margin-top:10px;
  padding:9px 16px;
  border-radius:999px;
  background:var(--accent, #e8743b);
  color:#fff !important;
  font-weight:600;
  font-size:.85rem;
  text-decoration:none;
  box-shadow:0 8px 18px -8px rgba(232,116,59,.7);
}
.hp-chat__buy:hover{background:var(--accent-dark, #cf5f28)}

.hp-chat__chips{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  padding:4px 14px 10px;
  flex:none;
}
.hp-chat__chip{
  border:1px solid var(--line, #e6e0d5);
  background:#fff;
  color:var(--ink-2, #2a2c33);
  font-size:.75rem;
  font-weight:600;
  padding:7px 11px;
  border-radius:999px;
  cursor:pointer;
  line-height:1.2;
  font-family:inherit;
}
.hp-chat__chip:hover{border-color:var(--accent, #e8743b);color:var(--accent-dark, #cf5f28)}

.hp-chat__form{
  display:flex;
  gap:8px;
  padding:10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  background:#fff;
  border-top:1px solid var(--line, #e6e0d5);
  flex:none;
}
.hp-chat__input{
  flex:1;
  min-width:0;
  border:1px solid var(--line, #e6e0d5);
  background:var(--cream, #faf7f2);
  border-radius:999px;
  padding:10px 14px;
  font:inherit;
  font-size:.9rem;
  color:var(--ink, #17181c);
}
.hp-chat__input:focus{outline:2px solid var(--accent, #e8743b);outline-offset:1px;border-color:transparent}
.hp-chat__send{
  width:42px;height:42px;border:0;border-radius:50%;
  background:var(--ink, #17181c);color:#fff;cursor:pointer;
  display:grid;place-items:center;flex:none;
}
.hp-chat__send:hover{background:#000}
.hp-chat__send svg{width:18px;height:18px}
.hp-chat__send:disabled{opacity:.4;cursor:default}

@media (prefers-reduced-motion:reduce){
  .hp-chat__fab{transition:none}
}
