/* UBCC chat assistant. Floating widget, bottom right on every page.
   Markup is injected by assets/js/chat.js; type and neutrals come from the tokens in styles.css.
   Every gradient uses the UBCC brand gradient only: --p-500 (#E14F27) to --gold-500 (#F8A31B).
   Sits at z-index 65: above page content and the social bar (45), below the nav scrims (70+). */
.ubcc-chat{--uc-grad:linear-gradient(135deg,var(--p-500) 0%,var(--gold-500) 100%);position:fixed;right:20px;bottom:20px;z-index:65;font-family:var(--sans);color:var(--ink);font-size:16px;line-height:1.5;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent}
.ubcc-chat *,.ubcc-chat *::before,.ubcc-chat *::after{box-sizing:border-box}

/* Keyboard focus only. The global :focus-visible rule squares off round controls, so restore their shape. */
.ubcc-chat button:focus-visible,.ubcc-chat a:focus-visible{outline:2px solid var(--p-600);outline-offset:3px}
.ubcc-chat__head button:focus-visible{outline-color:#fff;outline-offset:2px}
.ubcc-chat .ubcc-chat__btn:focus-visible,.ubcc-chat .ubcc-chat__send:focus-visible,.ubcc-chat .ubcc-chat__hbtn:focus-visible,.ubcc-chat .ubcc-chat__nudge-x:focus-visible{border-radius:50%}
.ubcc-chat .ubcc-chat__chip:focus-visible,.ubcc-chat .ubcc-chat__retry:focus-visible{border-radius:999px}

/* ---- Launcher ---- */
.ubcc-chat__btn{position:relative;width:60px;height:60px;border-radius:50%;border:0;padding:0;cursor:pointer;background:var(--uc-grad);color:#fff;display:grid;place-items:center;box-shadow:0 16px 32px -10px rgba(225,79,39,.6),0 0 0 6px rgba(248,163,27,.16);transition:transform .26s cubic-bezier(.2,.7,.2,1),box-shadow .26s ease}
.ubcc-chat__btn:hover{transform:translateY(-2px) scale(1.04);box-shadow:0 20px 38px -10px rgba(225,79,39,.62),0 0 0 9px rgba(248,163,27,.2)}
.ubcc-chat__btn:active{transform:scale(.96)}
.ubcc-chat__btn svg{width:27px;height:27px;grid-area:1/1;filter:drop-shadow(0 1px 1.5px rgba(110,30,8,.35));transition:opacity .18s,transform .24s cubic-bezier(.2,.7,.2,1)}
.ubcc-chat__btn .i-x{opacity:0;transform:rotate(-90deg) scale(.6)}
.ubcc-chat.is-open .ubcc-chat__btn .i-chat{opacity:0;transform:rotate(90deg) scale(.6)}
.ubcc-chat.is-open .ubcc-chat__btn .i-x{opacity:1;transform:none}
.ubcc-chat__badge{position:absolute;top:0;right:0;width:15px;height:15px;border-radius:50%;background:var(--ink);border:2px solid #fff;display:none}
.ubcc-chat.has-unread:not(.is-open) .ubcc-chat__badge{display:block}

/* ---- First-visit nudge ---- */
.ubcc-chat__nudge{position:absolute;right:76px;bottom:8px;width:max-content;max-width:min(270px,calc(100vw - 134px));background:#fff;color:var(--ink);border:1px solid rgba(28,28,28,.06);border-radius:18px 18px 4px 18px;box-shadow:0 22px 44px -18px rgba(28,28,28,.34),0 6px 14px -8px rgba(28,28,28,.16);padding:13px 40px 13px 16px;font-size:.88rem;line-height:1.42;text-align:left;cursor:pointer;opacity:0;transform:translateY(8px) scale(.97);transform-origin:bottom right;pointer-events:none;transition:opacity .28s ease,transform .32s cubic-bezier(.2,.7,.2,1)}
.ubcc-chat.has-nudge:not(.is-open) .ubcc-chat__nudge{opacity:1;transform:none;pointer-events:auto}
.ubcc-chat__nudge strong{display:block;font-weight:700;margin-bottom:1px}
.ubcc-chat__nudge-x{position:absolute;top:7px;right:7px;width:26px;height:26px;border:0;padding:0;border-radius:50%;background:transparent;color:var(--text-faint);cursor:pointer;display:grid;place-items:center;transition:background .15s,color .15s}
.ubcc-chat__nudge-x:hover{background:var(--sand-100);color:var(--ink)}
.ubcc-chat__nudge-x svg{width:14px;height:14px}

/* ---- Panel ---- */
.ubcc-chat__panel{position:absolute;right:0;bottom:80px;width:392px;max-width:calc(100vw - 40px);height:min(660px,calc(100vh - 124px));height:min(660px,calc(100dvh - 124px));background:#fff;border:0;border-radius:28px;box-shadow:0 0 0 1px rgba(28,28,28,.05),0 44px 90px -28px rgba(28,28,28,.42),0 18px 38px -18px rgba(225,79,39,.3);display:flex;flex-direction:column;overflow:hidden;opacity:0;visibility:hidden;transform:translateY(16px) scale(.96);transform-origin:bottom right;transition:opacity .24s ease,transform .32s cubic-bezier(.2,.8,.2,1),visibility 0s linear .32s}
.ubcc-chat.is-open .ubcc-chat__panel{opacity:1;visibility:visible;transform:none;transition-delay:0s}
.ubcc-chat--instant .ubcc-chat__panel,.ubcc-chat--instant .ubcc-chat__btn svg{transition:none!important}

/* Header: brand gradient, two tiers (identity row + status band) and a soft wave edge */
.ubcc-chat__head{position:relative;flex:none;display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;grid-template-areas:"av title reset close" "status status status status";align-items:center;padding:18px 14px 0 18px;color:#fff;background:linear-gradient(105deg,var(--p-500) 0%,66%,var(--gold-500) 100%);-webkit-mask:linear-gradient(#000,#000) top/100% calc(100% - 22px) no-repeat,url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 380 24' preserveAspectRatio='none'%3E%3Cpath d='M0 0H380 V11.19 L376.0 10.76 L372.0 10.34 L368.0 9.93 L364.0 9.53 L360.0 9.14 L356.0 8.76 L352.0 8.39 L348.0 8.04 L344.0 7.71 L340.0 7.40 L336.0 7.10 L332.0 6.83 L328.0 6.58 L324.0 6.36 L320.0 6.16 L316.0 5.98 L312.0 5.83 L308.0 5.71 L304.0 5.62 L300.0 5.55 L296.0 5.51 L292.0 5.50 L288.0 5.52 L284.0 5.57 L280.0 5.64 L276.0 5.74 L272.0 5.87 L268.0 6.03 L264.0 6.21 L260.0 6.42 L256.0 6.65 L252.0 6.91 L248.0 7.19 L244.0 7.49 L240.0 7.81 L236.0 8.14 L232.0 8.50 L228.0 8.87 L224.0 9.25 L220.0 9.65 L216.0 10.05 L212.0 10.47 L208.0 10.89 L204.0 11.31 L200.0 11.74 L196.0 12.17 L192.0 12.60 L188.0 13.03 L184.0 13.45 L180.0 13.86 L176.0 14.27 L172.0 14.67 L168.0 15.06 L164.0 15.43 L160.0 15.79 L156.0 16.13 L152.0 16.45 L148.0 16.75 L144.0 17.04 L140.0 17.30 L136.0 17.53 L132.0 17.75 L128.0 17.94 L124.0 18.10 L120.0 18.23 L116.0 18.34 L112.0 18.42 L108.0 18.47 L104.0 18.50 L100.0 18.49 L96.0 18.46 L92.0 18.40 L88.0 18.31 L84.0 18.20 L80.0 18.05 L76.0 17.88 L72.0 17.69 L68.0 17.46 L64.0 17.22 L60.0 16.95 L56.0 16.66 L52.0 16.35 L48.0 16.03 L44.0 15.68 L40.0 15.32 L36.0 14.94 L32.0 14.55 L28.0 14.15 L24.0 13.74 L20.0 13.32 L16.0 12.90 L12.0 12.47 L8.0 12.04 L4.0 11.61 L0.0 11.19 Z' fill='%23000'/%3E%3C/svg%3E") bottom/100% 24px no-repeat;mask:linear-gradient(#000,#000) top/100% calc(100% - 22px) no-repeat,url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 380 24' preserveAspectRatio='none'%3E%3Cpath d='M0 0H380 V11.19 L376.0 10.76 L372.0 10.34 L368.0 9.93 L364.0 9.53 L360.0 9.14 L356.0 8.76 L352.0 8.39 L348.0 8.04 L344.0 7.71 L340.0 7.40 L336.0 7.10 L332.0 6.83 L328.0 6.58 L324.0 6.36 L320.0 6.16 L316.0 5.98 L312.0 5.83 L308.0 5.71 L304.0 5.62 L300.0 5.55 L296.0 5.51 L292.0 5.50 L288.0 5.52 L284.0 5.57 L280.0 5.64 L276.0 5.74 L272.0 5.87 L268.0 6.03 L264.0 6.21 L260.0 6.42 L256.0 6.65 L252.0 6.91 L248.0 7.19 L244.0 7.49 L240.0 7.81 L236.0 8.14 L232.0 8.50 L228.0 8.87 L224.0 9.25 L220.0 9.65 L216.0 10.05 L212.0 10.47 L208.0 10.89 L204.0 11.31 L200.0 11.74 L196.0 12.17 L192.0 12.60 L188.0 13.03 L184.0 13.45 L180.0 13.86 L176.0 14.27 L172.0 14.67 L168.0 15.06 L164.0 15.43 L160.0 15.79 L156.0 16.13 L152.0 16.45 L148.0 16.75 L144.0 17.04 L140.0 17.30 L136.0 17.53 L132.0 17.75 L128.0 17.94 L124.0 18.10 L120.0 18.23 L116.0 18.34 L112.0 18.42 L108.0 18.47 L104.0 18.50 L100.0 18.49 L96.0 18.46 L92.0 18.40 L88.0 18.31 L84.0 18.20 L80.0 18.05 L76.0 17.88 L72.0 17.69 L68.0 17.46 L64.0 17.22 L60.0 16.95 L56.0 16.66 L52.0 16.35 L48.0 16.03 L44.0 15.68 L40.0 15.32 L36.0 14.94 L32.0 14.55 L28.0 14.15 L24.0 13.74 L20.0 13.32 L16.0 12.90 L12.0 12.47 L8.0 12.04 L4.0 11.61 L0.0 11.19 Z' fill='%23000'/%3E%3C/svg%3E") bottom/100% 24px no-repeat}
.ubcc-chat__avatar{grid-area:av;width:46px;height:46px;margin-right:12px;border-radius:50%;background:#fff;display:grid;place-items:center;box-shadow:0 0 0 3px rgba(255,255,255,.3),0 10px 20px -8px rgba(110,30,8,.5)}
.ubcc-chat__avatar svg{width:23px;height:23px;color:var(--p-500)}
.ubcc-chat__hd{display:contents}
.ubcc-chat__title{grid-area:title;font-family:var(--head);font-weight:700;font-size:1.2rem;letter-spacing:.005em;line-height:1.2;color:#fff;margin:0;text-shadow:0 1px 2px rgba(110,30,8,.3)}
.ubcc-chat__sub{grid-area:status;margin:16px -14px 0 -18px;padding:11px 18px 30px;background:linear-gradient(90deg,rgba(28,28,28,.24) 0%,rgba(28,28,28,.16) 50%,rgba(28,28,28,0) 100%);font-size:.78rem;font-weight:600;letter-spacing:.01em;line-height:1.3;color:#fff;display:flex;align-items:center;gap:8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-shadow:0 1px 1px rgba(110,30,8,.3)}
.ubcc-chat__sub::before{content:"";flex:none;width:8px;height:8px;border-radius:50%;background:#5BC98F;box-shadow:0 0 0 3px rgba(255,255,255,.3)}
.ubcc-chat__hbtn{width:34px;height:34px;border-radius:50%;border:0;padding:0;background:rgba(28,28,28,.16);box-shadow:inset 0 0 0 1px rgba(255,255,255,.3);color:#fff;cursor:pointer;display:grid;place-items:center;flex:none;transition:background .16s,transform .16s}
.ubcc-chat__hbtn:hover{background:rgba(28,28,28,.28)}
.ubcc-chat__hbtn:active{transform:scale(.94)}
.ubcc-chat__hbtn svg{width:17px;height:17px}
.ubcc-chat__reset{grid-area:reset;margin-left:8px}
.ubcc-chat__close{grid-area:close;margin-left:6px;display:none}

/* Message log */
.ubcc-chat__log{flex:1 1 auto;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:18px 18px 14px;display:flex;flex-direction:column;gap:12px;background:#fff;scrollbar-width:thin;scrollbar-color:rgba(28,28,28,.16) transparent;-webkit-mask-image:linear-gradient(to bottom,transparent 0,#000 16px);mask-image:linear-gradient(to bottom,transparent 0,#000 16px)}
.ubcc-chat__log::-webkit-scrollbar{width:6px}
.ubcc-chat__log::-webkit-scrollbar-thumb{background:rgba(28,28,28,.16);border-radius:6px}
.ubcc-chat__msg{max-width:86%;display:flex;flex-direction:column;gap:6px;animation:ubccIn .3s cubic-bezier(.2,.7,.2,1)}
.ubcc-chat__msg--bot{align-self:flex-start}
.ubcc-chat__msg--user{align-self:flex-end}
.ubcc-chat__bubble{padding:11px 16px;border-radius:20px;font-size:.92rem;line-height:1.5;overflow-wrap:anywhere;word-break:break-word}
.ubcc-chat__msg--bot .ubcc-chat__bubble{background:var(--sand-100);color:var(--ink);border-bottom-left-radius:6px}
.ubcc-chat__msg--user .ubcc-chat__bubble{background:linear-gradient(115deg,var(--p-500) 0%,var(--p-500) 38%,var(--gold-500) 190%);color:#fff;font-weight:500;border-bottom-right-radius:6px;white-space:pre-wrap;box-shadow:0 12px 20px -12px rgba(225,79,39,.6);text-shadow:0 1px 1px rgba(110,30,8,.22)}
.ubcc-chat__msg--error .ubcc-chat__bubble{background:var(--crit-bg);border:1px solid #EBC9C3;color:var(--crit)}
.ubcc-chat__bubble p{margin:0 0 .65em}
.ubcc-chat__bubble p:last-child{margin-bottom:0}
.ubcc-chat__bubble ul,.ubcc-chat__bubble ol{margin:0 0 .65em;padding-left:1.3em}
.ubcc-chat__bubble ul:last-child,.ubcc-chat__bubble ol:last-child{margin-bottom:0}
.ubcc-chat__bubble li{margin:.18em 0}
.ubcc-chat__bubble li::marker{color:var(--p-500)}
.ubcc-chat__bubble a{color:var(--accent-ink);text-decoration:underline;text-underline-offset:2px;text-decoration-color:rgba(165,52,21,.4)}
.ubcc-chat__bubble a:hover{text-decoration-color:currentColor}
.ubcc-chat__msg--user .ubcc-chat__bubble a{color:#fff}
.ubcc-chat__bubble strong{font-weight:700;color:var(--ink)}
.ubcc-chat__msg--user .ubcc-chat__bubble strong{color:inherit}
.ubcc-chat__msg--error .ubcc-chat__bubble strong{color:inherit}
.ubcc-chat__bubble code{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:.86em;background:#fff;border-radius:5px;padding:1px 5px}
.ubcc-chat__retry{font-family:var(--sans);font-size:.8rem;font-weight:700;color:var(--crit);background:transparent;border:1px solid currentColor;border-radius:var(--r-pill);padding:4px 11px;cursor:pointer;margin-top:8px;display:inline-block}
.ubcc-chat__retry:hover{background:#fff}

/* Streaming indicator */
.ubcc-chat__typing{display:inline-flex;gap:5px;align-items:center;height:1.4em;padding:0 2px}
.ubcc-chat__typing i{width:7px;height:7px;border-radius:50%;background:var(--p-500);animation:ubccDot 1.2s infinite ease-in-out}
.ubcc-chat__typing i:nth-child(2){animation-delay:.15s}
.ubcc-chat__typing i:nth-child(3){animation-delay:.3s}

/* Sources (only real URLs are shown) */
.ubcc-chat__src{display:flex;flex-wrap:wrap;gap:6px;padding-left:2px}
.ubcc-chat__src a{font-size:.72rem;font-weight:600;color:var(--n-600);background:#fff;border:1px solid var(--sand-200);border-radius:var(--r-pill);padding:4px 11px;text-decoration:none;max-width:230px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition:border-color .15s,color .15s}
.ubcc-chat__src a:hover{color:var(--p-700);border-color:var(--p-300)}

/* Suggested questions: brand gradient outline pills */
.ubcc-chat__chips{display:flex;flex-wrap:wrap;gap:9px;padding:2px 0 4px;max-width:96%;animation:ubccIn .3s cubic-bezier(.2,.7,.2,1) .08s both}
.ubcc-chat__chip{font-family:var(--sans);font-size:.82rem;font-weight:600;line-height:1.25;color:var(--p-700);border:1.5px solid transparent;border-radius:999px;padding:8px 14px;cursor:pointer;text-align:left;background:linear-gradient(#fff,#fff) padding-box,linear-gradient(100deg,var(--p-500),var(--gold-500)) border-box;box-shadow:0 8px 16px -12px rgba(225,79,39,.55);transition:transform .16s ease,box-shadow .2s ease}
.ubcc-chat__chip:hover{background:linear-gradient(100deg,var(--p-50),#FEF6E8) padding-box,linear-gradient(100deg,var(--p-500),var(--gold-500)) border-box;transform:translateY(-1px);box-shadow:0 12px 20px -12px rgba(225,79,39,.65)}
.ubcc-chat__chip:active{transform:translateY(0) scale(.98)}

/* Composer: floating pill, no inner focus rectangle */
.ubcc-chat__foot{position:relative;flex:none;background:#fff;border:0;padding:8px 16px 14px}
.ubcc-chat__foot::before{content:"";position:absolute;left:0;right:0;top:-16px;height:16px;background:linear-gradient(to top,#fff,rgba(255,255,255,0));pointer-events:none}
.ubcc-chat__form{position:relative;display:flex;align-items:flex-end;gap:10px;background:#fff;border:1px solid rgba(28,28,28,.08);border-radius:28px;padding:6px 6px 6px 20px;box-shadow:0 14px 28px -16px rgba(28,28,28,.3),0 2px 6px -2px rgba(28,28,28,.08);transition:border-color .2s ease,box-shadow .2s ease}
.ubcc-chat__form:hover{border-color:rgba(28,28,28,.14)}
.ubcc-chat__form:focus-within,.ubcc-chat__form:focus-within:hover{border-color:transparent;box-shadow:0 0 0 1.5px var(--p-500),0 16px 30px -16px rgba(225,79,39,.55),0 2px 6px -2px rgba(28,28,28,.08)}
@supports ((-webkit-mask-composite:xor) or (mask-composite:exclude)){
  .ubcc-chat__form::before{content:"";position:absolute;inset:-1px;border-radius:inherit;padding:1.5px;background:var(--uc-grad);-webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);mask-composite:exclude;opacity:0;transition:opacity .22s ease;pointer-events:none}
  .ubcc-chat__form:focus-within::before{opacity:1}
  .ubcc-chat__form:focus-within,.ubcc-chat__form:focus-within:hover{box-shadow:0 16px 30px -16px rgba(225,79,39,.55),0 2px 6px -2px rgba(28,28,28,.08)}
}
.ubcc-chat__input{flex:1 1 auto;min-width:0;border:0;background:transparent;resize:none;font-family:var(--sans);font-size:.95rem;line-height:1.45;color:var(--ink);padding:10px 0;margin:0;max-height:120px;outline:none;box-shadow:none;-webkit-appearance:none;appearance:none;display:block}
.ubcc-chat .ubcc-chat__input:focus,.ubcc-chat .ubcc-chat__input:focus-visible{outline:0!important;outline-offset:0!important;box-shadow:none!important;border:0!important;border-radius:0!important;background:transparent!important}
.ubcc-chat__input::placeholder{color:var(--n-500);opacity:1}
.ubcc-chat__send{width:42px;height:42px;border-radius:50%;border:0;padding:0;background:var(--uc-grad);color:#fff;cursor:pointer;display:grid;place-items:center;flex:none;box-shadow:0 10px 18px -8px rgba(225,79,39,.6);transition:transform .16s ease,box-shadow .2s ease,filter .16s}
.ubcc-chat__send:hover{filter:saturate(1.08);box-shadow:0 14px 22px -8px rgba(225,79,39,.65);transform:translateY(-1px)}
.ubcc-chat__send:active{transform:scale(.94)}
.ubcc-chat__send:disabled{background:var(--sand-100);color:var(--sand-400);box-shadow:none;filter:none;cursor:default;transform:none}
.ubcc-chat__send svg{width:18px;height:18px;grid-area:1/1;filter:drop-shadow(0 1px 1px rgba(110,30,8,.3))}
.ubcc-chat__send:disabled svg{filter:none}
.ubcc-chat__send .i-send{transform:rotate(90deg);transition:transform .2s cubic-bezier(.2,.7,.2,1)}
.ubcc-chat__send:not(:disabled):hover .i-send{transform:rotate(90deg) translateY(-2px)}
.ubcc-chat__send .i-stop{display:none}
.ubcc-chat.is-busy .ubcc-chat__send .i-send{display:none}
.ubcc-chat.is-busy .ubcc-chat__send .i-stop{display:block}
.ubcc-chat.is-busy .ubcc-chat__send{background:var(--ink)}
.ubcc-chat__note{font-size:.72rem;color:var(--n-500);text-align:center;margin:11px 0 0;line-height:1.4}
.ubcc-chat__note a{color:inherit;text-decoration:underline;text-underline-offset:2px}
.ubcc-chat__note a:hover{color:var(--accent-ink)}

/* Index page: tuck the social bar away while the panel is open so they don't overlap */
html.ubcc-chat-open .socialbar{opacity:0;pointer-events:none;transform:translate(16px,-50%);transition:opacity .2s ease,transform .2s ease}

/* ---- Phones: full-screen sheet ---- */
@media(max-width:520px){
  .ubcc-chat{right:16px;bottom:16px}
  .ubcc-chat__panel{position:fixed;inset:0;width:auto;max-width:none;height:auto;border-radius:0;border:0;box-shadow:none;transform:translateY(28px)}
  .ubcc-chat.is-open .ubcc-chat__panel{transform:none}
  .ubcc-chat.is-open .ubcc-chat__btn{display:none}
  .ubcc-chat__close{display:grid}
  .ubcc-chat__head{padding-top:calc(18px + env(safe-area-inset-top,0px))}
  .ubcc-chat__foot{padding-bottom:calc(12px + env(safe-area-inset-bottom,0px))}
  .ubcc-chat__msg{max-width:92%}
  .ubcc-chat__chips{max-width:100%}
  .ubcc-chat__input{font-size:16px} /* 16px stops iOS zooming the page on focus */
  html.ubcc-chat-lock,html.ubcc-chat-lock body{overflow:hidden}
}

@keyframes ubccIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
@keyframes ubccDot{0%,80%,100%{transform:translateY(0);opacity:.4}40%{transform:translateY(-4px);opacity:1}}
@media(prefers-reduced-motion:reduce){
  .ubcc-chat *,.ubcc-chat *::before,.ubcc-chat *::after{transition:none!important;animation:none!important}
  .ubcc-chat__typing i{opacity:.7}
}
@media print{.ubcc-chat{display:none}}
