/* Use the active palette of either host page, including its explicit theme choice. */
.hf-chat {
  --hf-surface: var(--sheet, var(--white));
  --hf-inset: var(--code, var(--teal-pale));
  --hf-muted: var(--soft, var(--muted));
  --hf-accent: var(--sea, var(--teal));
  --hf-border: var(--rule, var(--line));
}
:root[data-theme="light"] .hf-chat { color-scheme: light; }
.hf-commission-link {
  display: inline-block; margin: .5rem .9rem; padding: .6rem 0;
  color: inherit; font: 600 .9rem/1.4 system-ui, sans-serif; text-underline-offset: .22em;
}
.hf-handoff { margin: 0 clamp(16px,4vw,32px) 20px; padding: 16px 20px; border-inline-start: 3px solid var(--hf-accent); background: var(--hf-inset); }
.hf-handoff summary { width: fit-content; padding: 6px 0; cursor: pointer; font: 600 .83rem/1.45 system-ui,sans-serif; color: var(--hf-accent); }
.hf-trial-promise { display: block; margin: 3px 0; color: var(--hf-muted); font: .84rem/1.5 system-ui,sans-serif; }
.hf-handoff p { margin: 6px 0 12px; overflow-wrap: anywhere; white-space: pre-line; }
.hf-handoff a { display: inline-block; padding-block: 4px; color: var(--hf-accent); font: 700 1rem/1.5 system-ui, sans-serif; text-underline-offset: .2em; }
.hf-transfer-note { display: block; margin-top: .5rem; }
.hf-transfer-note[hidden], .hf-handoff[hidden] { display: none; }
:root[data-theme="dark"] .hf-chat { color-scheme: dark; }
.hf-chat textarea::placeholder { color: var(--hf-muted); opacity: 1; }
.hf-msg code { background: var(--hf-inset); color: var(--ink); }
.hf-chat .hf-close:focus-visible { outline-color: #f4dfae; }
.hf-chat{color-scheme:light dark;box-sizing:border-box;background:var(--paper);color:var(--ink);padding:clamp(24px,5vw,72px) 16px;scroll-margin-top:12px}
.hf-chat *{box-sizing:border-box}.hf-shell{width:min(100%,46rem);margin:0 auto;background:var(--hf-surface);border:1px solid var(--hf-border);border-radius:12px;overflow:hidden;box-shadow:0 8px 30px #0f2c3510;font:1.05rem/1.5 Georgia,serif}
.hf-head{display:flex;align-items:center;justify-content:space-between;padding:20px clamp(16px,4vw,32px);background:#152b3a;color:#fcf8ef}
.hf-close{font:600 .85rem/1.2 system-ui,sans-serif;color:inherit;background:transparent;border:1px solid #829599;border-radius:6px;min-height:44px;padding:0 14px;cursor:pointer}
.hf-head h2{color:inherit;font:normal clamp(1.65rem,3vw,2.2rem)/1.15 Georgia,serif;margin:4px 0 0;letter-spacing:normal}
.hf-log{max-height:min(48vh,28rem);overflow-y:auto;padding:20px clamp(16px,4vw,32px);display:grid;gap:16px;overscroll-behavior:contain}
.hf-msg{max-width:92%;white-space:pre-wrap;overflow-wrap:anywhere;margin:0;color:var(--ink)}.hf-msg strong:not(.hf-speaker){font-weight:700}.hf-msg .hf-speaker{display:block;font:650 .75rem/1.5 system-ui,sans-serif;color:var(--hf-accent);margin-bottom:3px}
.hf-user{justify-self:end;background:var(--hf-inset);border-radius:10px 10px 2px 10px;padding:8px 13px}
.hf-chat form{margin:0;padding:0 clamp(16px,4vw,32px) 16px}.hf-chat label{display:block;color:var(--ink);font:600 .8rem/1.5 system-ui,sans-serif}
.hf-chat textarea{display:block;width:100%;min-height:64px;max-height:220px;padding:10px 12px;font:1rem/1.45 system-ui,sans-serif;color:var(--ink);background:var(--hf-surface);border:1px solid var(--hf-muted);border-radius:5px;resize:vertical;margin:4px 0 9px}
.hf-chat :focus-visible{outline:3px solid var(--hf-accent);outline-offset:2px}.hf-actions,.hf-foot{display:flex;align-items:center;justify-content:space-between;gap:10px}
.hf-actions button{border:0;background:#1c4946;color:#fff;border-radius:5px;padding:10px 16px;font:600 .88rem/1.4 system-ui,sans-serif;cursor:pointer}.hf-actions button:disabled{opacity:.58;cursor:default}
#hf-status{font:normal .8rem/1.45 system-ui,sans-serif;color:var(--hf-muted)}.hf-foot{color:var(--ink);margin:0;padding:12px clamp(16px,4vw,32px);background:var(--paper);border-top:1px solid var(--hf-border)}
.hf-foot a,.hf-foot button{font:600 .83rem/1.5 system-ui,sans-serif;color:var(--hf-accent);text-decoration:underline}.hf-foot button{border:0;background:transparent;cursor:pointer}
.hf-jump{color:#f4dfae;background:transparent;border:1px solid #bca579;border-radius:6px;min-height:44px;padding:8px 16px;font:600 .86rem/1.5 system-ui,sans-serif;cursor:pointer}.hf-jump:hover,.hf-close:hover{background:#ffffff13}.hf-jump:focus-visible{outline:3px solid #f4dfae;outline-offset:3px}.deck-in>.hf-jump{grid-column:1/-1;justify-self:start;margin:12px 0 0}
.hf-chat[hidden],.hf-jump[hidden]{display:none}
@media print{.hf-chat,.hf-jump{display:none}}

.hf-chat [hidden] { display:none !important; }
.hf-allowance { margin:0; padding:12px clamp(16px,4vw,32px) 12px; color:var(--ink); font:500 .88rem/1.45 system-ui,sans-serif; }
.hf-voice { display:flex; align-items:center; flex-wrap:wrap; gap:4px 14px; padding:0 clamp(16px,4vw,32px) 8px; font:500 .82rem/1.4 system-ui,sans-serif; color:var(--ink); }
.hf-voice[hidden],.hf-voice button[hidden] { display:none; }
.hf-chat .hf-voice label,.hf-voice button { display:inline-flex; align-items:center; min-height:44px; gap:7px; cursor:pointer; }
.hf-voice input { accent-color:var(--hf-accent); }
.hf-voice button { box-sizing:border-box; inline-size:8em; justify-content:center; white-space:nowrap; color:var(--hf-accent); background:transparent; border:0; padding:0 6px; font:inherit; text-decoration:underline; }
.hf-chat .hf-voice label { font-weight:500; }
