/* PartYard Chat widget. Scoped under #pyc-root to resist theme styles.
   Colours and type follow the PartYard website: deep navy, sky blue, ice paper, Plus Jakarta Sans. */
#pyc-root {
  --pyc-brand: #0b304b;
  --pyc-deep: #071f31;
  --pyc-sky: #93b7d3;
  --pyc-blue: #2d5885;
  --pyc-ink: #0f2536;
  --pyc-muted: #5f7686;
  --pyc-steel: #e8eef4;
  --pyc-line: #dbe5ea;
  --pyc-paper: #ffffff;
  --pyc-wash: #f6f8fa;
  --pyc-ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --pyc-display: 'Plus Jakarta Sans', inherit;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147483000;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  color: var(--pyc-ink);
}
#pyc-root *, #pyc-root *::before, #pyc-root *::after { box-sizing: border-box; }
#pyc-root [hidden] { display: none !important; }
#pyc-root button, #pyc-root input, #pyc-root textarea {
  font: inherit;
  color: inherit;
  margin: 0;
  letter-spacing: normal;
  text-transform: none;
  box-shadow: none;
}
#pyc-root button { cursor: pointer; }
#pyc-root :focus-visible { outline: 2px solid var(--pyc-sky); outline-offset: 2px; }

/* Launcher: same pill as the site's navy buttons */
#pyc-root .pyc-launcher {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  padding: 14px 22px 14px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--pyc-brand);
  color: #fff;
  font-family: var(--pyc-display);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  box-shadow: 0 16px 38px rgba(7, 31, 49, 0.38);
  transition: transform 0.35s var(--pyc-ease), background 0.25s, box-shadow 0.35s;
}
#pyc-root .pyc-launcher:hover { transform: translateY(-2px); background: #12456b; box-shadow: 0 22px 46px rgba(7, 31, 49, 0.42); }
#pyc-root .pyc-launcher svg { width: 20px; height: 20px; fill: currentColor; }
#pyc-root.pyc-is-open .pyc-launcher-label { display: none; }
#pyc-root.pyc-is-open .pyc-launcher { padding: 14px; }
#pyc-root .pyc-dot {
  position: absolute;
  top: 3px;
  right: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--pyc-sky);
  border: 2px solid var(--pyc-brand);
}

/* Panel */
#pyc-root .pyc-panel {
  display: flex;
  flex-direction: column;
  width: 400px;
  height: min(680px, calc(100vh - 110px));
  margin-bottom: 14px;
  background: var(--pyc-paper);
  border: 1px solid rgba(11, 48, 75, 0.1);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 40px 90px rgba(7, 31, 49, 0.32), 0 6px 20px rgba(7, 31, 49, 0.1);
  animation: pyc-in 0.35s var(--pyc-ease);
  transition: width 0.3s var(--pyc-ease), height 0.3s var(--pyc-ease);
}
#pyc-root.pyc-wide .pyc-panel {
  width: min(600px, calc(100vw - 40px));
  height: min(820px, calc(100vh - 110px));
}
@keyframes pyc-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }

#pyc-root .pyc-head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 18px 14px 18px 22px;
  background:
    radial-gradient(260px 120px at 90% -20%, rgba(147, 183, 211, 0.28), transparent 70%),
    linear-gradient(160deg, var(--pyc-deep), var(--pyc-brand));
  color: #fff;
}
#pyc-root .pyc-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
#pyc-root .pyc-title strong { font-family: var(--pyc-display); font-size: 17px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
#pyc-root .pyc-sub { font-size: 12.5px; color: var(--pyc-sky); }
#pyc-root .pyc-sub::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--pyc-sky);
  vertical-align: 1px;
}
#pyc-root[data-status="human"] .pyc-sub::before { background: #4cd07d; }
#pyc-root .pyc-human {
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-family: var(--pyc-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition: background 0.25s, color 0.25s;
}
#pyc-root .pyc-human:hover { background: #fff; color: var(--pyc-brand); }
#pyc-root .pyc-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  transition: background 0.25s;
}
#pyc-root .pyc-close svg { width: 19px; height: 19px; fill: currentColor; }
#pyc-root .pyc-close:hover { background: rgba(255, 255, 255, 0.14); }

/* Messages */
#pyc-root .pyc-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--pyc-wash);
  scrollbar-width: thin;
  scrollbar-color: var(--pyc-line) transparent;
}
#pyc-root .pyc-msg { display: flex; flex-direction: column; max-width: 88%; }
#pyc-root .pyc-bubble {
  padding: 11px 15px;
  border-radius: 18px;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
#pyc-root .pyc-bubble a { color: inherit; text-decoration: underline; text-underline-offset: 2px; font-weight: 600; }
#pyc-root .pyc-user { align-self: flex-end; }
#pyc-root .pyc-user .pyc-bubble { background: var(--pyc-brand); color: #fff; border-bottom-right-radius: 6px; white-space: pre-wrap; }
#pyc-root .pyc-assistant { align-self: flex-start; }
#pyc-root .pyc-assistant .pyc-bubble { background: var(--pyc-paper); border: 1px solid var(--pyc-line); border-bottom-left-radius: 6px; box-shadow: 0 6px 18px rgba(7, 31, 49, 0.05); }
#pyc-root .pyc-agent { align-self: flex-start; }
#pyc-root .pyc-agent .pyc-bubble { background: var(--pyc-steel); border: 1px solid var(--pyc-line); border-left: 3px solid var(--pyc-blue); border-bottom-left-radius: 6px; }
#pyc-root .pyc-who { font-size: 12px; font-weight: 600; color: var(--pyc-blue); margin: 0 0 4px 4px; }
#pyc-root .pyc-system { align-self: center; max-width: 94%; }
#pyc-root .pyc-system .pyc-bubble { background: transparent; color: var(--pyc-muted); font-size: 13px; text-align: center; padding: 2px 6px; }

#pyc-root .pyc-typing .pyc-bubble { display: flex; align-items: center; gap: 5px; padding: 15px 17px; }
#pyc-root .pyc-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--pyc-blue); animation: pyc-bounce 1.2s infinite ease-in-out; }
#pyc-root .pyc-typing i:nth-child(2) { animation-delay: 0.16s; }
#pyc-root .pyc-typing i:nth-child(3) { animation-delay: 0.32s; }
@keyframes pyc-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.4; } 30% { transform: translateY(-5px); opacity: 1; } }

/* Suggestions and resume */
#pyc-root .pyc-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 18px 12px; background: var(--pyc-wash); }
#pyc-root .pyc-chip {
  padding: 8px 14px;
  border: 1px solid var(--pyc-line);
  border-radius: 999px;
  background: var(--pyc-paper);
  color: var(--pyc-brand);
  font-size: 13.5px;
  font-weight: 600;
  transition: background 0.25s, color 0.25s, border-color 0.25s;
}
#pyc-root .pyc-chip:hover { background: var(--pyc-brand); border-color: var(--pyc-brand); color: #fff; }
#pyc-root .pyc-resume {
  margin: 0;
  padding: 10px 18px;
  border: 0;
  border-top: 1px solid var(--pyc-line);
  background: var(--pyc-steel);
  color: var(--pyc-brand);
  font-size: 13px;
  text-align: left;
  text-decoration: underline;
}

/* Topic list (empty state) */
#pyc-root .pyc-topics { margin-top: 2px; }
#pyc-root .pyc-topics-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 2px;
  padding: 0 2px 8px;
  font-family: var(--pyc-display);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--pyc-blue);
}
#pyc-root .pyc-topics-title::before { content: ""; width: 26px; height: 2px; background: currentColor; }
#pyc-root .pyc-topic { border-top: 1px solid var(--pyc-line); }
#pyc-root .pyc-topic:last-child { border-bottom: 1px solid var(--pyc-line); }
#pyc-root .pyc-topic-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 9px 2px;
  border: 0;
  background: transparent;
  color: var(--pyc-ink);
  font-family: var(--pyc-display);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-align: left;
  transition: color 0.2s;
}
#pyc-root .pyc-topic-head:hover, #pyc-root .pyc-topic.is-open .pyc-topic-head { color: var(--pyc-blue); }
#pyc-root .pyc-plus {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border: 1px solid var(--pyc-line);
  border-radius: 50%;
  background: var(--pyc-paper);
  transition: transform 0.35s var(--pyc-ease), background 0.25s, color 0.25s, border-color 0.25s;
}
#pyc-root .pyc-plus svg { width: 16px; height: 16px; fill: currentColor; }
#pyc-root .pyc-topic-head:hover .pyc-plus { border-color: var(--pyc-brand); }
#pyc-root .pyc-topic.is-open .pyc-plus { transform: rotate(45deg); background: var(--pyc-brand); border-color: var(--pyc-brand); color: #fff; }
#pyc-root .pyc-topic-pane { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.35s var(--pyc-ease); }
#pyc-root .pyc-topic.is-open .pyc-topic-pane { grid-template-rows: 1fr; }
#pyc-root .pyc-topic-inner { overflow: hidden; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
#pyc-root .pyc-topic.is-open .pyc-topic-inner { padding-bottom: 14px; }
#pyc-root .pyc-q {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--pyc-line);
  border-radius: 14px;
  background: var(--pyc-paper);
  color: var(--pyc-brand);
  font-size: 14px;
  line-height: 1.4;
  text-align: left;
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.3s var(--pyc-ease);
}
#pyc-root .pyc-q:hover { background: var(--pyc-brand); border-color: var(--pyc-brand); color: #fff; transform: translateX(3px); }

/* Handoff form */
#pyc-root .pyc-handoff {
  align-self: stretch;
  padding: 18px;
  border: 1px solid var(--pyc-line);
  border-radius: 20px;
  background: var(--pyc-paper);
  box-shadow: 0 10px 28px rgba(7, 31, 49, 0.07);
}
#pyc-root .pyc-handoff-title { margin: 0 0 12px; font-family: var(--pyc-display); font-size: 16px; font-weight: 700; letter-spacing: -0.02em; }
#pyc-root .pyc-handoff label { display: block; margin-bottom: 10px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--pyc-muted); }
#pyc-root .pyc-handoff input, #pyc-root .pyc-handoff textarea {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid var(--pyc-line);
  border-radius: 12px;
  background: var(--pyc-wash);
  color: var(--pyc-ink);
  font-size: 15px;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
}
#pyc-root .pyc-handoff input:focus, #pyc-root .pyc-handoff textarea:focus { border-color: var(--pyc-brand); background: #fff; outline: 0; }
#pyc-root .pyc-handoff-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
#pyc-root .pyc-btn, #pyc-root .pyc-btn-ghost { padding: 10px 18px; border-radius: 999px; font-family: var(--pyc-display); font-size: 13px; font-weight: 700; }
#pyc-root .pyc-btn { border: 0; background: var(--pyc-brand); color: #fff; }
#pyc-root .pyc-btn:hover { background: #12456b; }
#pyc-root .pyc-btn:disabled { opacity: 0.6; }
#pyc-root .pyc-btn-ghost { border: 1px solid var(--pyc-line); background: transparent; color: var(--pyc-ink); }
#pyc-root .pyc-err { margin: 0 0 8px; color: #b42318; font-size: 13px; }

/* Notice above the composer (for example when the microphone is blocked) */
#pyc-root .pyc-note { margin: 0; padding: 8px 18px; background: #fdecea; color: #912018; font-size: 13px; }

/* Input */
#pyc-root .pyc-input { margin: 0; padding: 12px 14px 4px; background: var(--pyc-paper); }
#pyc-root .pyc-box {
  padding: 10px 8px 6px 16px;
  border: 1px solid var(--pyc-line);
  border-radius: 22px;
  background: var(--pyc-wash);
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
#pyc-root .pyc-box:focus-within { border-color: var(--pyc-brand); background: #fff; box-shadow: 0 0 0 4px rgba(147, 183, 211, 0.35); }
#pyc-root .pyc-input textarea {
  display: block;
  width: 100%;
  min-height: 26px;
  max-height: 120px;
  padding: 2px 0 8px;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  font-size: 15px;
}
#pyc-root .pyc-input textarea:focus-visible { outline: 0; }
#pyc-root .pyc-input textarea::placeholder { color: #8a9ea9; }
#pyc-root .pyc-tools { display: flex; align-items: center; gap: 4px; }
#pyc-root .pyc-grow { flex: 1; }
#pyc-root .pyc-tool {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--pyc-muted);
  transition: background 0.25s, color 0.25s;
}
#pyc-root .pyc-tool svg { width: 20px; height: 20px; fill: currentColor; }
#pyc-root .pyc-tool:hover { background: var(--pyc-steel); color: var(--pyc-brand); }
#pyc-root .pyc-mic.is-listening { background: #fde8e6; color: #b42318; animation: pyc-listen 1.3s ease-in-out infinite; }
@keyframes pyc-listen { 0%, 100% { box-shadow: 0 0 0 0 rgba(180, 35, 24, 0.35); } 50% { box-shadow: 0 0 0 7px rgba(180, 35, 24, 0); } }
#pyc-root .pyc-send {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--pyc-brand);
  color: #fff;
  transition: background 0.25s, transform 0.3s var(--pyc-ease);
}
#pyc-root .pyc-send:hover { background: #12456b; transform: translateY(-1px); }
#pyc-root .pyc-send:disabled { opacity: 0.5; transform: none; }
#pyc-root .pyc-send svg { width: 18px; height: 18px; fill: currentColor; }
#pyc-root .pyc-foot { padding: 5px 20px 10px; background: var(--pyc-paper); font-size: 11.5px; color: var(--pyc-muted); }
#pyc-root .pyc-foot a { color: inherit; }

/* Mobile: full screen panel */
@media (max-width: 480px) {
  #pyc-root { right: 12px; bottom: 12px; }
  #pyc-root .pyc-panel {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    border: 0;
    border-radius: 0;
  }
  #pyc-root.pyc-is-open .pyc-launcher { display: none; }
  #pyc-root .pyc-expand { display: none; }
  #pyc-root .pyc-input textarea { font-size: 16px; } /* prevents iOS zoom */
}

@media (prefers-reduced-motion: reduce) {
  #pyc-root .pyc-panel, #pyc-root .pyc-typing i, #pyc-root .pyc-mic.is-listening { animation: none; }
  #pyc-root .pyc-panel, #pyc-root .pyc-topic-pane, #pyc-root .pyc-plus, #pyc-root .pyc-launcher, #pyc-root .pyc-q { transition: none; }
}
