/* Home Fuels chat launcher and panel. Uses the colour tokens from site.css. */
.hf-chat { position: fixed; right: 20px; bottom: 20px; z-index: 40; display: flex; flex-direction: column-reverse; align-items: flex-end; gap: 12px; font-family: var(--sans); }
.hf-chat-launch { display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 20px 0 16px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: 700 15px/1 var(--sans); cursor: pointer; box-shadow: 0 6px 20px rgba(28, 31, 36, .22); }
.hf-chat-launch:hover { background: var(--accent-dark); }
.hf-chat.is-open .hf-chat-launch span { display: none; }
.hf-chat.is-open .hf-chat-launch { width: 52px; padding: 0; justify-content: center; }

.hf-chat-panel { width: min(400px, calc(100vw - 32px)); height: min(600px, calc(100vh - 110px)); display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 16px 48px rgba(28, 31, 36, .24); overflow: hidden; }
.hf-chat-panel[hidden] { display: none; }
.hf-chat-head { display: flex; align-items: center; gap: 10px; padding: 12px 8px 12px 14px; border-bottom: 1px solid var(--line); }
.hf-chat-head .icon-tile { width: 38px; height: 38px; border-radius: 10px; }
.hf-chat-head h2 { font: 700 17px/1.2 var(--serif); margin-right: auto; }
.hf-chat-clear { background: none; border: 0; padding: 8px 6px; min-height: 40px; color: var(--link); font: 600 14px/1 var(--sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; white-space: nowrap; }
.hf-chat-notice { margin: 0; padding: 10px 14px; background: var(--ground); border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.45; color: var(--muted); }

.hf-chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.hf-msg { max-width: 88%; padding: 10px 13px; border-radius: 14px; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.hf-msg p { margin: 0; }
.hf-msg p + p, .hf-msg ul + p, .hf-msg p + ul { margin-top: 8px; }
.hf-msg ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.hf-msg-assistant { align-self: flex-start; background: var(--ground); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.hf-msg-user { white-space: pre-wrap; align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 4px; }
.hf-msg.is-waiting { color: var(--muted); font-style: italic; }
.hf-rate { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.hf-rate-q { margin-right: 2px; }
.hf-rate-btn { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.hf-rate-btn:hover { background: #fff; border-color: var(--line); color: var(--ink); }
.hf-rate-btn[aria-pressed="true"] { background: var(--tint); border-color: var(--accent); color: var(--accent); }
.hf-rate-down svg { transform: scaleY(-1); }
.hf-rate-ok { margin-left: 4px; }
.hf-msg.is-error { background: var(--err-bg); border-color: #F5C2BD; color: var(--err); }

.hf-chat-suggest { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 14px 12px; }
.hf-chat-suggest[hidden] { display: none; }
.hf-chat-suggest .chip { height: auto; min-height: 40px; padding: 8px 12px; font-size: 14px; cursor: pointer; text-align: left; }

.hf-chat-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.hf-chat-form textarea { box-sizing: border-box; flex: 1; min-height: 44px; max-height: 140px; resize: none; padding: 10px 12px; border: 1.5px solid var(--field-line); border-radius: 12px; font: 400 16px/1.4 var(--sans); color: var(--ink); background: #fff; }
.hf-chat-form textarea:focus { outline: 3px solid var(--focus); outline-offset: 1px; }
.hf-chat-send { width: 44px; height: 44px; padding: 0; flex-shrink: 0; }
.hf-chat-send:disabled { opacity: .55; cursor: default; }


@media (max-width: 600px) {
  .hf-chat { right: 12px; bottom: 12px; left: 12px; align-items: flex-end; }
  .hf-chat-panel { width: 100%; height: calc(100vh - 92px); height: calc(100dvh - 92px); }
  .hf-chat-launch span { display: none; }
  .hf-chat-launch { width: 52px; padding: 0; justify-content: center; }
}
@media print { .hf-chat { display: none; } }
