/* PCenter Assist: local navigation, visually aligned with the institutional site. */
#pcenter-assist-root {
  --pca-navy: #071a2a;
  --pca-cyan: #25b9f4;
  --pca-ink: #071c2c;
  --pca-muted: #5a6a77;
  --pca-line: #dce4e9;
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 80;
  color: var(--pca-ink);
  font-family: Manrope, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

#pcenter-assist-root *,
#pcenter-assist-root *::before,
#pcenter-assist-root *::after { box-sizing: border-box; }
#pcenter-assist-root [hidden] { display: none !important; }
#pcenter-assist-root button,
#pcenter-assist-root input { font: inherit; }
#pcenter-assist-root button { cursor: pointer; }
#pcenter-assist-root svg {
  display: block;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#pcenter-assist-root :focus-visible { outline: 3px solid var(--pca-cyan); outline-offset: 3px; }

.pca-launcher {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 17px;
  border: 1px solid #ffffff38;
  border-radius: 8px;
  color: #fff;
  background: var(--pca-navy);
  box-shadow: 0 8px 30px #04131f30;
  transition: background .2s, transform .2s;
}
.pca-launcher:hover { background: #0d314c; transform: translateY(-2px); }
.pca-launcher[aria-expanded="true"] { background: #0d314c; }
.pca-launcher-label { font-size: .875rem; font-weight: 700; }

.pca-panel {
  position: absolute;
  right: 0;
  bottom: 68px;
  display: flex;
  flex-direction: column;
  width: min(410px, calc(100vw - 32px));
  max-height: min(680px, calc(100dvh - 116px));
  overflow: hidden;
  border: 1px solid var(--pca-line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 70px #04131f33;
}
.pca-panel.is-open { animation: pca-open .18s ease-out; }
@keyframes pca-open { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

#pcenter-assist-root .pca-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex: 0 0 auto;
  margin: 0;
  padding: 19px 18px;
  border-bottom: 1px solid #ffffff20;
  color: #fff;
  background: var(--pca-navy);
}
.pca-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.pca-brand-mark { display: grid; place-items: center; width: 38px; height: 38px; color: var(--pca-cyan); }
.pca-brand-mark svg { stroke-width: 2.8 !important; }
#pcenter-assist-root .pca-brand-text h2 { margin: 0; font-size: 1rem; line-height: 1.4; font-weight: 700; letter-spacing: -.02em; }
#pcenter-assist-root .pca-brand-text p { margin: 3px 0 0; font-size: .8125rem; line-height: 1.4; color: #bcced9; }
.pca-close { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; padding: 8px; border: 1px solid #ffffff25; border-radius: 6px; color: #fff; background: transparent; }
.pca-close:hover { background: #ffffff12; }

.pca-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px 18px; background: #fff; scrollbar-width: thin; scrollbar-color: #b4c5d0 #f1f6f8; }
#pcenter-assist-root .pca-msg { max-width: 94%; margin: 0 0 10px; padding: 12px 14px; border-radius: 8px; font-size: .9375rem; line-height: 1.6; overflow-wrap: anywhere; }
.pca-msg.bot { color: var(--pca-ink); background: #f1f6f8; }
#pcenter-assist-root .pca-msg.user { margin-left: auto; color: #fff; background: var(--pca-navy); }
.pca-mode { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 15px 0; }
.pca-mode button { min-height: 46px; padding: 10px; border: 1px solid #9ac8e2; border-radius: 5px; font-size: .875rem !important; line-height: 1.4; font-weight: 700 !important; color: var(--pca-ink); background: #f6fbfe; }
.pca-mode button:hover { border-color: #007dc7; background: #eaf7fd; }
.pca-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }
.pca-chip { min-height: 40px; padding: 8px 11px; border: 1px solid var(--pca-line); border-radius: 5px; font-size: .875rem !important; line-height: 1.4; font-weight: 600 !important; color: #294653; background: #fff; }
.pca-chip:hover { border-color: #007dc7; color: #006ba8; background: #f5fbfe; }
.pca-result { margin-top: 12px; padding: 16px; border: 1px solid var(--pca-line); border-left: 3px solid var(--pca-cyan); border-radius: 6px; background: #fff; }
#pcenter-assist-root .pca-result h3 { margin: 0 0 7px; font-size: 1rem; line-height: 1.4; letter-spacing: -.02em; font-weight: 700; color: var(--pca-ink); }
#pcenter-assist-root .pca-result p { margin: 0; font-size: .875rem; line-height: 1.65; color: var(--pca-muted); }
.pca-result a { display: inline-flex; margin-top: 12px; padding: 3px 0; border-bottom: 1px solid #007dc7; font-size: .875rem; line-height: 1.4; color: #006fae; font-weight: 700; text-decoration: none; }
.pca-result a:hover { color: var(--pca-ink); border-color: currentColor; }

.pca-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; flex: 0 0 auto; margin: 0; padding: 14px 16px; border-top: 1px solid var(--pca-line); background: #fff; }
.pca-input input { width: 100%; min-width: 0; min-height: 46px; padding: 11px 12px; border: 1px solid #bdcbd5; border-radius: 5px; color: var(--pca-ink); background: #fff; font-size: 1rem !important; line-height: 1.4; }
.pca-input input::placeholder { color: #6b7b87; }
.pca-send { min-height: 46px; padding: 10px 13px; border: 1px solid transparent; border-radius: 5px; color: #fff; background: #007dc7; font-size: .875rem !important; font-weight: 700 !important; }
.pca-send:hover { background: #006aab; }
#pcenter-assist-root .pca-note { flex: 0 0 auto; margin: 0; padding: 0 17px 14px; font-size: .75rem; line-height: 1.5; color: #657786; text-align: center; background: #fff; }
.pca-sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

/* Keep the existing page-top control clear of the assistant launcher. */
body.has-pcenter-assist .back-top { bottom: 90px; }

@media (max-width: 540px) {
  #pcenter-assist-root { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); }
  .pca-launcher { width: 52px; min-height: 52px; padding: 12px; }
  .pca-launcher-label { display: none; }
  .pca-panel { position: fixed; left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); width: auto; max-height: calc(100dvh - 100px - env(safe-area-inset-bottom)); }
  #pcenter-assist-root .pca-head { padding: 15px; }
  .pca-body { padding: 16px 14px; }
  .pca-input { padding: 12px; }
  body.has-pcenter-assist .back-top { bottom: calc(78px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  #pcenter-assist-root *, #pcenter-assist-root *::before, #pcenter-assist-root *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
