/* Agentic Instant Engage search panel: adapted from homepage-search/b2bsearch.html (BLD demo). Colours come from the tokens in pny.css. */
/* ---- Search overlay ---- */
.search-overlay { position: fixed; inset: 0; z-index: 50; }
.search-overlay__backdrop {
  position: absolute; inset: 0;
  background: rgba(10, 5, 0, .55);
  backdrop-filter: blur(6px);
  animation: fade-in .2s ease-out;
}
.search-overlay__dialog {
  position: relative;
  width: min(1340px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  margin: 24px auto 0;
  display: flex; flex-direction: column; gap: 12px;
  animation: drop-in .25s cubic-bezier(.2, .8, .2, 1);
}
@keyframes fade-in { from { opacity: 0; } }
@keyframes drop-in { from { opacity: 0; transform: translateY(-10px); } }

.searchbar {
  display: flex; align-items: center; gap: 14px;
  height: 76px; padding: 0 14px 0 28px;
  background: var(--bg);
  border-radius: 999px;
  box-shadow: 0 10px 40px rgba(10, 5, 0, .25);
}
.searchbar__icon { flex: none; width: 24px; height: 24px; color: var(--accent-fill); }
.searchbar__scope {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 8px 6px 14px;
  border-radius: 999px;
  background: var(--accent-tint); color: var(--ink);
  font-size: 15px; font-weight: 600;
}
.searchbar__scope button {
  display: grid; place-items: center;
  width: 22px; height: 22px; border: 0; border-radius: 999px;
  background: rgba(10, 5, 0, .08); cursor: pointer;
}
.searchbar__input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 21px; font-weight: 500; color: var(--ink);
}
.searchbar__input::placeholder { color: var(--subtle); font-weight: 400; }
.searchbar__input::-webkit-search-cancel-button { display: none; }
.searchbar__clear {
  flex: none;
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 6px;
  background: transparent;
  font-size: 13px; font-weight: 600; color: var(--subtle);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.searchbar__clear:hover { color: var(--ink); border-color: var(--subtle); background: var(--surface); }
.searchbar__clear:focus-visible { outline: 3px solid var(--accent-fill); outline-offset: 2px; }
.searchbar__submit {
  flex: none;
  display: inline-flex; align-items: center; gap: 10px;
  height: 52px; padding: 0 24px;
  border: 0; border-radius: 999px;
  background: var(--ink); color: #fff;
  font-size: 16px; font-weight: 600; cursor: pointer;
}
.searchbar__submit:hover { background: var(--accent-fill); }
.searchbar__close {
  flex: none; display: grid; place-items: center;
  width: 44px; height: 44px; border: 0; border-radius: 999px;
  background: var(--surface); color: var(--ink); cursor: pointer;
}
.searchbar__close:hover { background: var(--border); }

.search-panel {
  overflow-y: auto;
  background: var(--bg);
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 60px rgba(10, 5, 0, .25);
}

/* Shared bits */
.kb-label {
  margin: 0 0 14px;
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--subtle);
}
.kb-heading { margin: 0 0 4px; font-size: 22px; font-weight: 800; line-height: 1.2; color: var(--ink); }
.kb-heading em { font-style: normal; color: var(--accent-fill); }
.kb-sub { margin: 0 0 16px; font-size: 15px; color: var(--muted); }
.is-active { outline: 2px solid var(--accent-fill); outline-offset: 2px; }

/* ---- Instant Engage ---- */
/* The panel: Instant Engage or autocomplete on the left, the Ask BLD conversation on the right */
.search-body { display: grid; grid-template-columns: minmax(0, 1fr) 380px; }
.search-main { min-width: 0; }

.kb { display: grid; grid-template-columns: 240px minmax(0, 1fr); }
.kb__col { padding: 24px 28px; }
.kb__col + .kb__col { border-left: 1px solid var(--border); }

.kb-popular { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.kb-popular button {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 7px 12px; border: 0; border-radius: 8px;
  background: transparent; text-align: left;
  font-size: 16px; font-weight: 500; color: var(--text); cursor: pointer;
}
.kb-popular button::first-letter { text-transform: uppercase; }
.kb-popular button:hover { background: var(--cream); color: var(--accent); }
.kb-popular svg { flex: none; width: 18px; height: 18px; color: var(--accent-fill); }

/* Trending products from Instant Engage */
.kb-products { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.kb-product {
  display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 12px; align-items: center;
  padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--bg); color: inherit; text-decoration: none;
  transition: border-color .15s, background-color .15s, transform .15s;
}
.kb-product:hover { border-color: var(--ink); background: var(--cream); transform: translateY(-1px); }
.kb-product__thumb { width: 72px; aspect-ratio: 1; border-radius: 8px; overflow: hidden; display: grid; place-items: center; background: #fff; color: var(--subtle); font-weight: 700; }
.kb-product__thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.kb-product__brand { display: block; font-size: 12px; font-weight: 600; color: var(--subtle); }
.kb-product__name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin: 1px 0 3px; font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--ink);
}
.kb-product__price { font-size: 15px; font-weight: 700; color: var(--accent); }
.kb-products--loading .kb-product { height: 94px; border: 0; background: linear-gradient(90deg, var(--surface), #fff, var(--surface)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }

.kb-resources { margin-top: 20px; }
.kb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.kb-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 8px 6px 14px;
  border: 1px solid var(--accent-soft); border-radius: 999px;
  background: var(--bg); font-size: 14px; font-weight: 600; color: var(--text); cursor: pointer;
}
.kb-chip:hover { background: var(--accent-tint); }
.kb-chip__count {
  min-width: 30px; padding: 2px 8px; border-radius: 999px;
  background: var(--surface); font-size: 12px; font-weight: 600; color: var(--muted);
}

.kb-resources--docs { margin-top: 14px; }
.ac-result__cat--doc { display: inline-flex; align-items: center; gap: 5px; background: var(--accent-tint); color: var(--accent); }
.ac-result__cat--doc svg { width: 12px; height: 12px; }
.convo-card__tag { display: block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }

/* ---- Ask BLD: an inline conversation, separate from the search box ---- */
.convo { padding: 24px 24px 24px 0; }
.convo__card {
  position: sticky; top: 24px;
  height: min(620px, calc(100vh - 190px)); min-height: 440px;
  display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: 0 8px 28px rgba(10, 5, 0, .08);
  overflow: hidden;
}
.convo__head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.convo__avatar {
  position: relative; flex: none;
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 999px; background: var(--accent-fill); color: #fff;
}
.convo__avatar { font-size: 11px; font-weight: 900; letter-spacing: .04em; }
.convo__avatar::after {
  content: ""; position: absolute; right: -1px; bottom: 0;
  width: 11px; height: 11px; border-radius: 999px; background: #34d399; border: 2px solid #fff;
}
.convo__title { flex: 1; min-width: 0; }
.convo__title strong { display: block; font-size: 16px; font-weight: 700; color: var(--ink); }
.convo__title span { display: block; font-size: 13px; color: var(--subtle); }
.convo__reset {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px;
  background: #fff; color: var(--ink); font-size: 13px; font-weight: 600; cursor: pointer;
}
.convo__reset:hover { border-color: var(--ink); }
.convo__reset svg { width: 13px; height: 13px; }

.convo__scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; }
.convo__intro { display: grid; gap: 12px; }
.convo.has-thread .convo__intro .kb-ask__questions { display: none; }
.convo.has-thread .convo__intro { margin-bottom: 14px; }
.kb-ask__questions { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.kb-ask__q {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border: 1px solid var(--accent-soft); border-radius: 999px;
  background: #fff; color: var(--text); text-align: left;
  font-size: 14px; font-weight: 600; line-height: 1.3; cursor: pointer;
}
.kb-ask__q:hover { background: var(--accent-tint); }
.kb-ask__q svg { flex: none; width: 13px; height: 13px; color: var(--accent-fill); }

.convo__thread { display: grid; gap: 14px; }
.convo-msg { max-width: 100%; }
.convo-msg__who { margin-bottom: 4px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--subtle); }
.convo-msg--you { justify-self: end; max-width: 88%; }
.convo-msg--you .convo-msg__who { text-align: right; }
.convo-msg--you .convo-msg__body {
  padding: 10px 14px; border-radius: 16px 16px 4px 16px;
  background: var(--ink); color: #fff; font-size: 15px; line-height: 1.45;
}
.convo-handoff { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 6px; font-size: 12.5px; color: var(--muted); text-align: right; }
.convo-handoff svg { width: 13px; height: 13px; flex: none; color: var(--accent-fill); }
.convo-msg--hawk { max-width: 94%; }
.convo-msg--hawk .convo-msg__body {
  padding: 12px 14px; border-radius: 16px 16px 16px 4px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font-size: 15px; line-height: 1.5;
  overflow-wrap: anywhere;
}
.convo-msg--error .convo-msg__body { background: #fff5f0; border-color: #f3c1ad; color: #8a2d0b; }
.convo-msg__status { font-size: 13px; color: var(--muted); }
.convo-msg__status::after { content: "\2026"; }
.convo-msg__body > :first-child { margin-top: 0; }
.convo-msg__body > :last-child { margin-bottom: 0; }
.convo-msg__body p { margin: 0 0 10px; }
.convo-msg__body h2, .convo-msg__body h3, .convo-msg__body h4 { margin: 12px 0 6px; font-size: 16px; font-weight: 700; color: var(--ink); }
.convo-msg__body ul, .convo-msg__body ol { margin: 0 0 10px; padding-left: 20px; }
.convo-msg__body li { margin: 4px 0; }
.convo-msg__body strong { font-weight: 700; color: var(--ink); }
.convo-msg--you .convo-msg__body strong { color: #fff; }
.convo-msg__body a { color: var(--accent); font-weight: 600; }
.convo-seg + .convo-seg, .convo-card + .convo-seg, .convo-seg + .convo-card, .convo-card + .convo-card { margin-top: 10px; }

/* Product cards the agent shows with the show_product tool */
.convo-card {
  display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; align-items: center;
  padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-md);
  color: inherit; text-decoration: none; background: #fff;
}
.convo-card:hover { border-color: var(--ink); background: var(--cream); }
.convo-card__thumb {
  width: 56px; aspect-ratio: 1; border-radius: 6px; overflow: hidden;
  display: grid; place-items: center; background: #fff; color: var(--subtle); font-weight: 700;
}
.convo-card__thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.convo-card__title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 14px; font-weight: 700; line-height: 1.3; color: var(--ink);
}
.convo-card__price { display: block; margin-top: 2px; font-size: 14px; font-weight: 700; color: var(--accent); }
.convo-card__desc {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 2px; font-size: 13px; line-height: 1.35; color: var(--muted);
}

.convo__form {
  display: flex; align-items: center; gap: 8px;
  margin: 0; padding: 12px 14px 14px; border-top: 1px solid var(--border);
}
.convo__field {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 5px 5px 5px 16px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
}
.convo__field:focus-within { border-color: var(--ink); background: #fff; }
.convo__input {
  flex: 1; min-width: 0; padding: 8px 0;
  border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 15px; color: var(--text);
}
.convo__input::placeholder { color: var(--subtle); }
.convo__send {
  flex: none; display: grid; place-items: center;
  width: 38px; height: 38px; border: 0; border-radius: 999px;
  background: var(--accent-fill); color: #fff; cursor: pointer;
}
.convo__send:hover { background: var(--ink); }
.convo__send:disabled { background: var(--border); color: var(--subtle); cursor: default; }
.convo__send svg { width: 16px; height: 16px; }

/* ---- Autocomplete: suggestions + live results ---- */
.ac { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 420px; }
.ac__col { padding: 28px 32px; }
.ac__col + .ac__col { border-left: 1px solid var(--border); }

.ac-suggestions { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.ac-suggestion {
  width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border: 0; border-radius: 8px;
  background: transparent; text-align: left; font-size: 16px; color: var(--text); cursor: pointer;
}
.ac-suggestion:hover, .ac-suggestion.is-active { background: var(--cream); outline: 0; }
.ac-suggestion svg { flex: none; width: 18px; height: 18px; color: var(--subtle); }
.ac-suggestion b { font-weight: 700; color: var(--ink); }
.ac-suggestion__type { margin-left: auto; font-size: 12px; color: var(--subtle); }

.ac-results__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.ac-results__all {
  display: inline-flex; align-items: center; gap: 6px;
  border: 0; background: none; padding: 0;
  font-size: 15px; font-weight: 700; color: var(--accent); cursor: pointer;
}
.ac-results__all svg { width: 14px; height: 14px; }
.ac-results { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ac-result {
  display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 14px; align-items: center;
  padding: 10px 12px 10px 10px; border: 1px solid var(--border); border-radius: var(--radius-lg);
  color: inherit; text-decoration: none;
  transition: border-color .15s, background-color .15s;
}
.ac-result:hover, .ac-result.is-active { border-color: var(--ink); background: var(--cream); outline: 0; }
.ac-result__thumb {
  width: 84px; aspect-ratio: 1; border-radius: 8px; overflow: hidden;
  display: grid; place-items: center;
  background: #fff; color: var(--subtle); font-size: 28px; font-weight: 700;
}
.ac-result__thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ac-result__brand { display: block; margin-bottom: 2px; font-size: 12px; font-weight: 600; color: var(--subtle); }
.ac-result__title {
  margin: 0; font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;   /* B2B product names run long */
}
.ac-result__title mark { background: none; color: var(--accent); }
.ac-result__meta { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.ac-result__price { font-size: 15px; font-weight: 700; color: var(--accent); }
.ac-result__cat { padding: 1px 8px; border-radius: 999px; background: var(--surface); font-size: 12px; font-weight: 600; color: var(--muted); }

/* Smart Response answer card, above the live results */
.sr {
  margin-bottom: 24px; padding: 22px 24px;
  border: 1px solid var(--sr-border); border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--sr-tint) 0%, #fff 60%);
}
.sr__head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.sr__badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--ink); color: #fff;
  font-size: 12px; font-weight: 700; letter-spacing: .06em;
}
.sr__badge svg { width: 14px; height: 14px; color: var(--accent-fill); }
.sr__status { font-size: 14px; color: var(--subtle); }
.sr__chat {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; border: 1px solid var(--ink); border-radius: 999px;
  background: #fff; color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer;
}
.sr__chat:hover, .sr__chat.is-active { background: var(--ink); color: #fff; outline: 0; }
.sr__chat svg { width: 15px; height: 15px; }
.sr__answer p { margin: 0 0 10px; font-size: 17px; line-height: 1.55; color: var(--ink); }
.sr__answer p:last-child { margin-bottom: 0; }
.sr__sources { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.sr__source {
  display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; align-items: center;
  padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: #fff; color: inherit; text-decoration: none;
}
a.sr__source:hover, .sr__source.is-active { border-color: var(--ink); outline: 0; }
.sr__source__thumb {
  width: 56px; aspect-ratio: 1; border-radius: 6px; overflow: hidden;
  display: grid; place-items: center; background: #fff; color: var(--subtle); font-weight: 700;
}
.sr__source__thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.sr__source__title {
  margin: 0; font-size: 14px; font-weight: 700; line-height: 1.3; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sr__source-price { margin: 2px 0 0; font-size: 14px; font-weight: 700; color: var(--accent); }
.sr__lines { display: grid; gap: 10px; }
.sr__line { height: 14px; border-radius: 7px; background: linear-gradient(90deg, var(--sr-line), #f4f9fc, var(--sr-line)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.sr__line:nth-child(2) { width: 92%; }
.sr__line:nth-child(3) { width: 64%; }
.sr__note { margin: 0; font-size: 15px; color: var(--muted); }
.sr--idle { margin-bottom: 20px; padding: 18px 22px; }
.sr--idle .sr__head { margin-bottom: 10px; }
.sr--idle .sr__lines { margin-top: 12px; }
.sr--idle .sr__line:nth-child(3) { display: none; }
.sr--idle .sr__line { animation: none; opacity: .55; }

.ac-status { padding: 40px 0; text-align: center; font-size: 16px; color: var(--muted); }
.ac-skeleton { height: 106px; border-radius: var(--radius-lg); background: linear-gradient(90deg, var(--surface), #fff, var(--surface)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---- Responsive ---- */
@media (max-width: 1200px) {
  .search-body { grid-template-columns: minmax(0, 1fr); }
  .convo { padding: 0 24px 24px; }
  .convo__card { position: static; height: 520px; }
  .kb, .ac { grid-template-columns: 220px minmax(0, 1fr); }
  .kb-products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1020px) {
}
@media (max-width: 860px) {
  .search-overlay__dialog { width: 100%; max-height: 100vh; margin: 0; gap: 0; }
  .searchbar { height: 64px; padding: 0 8px 0 18px; border-radius: 0; box-shadow: none; border-bottom: 1px solid var(--border); }
  .searchbar__input { font-size: 17px; }
  .searchbar__submit span { display: none; }
  .searchbar__submit { height: 44px; padding: 0 14px; }
  .search-panel { flex: 1; border-radius: 0; box-shadow: none; }
  .kb, .ac { grid-template-columns: minmax(0, 1fr); }
  .kb__col, .ac__col { padding: 24px 18px; }
  .kb__col + .kb__col, .ac__col + .ac__col { border-left: 0; border-top: 1px solid var(--border); }
  .kb-products, .ac-results, .kb-ask__questions, .sr__sources { grid-template-columns: minmax(0, 1fr); }
  .convo { padding: 0 12px 18px; }
  .convo__card { height: 480px; }
}
@media (max-width: 640px) {
}


@media (prefers-reduced-motion: reduce) {
  .search-overlay__backdrop, .search-overlay__dialog, .ac-skeleton, .sr__line, .kb-products--loading .kb-product { animation: none; }
  .kb-product { transition: none; }
}

/* ---- PNY additions ---- */
/* Smart Response answers are markdown and can be long: three lines, then "Read more" */
.sr__answer { max-height: calc(1.55em * 3.4); overflow: hidden; font-size: 17px; line-height: 1.55; color: var(--ink);
  -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.sr__answer.is-open { max-height: none; -webkit-mask-image: none; mask-image: none; }
.sr__answer ul { margin: 0 0 10px; padding-left: 20px; }
.sr__answer li { margin: 2px 0; }
.sr__answer strong, .sr__answer b { font-weight: 700; }
.sr__answer h1, .sr__answer h2, .sr__answer h3 { margin: 0 0 6px; font-size: 1em; }
.sr__more { margin-top: 6px; padding: 0; border: 0; background: none; color: var(--accent); font-weight: 600; font-size: 14px; cursor: pointer; }
.sr__source__text, .convo-card__text { min-width: 0; }
.sr__source__tag, .convo-card__tag { display: block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr__source__desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; font-size: 12px; line-height: 1.35; color: var(--muted); }
.kb-product__price { font-weight: 500 !important; color: var(--muted) !important; font-size: 13px !important; }
/* Long product names in the suggestions column: two lines at most */
.ac-suggestion > span:not(.ac-suggestion__type) { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
