:root {
  --hc-brand: #732515;      /* HEC logo burgundy */
  --hc-brand-2: #8f3420;
  --hc-ink: #222;
  --hc-muted: #6b6b6b;
  --hc-soft: #f6f2ef;
  --hc-line: #e7dfda;
  --hc-width: 410px;
}
/* Launcher: big pill with a pulsing ring and a short hop every few seconds, plus a greeting bubble above it
   (the pattern Intercom / Tidio / Drift use so visitors notice the chat). Motion stops once the chat was opened
   in this tab and is off for prefers-reduced-motion. */
.hc-launcher {
  position: fixed; right: 24px; bottom: 24px; z-index: 99998;
  display: flex; align-items: center; gap: 11px;
  background: var(--hc-brand); color: #fff; border: 0; border-radius: 40px;
  padding: 16px 26px 16px 20px; font: 700 17px/1 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  box-shadow: 0 8px 28px rgba(115, 37, 21, .45); cursor: pointer; transition: background .15s;
}
.hc-launcher svg { width: 28px; height: 28px; }
.hc-launcher:hover { background: var(--hc-brand-2); }
.hc-launcher .hc-ai { background: #fff; color: var(--hc-brand); font-size: 11px; font-weight: 800; padding: 3px 6px; border-radius: 6px; letter-spacing: .5px; }
.hc-launcher::before { content: ""; position: absolute; inset: 0; border-radius: inherit; border: 3px solid var(--hc-brand); opacity: 0; pointer-events: none; }
.hc-launcher.hc-attn { animation: hc-hop 6s ease-in-out 1.2s infinite; }
.hc-launcher.hc-attn::before { animation: hc-ring 2.4s ease-out infinite; }
.hc-launcher.hc-attn:hover { animation-play-state: paused; }
@keyframes hc-hop {
  0%, 12%, 100% { transform: translateY(0); }
  3% { transform: translateY(-14px); } 6% { transform: translateY(0); } 8.5% { transform: translateY(-6px); } 10.5% { transform: translateY(0); }
}
@keyframes hc-ring { 0% { opacity: .7; transform: scale(1); } 100% { opacity: 0; transform: scale(1.3, 1.6); } }
.hc-teaser {
  position: fixed; right: 24px; bottom: 98px; z-index: 99998; max-width: 270px;
  background: #fff; color: var(--hc-ink); border-radius: 16px 16px 4px 16px; padding: 13px 34px 13px 15px;
  box-shadow: 0 10px 32px rgba(0, 0, 0, .2); cursor: pointer;
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  opacity: 0; transform: translateY(10px) scale(.96); pointer-events: none; transition: opacity .3s ease, transform .3s ease;
}
.hc-teaser.hc-show { opacity: 1; transform: none; pointer-events: auto; }
.hc-teaser b { display: block; color: var(--hc-brand); margin-bottom: 2px; font-weight: 700; }
.hc-teaser .hc-tx { position: absolute; top: 4px; right: 6px; background: transparent; border: 0; color: var(--hc-muted); font-size: 20px; line-height: 1; cursor: pointer; padding: 4px 6px; }
@media (prefers-reduced-motion: reduce) {
  .hc-launcher.hc-attn, .hc-launcher.hc-attn::before { animation: none; }
  .hc-teaser { transition: none; }
}
.hc-backdrop {
  position: fixed; inset: 0; z-index: 99998; background: rgba(40, 10, 5, .12);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.hc-backdrop.hc-open { opacity: 1; pointer-events: auto; }
.hc-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 99999;
  width: var(--hc-width); max-width: calc(100vw - 40px);
  height: 640px; max-height: calc(100vh - 40px);
  background: #fff; border-radius: 18px; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: 0 16px 48px rgba(0, 0, 0, .28);
  opacity: 0; transform: translateY(24px) scale(.98); pointer-events: none;
  transition: transform .25s ease, opacity .25s ease;
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; color: var(--hc-ink);
}
.hc-panel.hc-open { opacity: 1; transform: none; pointer-events: auto; }
/* Shield the panel from the site's UIkit styles (headings, lists, links). */
.hc-panel, .hc-panel * { box-sizing: border-box; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; letter-spacing: normal; text-transform: none; }
.hc-head { background: var(--hc-brand); color: #fff; padding: 12px 14px; display: flex; align-items: center; gap: 12px; }
.hc-head .hc-logo { height: 30px; width: auto; flex: none; }
.hc-head .hc-htext { min-width: 0; }
.hc-head .hc-title { font-weight: 700; font-size: 16px; color: #fff; }
.hc-head .hc-sub { font-size: 12px; opacity: .85; color: #fff; }
.hc-head .hc-reset { margin-left: auto; background: transparent; border: 0; color: #fff; cursor: pointer; padding: 6px; border-radius: 8px; display: grid; place-items: center; opacity: .85; }
.hc-head .hc-reset:hover { background: rgba(255,255,255,.15); opacity: 1; }
.hc-head .hc-close { background: transparent; border: 0; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; padding: 4px 8px; }
.hc-msgs { flex: 1; overflow-y: auto; padding: 16px; background: var(--hc-soft); display: flex; flex-direction: column; gap: 10px; }
.hc-msg { max-width: 88%; padding: 10px 13px; border-radius: 14px; overflow-wrap: anywhere; }
.hc-msg.hc-bot { background: #fff; border: 1px solid var(--hc-line); align-self: flex-start; border-bottom-left-radius: 4px; }
.hc-msg.hc-user { background: var(--hc-brand); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.hc-msg, .hc-msg p, .hc-msg li, .hc-msg td, .hc-msg th, .hc-msg span { font-size: 14px; line-height: 1.45; font-weight: 400; color: inherit; }
.hc-msg h1, .hc-msg h2, .hc-msg h3, .hc-msg h4, .hc-msg h5, .hc-msg h6 { font-size: 14px; line-height: 1.4; font-weight: 700; margin: 10px 0 4px; color: var(--hc-brand); }
.hc-msg strong, .hc-msg b { font-weight: 700; }
.hc-msg p { margin: 0 0 8px; } .hc-msg p:last-child { margin-bottom: 0; }
.hc-msg ul, .hc-msg ol { margin: 4px 0 8px; padding-left: 20px; }
.hc-msg li { margin: 2px 0; list-style: disc; } .hc-msg ol li { list-style: decimal; }
.hc-msg a { color: var(--hc-brand); font-weight: 600; text-decoration: underline; }
.hc-msg.hc-user a { color: #fff; }
.hc-msg table { border-collapse: collapse; font-size: 13px; margin: 6px 0; display: block; overflow-x: auto; }
.hc-msg th, .hc-msg td { border: 1px solid var(--hc-line); padding: 4px 6px; text-align: left; vertical-align: top; }
/* Start menu: three topics as full-width buttons. */
.hc-menu { display: flex; flex-direction: column; gap: 8px; align-self: stretch; }
.hc-topic { display: flex; align-items: center; gap: 10px; width: 100%; background: #fff; border: 1px solid var(--hc-line);
  border-left: 4px solid var(--hc-brand); color: var(--hc-ink); border-radius: 12px; padding: 11px 14px;
  font-size: 15px; font-weight: 600; cursor: pointer; text-align: left; transition: background .15s, border-color .15s; }
.hc-topic:hover, .hc-topic:focus-visible { background: #fbf6f3; border-color: var(--hc-brand); outline: none; }
.hc-topic .hc-ti { font-size: 18px; line-height: 1; }
/* Was this helpful? 👍/👎 under an answer */
.hc-rate { align-self: flex-start; display: flex; align-items: center; gap: 6px; margin: -4px 0 2px 4px; font-size: 12px; color: var(--hc-muted); }
.hc-rate button { background: transparent; border: 1px solid var(--hc-line); color: var(--hc-muted); border-radius: 8px; padding: 3px 7px;
  cursor: pointer; display: grid; place-items: center; }
.hc-rate button:hover { border-color: var(--hc-brand); color: var(--hc-brand); }
.hc-rate .hc-down svg { transform: rotate(180deg); }
.hc-typing { display: inline-flex; gap: 4px; align-items: center; }
.hc-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--hc-brand-2); animation: hc-b 1s infinite ease-in-out; }
.hc-typing span:nth-child(2) { animation-delay: .15s; } .hc-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes hc-b { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.hc-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--hc-line); background: #fff; margin: 0; }
.hc-form textarea { flex: 1; resize: none; border: 1px solid var(--hc-line); border-radius: 10px; padding: 10px; font-size: 15px; max-height: 120px; min-height: 42px; color: var(--hc-ink); background: #fff; }
.hc-form textarea:focus { outline: 2px solid var(--hc-brand); outline-offset: -1px; }
.hc-form button { background: var(--hc-brand); color: #fff; border: 0; border-radius: 10px; padding: 0 16px; font-weight: 700; font-size: 14px; cursor: pointer; }
.hc-form button:disabled { opacity: .5; cursor: default; }
.hc-foot { font-size: 11px; color: var(--hc-muted); text-align: center; padding: 0 12px 10px; background: #fff; }
.hc-demo-note { position: fixed; left: 12px; bottom: 8px; z-index: 99990; font: 11px system-ui, Arial, sans-serif; color: #fff;
  background: rgba(115, 37, 21, .88); padding: 4px 8px; border-radius: 6px; pointer-events: none; }
/* Site's mobile menu (UIkit offcanvas) is open -> launcher out of the way. */
html.uk-offcanvas-page .hc-launcher, html.uk-offcanvas-page .hc-teaser { display: none; }
/* Tablet: panel a bit narrower than the screen. */
@media (max-width: 900px) {
  .hc-panel { height: min(640px, calc(100dvh - 40px)); }
}
/* Phone: full-screen chat that follows the keyboard (dvh), respects notch / home bar, no iOS zoom on focus. */
@media (max-width: 520px) {
  .hc-panel { inset: 0; right: 0; bottom: 0; width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: none;
    border-radius: 0; transform: translateY(100%); }
  .hc-panel.hc-open { transform: none; }
  .hc-backdrop { display: none; }
  .hc-head { padding-top: calc(10px + env(safe-area-inset-top)); }
  .hc-head .hc-logo { height: 26px; }
  .hc-head .hc-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hc-head .hc-close { font-size: 30px; padding: 4px 10px; }
  .hc-msgs { padding: 12px; overscroll-behavior: contain; }
  .hc-msg { max-width: 92%; }
  .hc-form { padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); }
  .hc-form textarea { font-size: 16px; }   /* <16px makes iOS Safari zoom the page */
  .hc-foot { display: none; }
  .hc-launcher { right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); padding: 14px 20px 14px 16px; font-size: 16px; }
  .hc-launcher svg { width: 25px; height: 25px; }
  .hc-teaser { right: 14px; bottom: calc(84px + env(safe-area-inset-bottom)); max-width: calc(100vw - 28px); }
  .hc-demo-note { display: none; }
}
/* Very small phones: icon-only launcher. */
@media (max-width: 340px) {
  .hc-launcher span { display: none; }
  .hc-launcher { padding: 16px; }
}
/* Page must not scroll behind the full-screen chat on phones. */
html.hc-lock, html.hc-lock body { overflow: hidden; }
