#portfolio-chatbot { font-family: inherit; color: #e7f0fb; direction: ltr; }
#portfolio-chatbot .pc-message, #portfolio-chatbot .pc-form textarea { unicode-bidi: plaintext; }
#portfolio-chatbot * { box-sizing: border-box; }
#portfolio-chatbot button:focus-visible { outline: 2px solid #9bd8ff; outline-offset: 3px; }

/* Launcher: the robot itself is the closed-state button. */
#portfolio-chatbot .pc-launcher {
  position: fixed; z-index: 9998; right: 18px; bottom: 14px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 112px; height: 126px; padding: 0; gap: 0;
  border: 0; border-radius: 0; background: transparent; box-shadow: none;
  color: #eaf6ff; font: inherit; font-size: 0; cursor: pointer; overflow: visible;
  transition: transform .18s ease;
}
#portfolio-chatbot .pc-launcher:hover { transform: translateY(-4px); }
#portfolio-chatbot .pc-launcher:focus-visible { outline: 2px solid #9bd8ff; outline-offset: 0; border-radius: 24px; }
#portfolio-chatbot .pc-launcher[hidden] { display: none; }
#portfolio-chatbot .pc-launcher .pc-avatar { flex: 0 0 108px; width: 108px; min-width: 108px; height: 120px; margin: 0; }
#portfolio-chatbot .pc-launcher .pc-robot { filter: drop-shadow(0 8px 9px #0006); }
#portfolio-chatbot .pc-launcher-label { display: none; }

/* Panel */
#portfolio-chatbot .pc-panel { position: fixed; z-index: 9999; right: 22px; bottom: 82px; width: min(410px, calc(100vw - 28px)); height: min(620px, calc(100vh - 112px)); display: flex; flex-direction: column; overflow: hidden; border: 1px solid #31445f; border-radius: 18px; background: #0f192a; box-shadow: 0 22px 64px rgba(0,0,0,.38); transform-origin: bottom right; animation: pc-open .22s ease-out; }
#portfolio-chatbot .pc-panel[hidden] { display: none; }
#portfolio-chatbot .pc-panel.pc-closing { animation: pc-close .32s ease-in forwards; }
#portfolio-chatbot .pc-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 15px; border-bottom: 1px solid #2a3c55; background: #15233a; }
#portfolio-chatbot .pc-header strong { color: #f4f7fb; font-size: 1rem; }
#portfolio-chatbot .pc-header small { display: block; margin-top: 4px; color: #b1bfd1; font-size: 12px; }
#portfolio-chatbot .pc-close { flex: none; border: 0; border-radius: 7px; padding: 0 6px; background: transparent; color: #eef3fb; font-size: 28px; line-height: 1.2; cursor: pointer; }
#portfolio-chatbot .pc-close:hover { background: #243650; }
#portfolio-chatbot .pc-messages { flex: 1; min-height: 0; min-width: 0; overflow-y: auto; padding: 15px 13px; scroll-behavior: smooth; }

/* Messages. Assistant rows: robot in its own column, reply beside it. */
#portfolio-chatbot .pc-welcome,
#portfolio-chatbot .pc-bot-row { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: end; gap: 10px; width: 100%; min-width: 0; margin: 0 0 14px; }
#portfolio-chatbot .pc-welcome .pc-avatar,
#portfolio-chatbot .pc-bot-row .pc-avatar { position: relative; z-index: 1; grid-column: 1; align-self: end; display: flex; width: 58px; min-width: 58px; height: 68px; margin: 0; overflow: visible; }
#portfolio-chatbot .pc-welcome .pc-message,
#portfolio-chatbot .pc-bot-row .pc-message { position: relative; z-index: 2; grid-column: 2; width: 100%; min-width: 0; max-width: 100%; margin: 0; }
#portfolio-chatbot .pc-message { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0 0 10px; padding: 11px 12px; border-radius: 13px; line-height: 1.5; font-size: .94rem; }
#portfolio-chatbot .pc-bot { background: #1b2a40; color: #edf4fc; border-bottom-left-radius: 5px; }
#portfolio-chatbot .pc-user-row { display: flex; justify-content: flex-end; margin: 0 0 12px; }
#portfolio-chatbot .pc-user { max-width: 86%; margin: 0; background: #d4edff; color: #102033; border-bottom-right-radius: 5px; }
#portfolio-chatbot .pc-suggestions { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px 68px; }
#portfolio-chatbot .pc-suggestions button { border: 1px solid #3b5877; border-radius: 999px; padding: 7px 10px; background: #14243a; color: #c9e8ff; font: inherit; font-size: 11px; cursor: pointer; transition: background .16s ease, border-color .16s ease; }
#portfolio-chatbot .pc-suggestions button:hover { background: #203b59; border-color: #8bcfff; }
#portfolio-chatbot .pc-sources { color: #a8b9cf; font-size: 11px; margin: -4px 0 12px 68px; overflow-wrap: anywhere; }
#portfolio-chatbot .pc-message p { margin: 0 0 .75em; }
#portfolio-chatbot .pc-message p:last-child { margin-bottom: 0; }
#portfolio-chatbot .pc-message a { color: #9bd8ff; text-decoration: underline; text-underline-offset: 2px; overflow-wrap: anywhere; }
#portfolio-chatbot .pc-user a { color: #075985; }
#portfolio-chatbot .pc-message ul, #portfolio-chatbot .pc-message ol { margin: .35em 0 .75em; padding-left: 1.4em; }
#portfolio-chatbot .pc-message code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .92em; overflow-wrap: anywhere; }

/* Input */
#portfolio-chatbot .pc-form { display: flex; align-items: stretch; gap: 8px; padding: 12px; border-top: 1px solid #2a3c55; }
#portfolio-chatbot .pc-form textarea { min-width: 0; flex: 1; resize: vertical; border: 1px solid #3b506c; border-radius: 10px; padding: 10px; background: #0b1422; color: #f4f7fb; font: inherit; }
#portfolio-chatbot .pc-form textarea::placeholder { color: #8999ad; }
#portfolio-chatbot .pc-form textarea:focus-visible { outline: 2px solid #9bd8ff; outline-offset: 2px; }
#portfolio-chatbot .pc-form button { border: 0; border-radius: 10px; padding: 0 15px; background: #9bd8ff; color: #0b1726; font-weight: 700; cursor: pointer; }
#portfolio-chatbot .pc-form button:hover:not(:disabled) { background: #c0e7ff; }
#portfolio-chatbot .pc-form button:disabled { opacity: .55; cursor: wait; }
#portfolio-chatbot .pc-disclaimer { margin: 0; padding: 0 12px 10px; color: #aab9cb; font-size: 10px; line-height: 1.5; }
#portfolio-chatbot .pc-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Robot: inline SVG animated with CSS only. */
#portfolio-chatbot .pc-avatar { display: inline-flex; flex: none; align-items: center; justify-content: center; }
#portfolio-chatbot .pc-robot { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 3px 4px #0003); animation: pc-float 3s ease-in-out infinite; }
#portfolio-chatbot .pc-head, #portfolio-chatbot .pc-body { fill: #d9e8f5; stroke: #7894b2; stroke-width: 1.4; }
#portfolio-chatbot .pc-face { fill: #152b45; stroke: #6f8eaf; stroke-width: 1; }
#portfolio-chatbot .pc-ear { fill: #9bd8ff; stroke: #6f8eaf; stroke-width: 1; }
#portfolio-chatbot .pc-eye { fill: #75e8ff; filter: drop-shadow(0 0 2px #45dfff); transform-box: fill-box; transform-origin: center; }
#portfolio-chatbot .pc-mouth { fill: none; stroke: #75e8ff; stroke-width: 2.5; stroke-linecap: round; }
#portfolio-chatbot .pc-neck, #portfolio-chatbot .pc-antenna, #portfolio-chatbot .pc-arm { fill: none; stroke: #a9c6e1; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
#portfolio-chatbot .pc-antenna-tip { fill: #8df4ff; stroke: #4ec8ed; stroke-width: 1; }
#portfolio-chatbot .pc-chest { fill: #5ccde9; }
#portfolio-chatbot .pc-shadow { fill: #000; opacity: .12; }
#portfolio-chatbot .pc-arm { stroke-width: 5; }
#portfolio-chatbot .pc-arm-right { transform-box: fill-box; transform-origin: 0% 0%; }
#portfolio-chatbot .pc-mood-wave .pc-arm-right { animation: pc-wave .65s ease-in-out infinite alternate; }
#portfolio-chatbot .pc-mood-wave .pc-mouth { d: path("M40 51 Q50 63 60 51"); }
#portfolio-chatbot .pc-mood-thinking .pc-antenna-tip { animation: pc-pulse .75s ease-in-out infinite alternate; }
#portfolio-chatbot .pc-mood-thinking .pc-eye { animation: pc-blink 1.2s ease-in-out infinite; }
#portfolio-chatbot .pc-mood-focused .pc-eye { transform: scaleY(.72); }
#portfolio-chatbot .pc-mood-focused .pc-mouth { d: path("M43 54 L57 54"); }
#portfolio-chatbot .pc-mood-confused .pc-eye-right { transform: translateY(-2px) scale(1.1); }
#portfolio-chatbot .pc-mood-confused .pc-mouth { d: path("M42 56 Q50 49 58 56"); }
#portfolio-chatbot .pc-mood-celebrate .pc-robot { animation: pc-celebrate .45s ease-in-out 3; }
#portfolio-chatbot .pc-mood-celebrate .pc-eye { transform: scaleY(.7); }
#portfolio-chatbot .pc-goodbye-message { animation: pc-goodbye .35s ease-out; }
#portfolio-chatbot .pc-thinking::after { content: ""; display: inline-block; width: 18px; text-align: left; animation: pc-dots 1.1s steps(4, end) infinite; }

@keyframes pc-open { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes pc-close { to { opacity: 0; transform: translateY(10px) scale(.97); } }
@keyframes pc-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes pc-wave { from { transform: rotate(-25deg); } to { transform: rotate(-115deg); } }
@keyframes pc-pulse { from { opacity: .45; transform: scale(.85); } to { opacity: 1; transform: scale(1.2); } }
@keyframes pc-blink { 0%, 44%, 48%, 100% { transform: scaleY(1); } 46% { transform: scaleY(.12); } }
@keyframes pc-celebrate { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-5px) rotate(4deg); } }
@keyframes pc-goodbye { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pc-dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75%, 100% { content: "..."; } }

@media (max-width: 480px) {
  #portfolio-chatbot .pc-launcher { right: 8px; bottom: 8px; width: 92px; height: 104px; }
  #portfolio-chatbot .pc-launcher .pc-avatar { flex-basis: 90px; width: 90px; min-width: 90px; height: 100px; }
  #portfolio-chatbot .pc-panel { right: 8px; bottom: 70px; width: calc(100vw - 16px); height: min(620px, calc(100vh - 88px)); }
  #portfolio-chatbot .pc-welcome,
  #portfolio-chatbot .pc-bot-row { grid-template-columns: 44px minmax(0, 1fr); gap: 8px; }
  #portfolio-chatbot .pc-welcome .pc-avatar,
  #portfolio-chatbot .pc-bot-row .pc-avatar { width: 44px; min-width: 44px; height: 58px; }
  #portfolio-chatbot .pc-sources,
  #portfolio-chatbot .pc-suggestions { margin-left: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  #portfolio-chatbot *, #portfolio-chatbot *::before, #portfolio-chatbot *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
/* Greeting bubble above the launcher */
#portfolio-chatbot .pc-greeting { position: fixed; z-index: 9997; right: 22px; bottom: 138px; max-width: 230px; padding: 11px 30px 11px 13px; border: 1px solid #31445f; border-radius: 14px 14px 4px 14px; background: #15233a; color: #edf4fc; font-size: .9rem; line-height: 1.4; box-shadow: 0 10px 30px rgba(0,0,0,.35); cursor: pointer; animation: pc-open .25s ease-out; }
#portfolio-chatbot .pc-greeting[hidden] { display: none; }
#portfolio-chatbot .pc-greeting-x { position: absolute; top: 2px; right: 6px; border: 0; background: transparent; color: #b1bfd1; font-size: 18px; line-height: 1; cursor: pointer; }
@media (max-width: 480px) { #portfolio-chatbot .pc-greeting { right: 12px; bottom: 118px; max-width: calc(100vw - 40px); } }
