/* ══ "Help" chat bubble (js/help-widget.js) — shared by the public site, student dashboard and admin ══ */
.pfh { --pfh-brand: #002653; --pfh-accent: #1f6fd1; --pfh-bg: #ffffff; --pfh-soft: #f2f6fc; --pfh-line: #e3e9f2; --pfh-ink: #0b1b36; --pfh-body: #3f4a5e; --pfh-muted: #6b7486; --pfh-user: #002653; --pfh-user-ink: #ffffff;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif; position: fixed; z-index: 9990; right: 20px; bottom: 20px; }
[data-theme="dark"] .pfh { --pfh-bg: #171b24; --pfh-soft: #222838; --pfh-line: #2e3446; --pfh-ink: #eef1f7; --pfh-body: #c3c9d6; --pfh-muted: #8e96a8; --pfh-user: #4a9eff; --pfh-user-ink: #00132b; --pfh-accent: #6ab0ff; }
.pfh *, .pfh *::before, .pfh *::after { box-sizing: border-box; }
.pfh--dash { bottom: 20px; }
@media (max-width: 768px) { .pfh--dash { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); } }

/* launcher */
.pfh-launch { display: inline-flex; align-items: center; gap: 8px; height: 50px; padding: 0 20px 0 16px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--pfh-brand); color: #fff; font: 600 15px/1 inherit; font-family: inherit; box-shadow: 0 12px 28px rgba(0, 38, 83, .32); transition: transform .2s, box-shadow .2s; }
.pfh-launch:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(0, 38, 83, .38); }
.pfh-launch:focus-visible { outline: 3px solid rgba(31, 111, 209, .5); outline-offset: 3px; }
.pfh-launch svg { width: 22px; height: 22px; }
.pfh.is-open .pfh-launch { display: none; }
.pfh--no-launcher .pfh-launch { display: none; }
/* with a top-bar trigger the panel opens under the top bar on desktop */
@media (min-width: 601px) { .pfh--no-launcher.is-open { top: 76px; bottom: auto; } .pfh--no-launcher .pfh-panel { top: 0; bottom: auto; height: min(620px, calc(100vh - 96px)); } }
@media (max-width: 600px) { .pfh-launch { height: 48px; padding: 0 16px 0 14px; } }

/* panel */
.pfh-panel { position: absolute; right: 0; bottom: 0; width: 380px; height: min(620px, calc(100vh - 40px)); display: none; flex-direction: column; overflow: hidden;
  background: var(--pfh-bg); border-radius: 22px; border: 1px solid var(--pfh-line); box-shadow: 0 24px 60px rgba(0, 20, 50, .28); animation: pfhIn .22s ease-out; }
.pfh.is-open .pfh-panel { display: flex; }
@keyframes pfhIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .pfh-panel { animation: none; } .pfh-launch { transition: none; } }
@media (max-width: 600px) {
  .pfh.is-open { inset: 0; right: 0; bottom: 0; }
  .pfh-panel { position: fixed; inset: 0; width: auto; height: auto; border-radius: 0; border: 0; } /* edges, not 100dvh (taller than the screen in some installed apps) */
}

.pfh-head { display: flex; align-items: center; gap: 12px; padding: 16px 14px 16px 18px; color: #fff; background: linear-gradient(135deg, #002653, #0d3f80); flex-shrink: 0; }
.pfh-avatar { width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.14); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pfh-avatar svg { width: 22px; height: 22px; }
.pfh-title { flex: 1; min-width: 0; }
.pfh-title strong { display: block; font-size: 16px; font-weight: 700; }
.pfh-title span { display: block; font-size: 12.5px; opacity: .8; margin-top: 2px; }
.pfh-icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.pfh-icon-btn:hover { background: rgba(255,255,255,.12); }
.pfh-icon-btn:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.pfh-icon-btn svg { width: 20px; height: 20px; }

.pfh-log { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 10px; background: var(--pfh-bg); overscroll-behavior: contain; }
.pfh-msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; font-size: 14.5px; line-height: 1.55; word-wrap: break-word; }
.pfh-msg--bot { align-self: flex-start; background: var(--pfh-soft); color: var(--pfh-ink); border-bottom-left-radius: 5px; }
.pfh-msg--user { align-self: flex-end; background: var(--pfh-user); color: var(--pfh-user-ink); border-bottom-right-radius: 5px; white-space: pre-wrap; }
.pfh-msg p { margin: 0; }
.pfh-msg p + p, .pfh-msg ul, .pfh-msg ol { margin-top: 6px; }
.pfh-msg ul, .pfh-msg ol { margin-bottom: 0; padding-left: 20px; }
.pfh-msg ul { list-style: disc; } .pfh-msg ol { list-style: decimal; }
.pfh-msg li { display: list-item; }
.pfh-msg li + li { margin-top: 3px; }
.pfh-msg strong { font-weight: 650; }
.pfh-msg code { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; background: rgba(0,38,83,.08); padding: 1px 5px; border-radius: 5px; word-break: break-word; }
.pfh-msg a { color: var(--pfh-accent); font-weight: 600; }
.pfh-msg--error { align-self: flex-start; background: #fff3f2; color: #a8231a; border: 1px solid #f6d3cf; }
[data-theme="dark"] .pfh-msg--error { background: #3a1d1b; color: #ffb4ab; border-color: #5a2a26; }

.pfh-typing { align-self: flex-start; display: inline-flex; gap: 4px; padding: 12px 14px; border-radius: 16px; background: var(--pfh-soft); }
.pfh-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--pfh-muted); animation: pfhDot 1.2s infinite ease-in-out; }
.pfh-typing i:nth-child(2) { animation-delay: .15s; } .pfh-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes pfhDot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

.pfh-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.pfh-chip { border: 1px solid var(--pfh-line); background: var(--pfh-bg); color: var(--pfh-ink); border-radius: 999px; padding: 8px 13px; font: 500 13.5px/1.2 inherit; font-family: inherit; cursor: pointer; text-align: left; }
.pfh-chip:hover { border-color: var(--pfh-accent); color: var(--pfh-accent); }

/* handoff card */
.pfh-card { align-self: stretch; border: 1px solid var(--pfh-line); border-radius: 16px; padding: 14px; background: var(--pfh-bg); box-shadow: 0 4px 14px rgba(0,38,83,.06); }
.pfh-card h4 { margin: 0 0 4px; font-size: 14.5px; font-weight: 700; color: var(--pfh-ink); }
.pfh-card p { margin: 0 0 10px; font-size: 13.5px; line-height: 1.5; color: var(--pfh-body); }
.pfh-card .pfh-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pfh-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: 999px; border: 0; font: 600 13.5px/1 inherit; font-family: inherit; cursor: pointer; text-decoration: none; }
.pfh-btn svg { width: 17px; height: 17px; }
.pfh-btn--primary { background: var(--pfh-brand); color: #fff; }
[data-theme="dark"] .pfh-btn--primary { background: var(--pfh-user); color: var(--pfh-user-ink); }
.pfh-btn--wa { background: #1fa855; color: #fff; }
.pfh-btn--ghost { background: var(--pfh-soft); color: var(--pfh-ink); }
.pfh-btn:disabled { opacity: .6; cursor: default; }
.pfh-btn:focus-visible, .pfh-chip:focus-visible { outline: 3px solid rgba(31,111,209,.45); outline-offset: 2px; }
.pfh-field { display: block; width: 100%; margin-bottom: 8px; border: 1px solid var(--pfh-line); background: var(--pfh-soft); color: var(--pfh-ink); border-radius: 12px; padding: 10px 12px; font: 16px/1.4 inherit; font-family: inherit; }
.pfh-field:focus { outline: none; border-color: var(--pfh-accent); box-shadow: 0 0 0 3px rgba(31,111,209,.15); }
.pfh-card .pfh-err { color: #c0352b; font-size: 13px; margin: 0 0 8px; }

/* composer */
.pfh-foot { flex-shrink: 0; padding: 10px 12px 12px; border-top: 1px solid var(--pfh-line); background: var(--pfh-bg); padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
.pfh-compose { display: flex; align-items: flex-end; gap: 8px; }
.pfh-input { flex: 1; resize: none; max-height: 120px; min-height: 44px; border: 1px solid var(--pfh-line); background: var(--pfh-soft); color: var(--pfh-ink); border-radius: 14px; padding: 11px 14px; font: 16px/1.4 inherit; font-family: inherit; }
.pfh-input:focus { outline: none; border-color: var(--pfh-accent); background: var(--pfh-bg); }
.pfh-send { width: 44px; height: 44px; flex-shrink: 0; border-radius: 50%; border: 0; background: var(--pfh-brand); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
[data-theme="dark"] .pfh-send { background: var(--pfh-user); color: var(--pfh-user-ink); }
.pfh-send:disabled { opacity: .5; cursor: default; }
.pfh-send svg { width: 20px; height: 20px; }
.pfh-meta { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 12px; color: var(--pfh-muted); }
.pfh-link { border: 0; background: none; padding: 0; color: var(--pfh-accent); font: 600 12px/1 inherit; font-family: inherit; cursor: pointer; }
.pfh-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
