.chat-launcher {
  position: fixed;
  right: 24px;
  bottom: 22px;
  background: var(--orange);
  color: #fff;
  padding: 17px 21px;
  display: flex;
  gap: 17px;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  z-index: 25;
  box-shadow: 0 6px 25px #29201220;
}
.launcher-wave {
  font-size: 16px;
  letter-spacing: -1px;
}
.chat-launcher > span:last-child {
  font-size: 20px;
}
.advisor-dialog {
  position: fixed;
  inset: 0 0 0 auto;
  margin: 18px;
  width: 610px;
  max-width: calc(100vw - 36px);
  height: calc(100dvh - 36px);
  max-height: calc(100dvh - 36px);
  padding: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  overflow: hidden;
  box-shadow: 0 15px 60px #14140f30;
}
.advisor-dialog[open] {
  display: flex;
  flex-direction: column;
}
.advisor-header {
  padding: 26px 28px;
  display: flex;
  align-items: center;
  gap: 17px;
  border-bottom: 1px solid var(--line);
  background: #e9e7db;
  flex-shrink: 0;
}
.advisor-avatar {
  background: var(--orange);
  color: var(--paper);
  font-family: Georgia;
  font-size: 45px;
  line-height: 1;
  display: grid;
  place-items: center;
  width: 57px;
  height: 57px;
  border-radius: 50%;
  flex-shrink: 0;
}
.advisor-header h2 {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.5px;
  margin: 5px 0;
}
.advisor-header .eyebrow {
  font-size: 7px;
}
.advisor-header p:last-child {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}
.advisor-header > button {
  font-size: 25px;
  padding: 4px;
  line-height: 1;
}
.advisor-header > button:first-of-type {
  margin-left: auto;
}
.chat-messages {
  padding: 28px;
  flex: 1;
  min-height: 0;
  overflow: auto;
  scroll-behavior: smooth;
  overscroll-behavior: contain;
}
.advisor-welcome {
  padding: 20px 5px;
}
.welcome-wave {
  font-family: Georgia;
  color: var(--orange);
  font-size: 90px;
  line-height: 0.8;
  margin: 5px 0 25px;
}
.advisor-welcome h3 {
  font-size: 47px;
  line-height: 1.04;
  letter-spacing: -2px;
  font-weight: 550;
  margin: 17px 0;
}
.advisor-welcome > p:not(.eyebrow) {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
  max-width: 340px;
}
.chat-suggestions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 27px;
}
.chat-suggestions button {
  padding: 16px 17px;
  background: var(--cream);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  text-align: left;
}
.chat-suggestions span {
  font-size: 18px;
}
.message {
  font-size: 14px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.message-text {
  white-space: pre-wrap;
}
.message.user {
  margin: 0 0 28px 45px;
  background: var(--cream);
  padding: 17px 21px;
}
.message.assistant {
  margin-bottom: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.message-mark {
  font-size: 7px;
  letter-spacing: 1.4px;
  color: var(--muted);
  display: block;
  margin-bottom: 12px;
}
.message.error {
  border: 1px solid #ba381f;
  padding: 15px;
  color: #9f301c;
  margin-bottom: 20px;
  font-size: 12px;
}
.advisor-bottom {
  padding: 0 22px 17px;
  flex-shrink: 0;
  background: var(--paper);
}
#chat-status {
  font-size: 10px;
  color: var(--muted);
  padding: 8px 5px;
  min-height: 29px;
}
#chat-form {
  border: 1px solid var(--line);
  background: #fff;
  display: flex;
  align-items: end;
  padding: 16px;
  gap: 12px;
}
#chat-input {
  resize: none;
  min-height: 50px;
  max-height: 140px;
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  font-size: 13px;
  line-height: 1.6;
  padding: 2px;
  outline: none;
}
#chat-input:focus-visible {
  outline: 1px solid var(--orange);
}
#chat-send {
  background: var(--ink);
  color: var(--paper);
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  font-size: 28px;
  line-height: 1;
}
.chat-note {
  text-align: center;
  font-size: 8px;
  color: var(--muted);
  padding-top: 12px;
}
.chat-products {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 23px;
}
.chat-product {
  display: grid;
  grid-template-columns: 140px 1fr;
  background: var(--surface);
  min-height: 196px;
  border: 1px solid var(--line);
}
.chat-product-image {
  padding: 20px 13px;
  min-width: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.chat-product-image img {
  height: 164px;
  width: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.chat-product > div {
  padding: 23px 21px 17px 8px;
  min-width: 0;
}
.chat-product > div > p {
  font-size: 7px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
}
.chat-product-name {
  display: block;
  font-size: 15px;
  font-weight: 650;
  padding: 0;
  text-align: left;
  line-height: 1.35;
  margin: 6px 0 10px;
}
.chat-product > div > span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}
.chat-product small {
  font-size: 10px;
  display: block;
  color: var(--muted);
}
.chat-product-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-top: 15px;
}
.chat-product-actions button {
  font-size: 10px;
  padding: 0;
}
.chat-product-actions button:last-child {
  font-size: 22px;
  width: 25px;
  height: 25px;
  border: 1px solid var(--line);
  line-height: 1;
}
.assessment {
  margin-top: 22px;
  padding: 20px;
  background: #e9e9dc;
  border-left: 3px solid var(--orange);
  font-size: 11px;
  line-height: 1.7;
}
.assessment-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 7px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.assessment-status {
  border: 1px solid #a8aa93;
  padding: 2px 6px;
  white-space: nowrap;
}
.assessment-status.incompatible {
  border-color: #bb4f38;
  color: #95331c;
}
.assessment h4 {
  font-size: 16px;
  line-height: 1.4;
  margin: 13px 0 10px;
  font-weight: 650;
}
.assessment > p {
  margin-bottom: 12px;
}
.assessment dl {
  margin: 12px 0;
}
.assessment dl > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-top: 1px solid #d2d4c1;
  align-items: start;
}
.assessment dt {
  font-size: 10px;
  color: #67695b;
  flex: 1;
}
.assessment dd {
  font-size: 10px;
  margin: 0;
  flex: 1;
  text-align: right;
  white-space: pre-wrap;
}
.assessment details {
  border-top: 1px solid #d2d4c1;
  padding-top: 10px;
}
.assessment summary {
  cursor: pointer;
  font-size: 10px;
  display: list-item;
}
.assessment summary span {
  margin-left: 7px;
  color: var(--muted);
}
.assessment ul {
  padding-left: 17px;
  color: #66685b;
  font-size: 10px;
}
.assessment-sources {
  display: flex;
  gap: 8px 14px;
  flex-wrap: wrap;
  font-size: 9px;
  margin-top: 12px;
}
.assessment-sources a {
  text-decoration: underline;
}
.wide-string {
  transform: rotate(-48deg) scale(1.3);
}
.product-image:hover img.wide-string {
  transform: rotate(-45deg) scale(1.34);
}
@media (max-width: 650px) {
  .chat-launcher {
    bottom: 15px;
    right: 14px;
    padding: 14px 17px;
    gap: 13px;
    font-size: 10px;
  }
  .advisor-dialog {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
  }
  .advisor-header {
    padding: 22px 20px;
    gap: 13px;
  }
  .advisor-avatar {
    width: 48px;
    height: 48px;
    font-size: 38px;
  }
  .advisor-header h2 {
    font-size: 19px;
  }
  .advisor-header .eyebrow {
    font-size: 6px;
  }
  .advisor-header > button {
    font-size: 24px;
  }
  .chat-messages {
    padding: 23px 20px;
  }
  .message {
    font-size: 13px;
  }
  .message.user {
    margin-left: 28px;
    padding: 15px 17px;
  }
  .advisor-bottom {
    padding: 0 15px 13px;
  }
  #chat-form {
    padding: 13px;
  }
  .chat-note {
    font-size: 7px;
  }
  .advisor-welcome h3 {
    font-size: 44px;
  }
  .chat-product {
    grid-template-columns: 112px 1fr;
    min-height: 180px;
  }
  .chat-product-image {
    padding: 17px 12px;
  }
  .chat-product-image img {
    height: 160px;
  }
  .chat-product > div {
    padding: 18px 14px 15px 5px;
  }
  .chat-product-name {
    font-size: 13px;
  }
  .chat-product > div > span {
    font-size: 10px;
  }
  .assessment {
    padding: 16px;
  }
  .assessment dt,
  .assessment dd {
    font-size: 9px;
  }
  .assessment h4 {
    font-size: 15px;
  }
}
@media (max-width: 360px) {
  .advisor-header {
    padding: 19px 15px;
    gap: 9px;
  }
  .advisor-avatar {
    width: 40px;
    height: 40px;
  }
  .advisor-header h2 {
    font-size: 17px;
  }
  .advisor-header > button {
    font-size: 21px;
  }
  .chat-messages {
    padding: 20px 15px;
  }
  .chat-product {
    grid-template-columns: 96px 1fr;
  }
  .chat-product-image {
    padding: 15px 8px;
  }
  .chat-product-name {
    font-size: 12px;
  }
  .advisor-welcome h3 {
    font-size: 38px;
  }
  .chat-launcher {
    font-size: 9px;
    gap: 10px;
  }
}

.dark-product {
  background: #10110f !important;
}
.dark-product img {
  mix-blend-mode: normal;
}
.world-card.dark-product {
  color: var(--paper);
}
.world-card.dark-product small,
.world-card.dark-product .index {
  color: #c1c1b5;
}

/* Structured advice, with user-entered text retaining its original spacing. */
.message.assistant .message-text { white-space: normal; }
.message.assistant .message-text p { margin: 0 0 1em; }
.message.assistant .message-text p:last-child { margin-bottom: 0; }
.message.assistant .message-text ul, .message.assistant .message-text ol { margin: 1em 0; padding-left: 1.35em; }
.message.assistant .message-text li { padding-left: .15em; margin: .55em 0; }
.message.assistant .message-text strong { font-weight: 650; }

@media (max-width: 600px) {
  body:has(.product-page) .chat-launcher {
    width: 54px;
    height: 54px;
    padding: 10px;
    justify-content: center;
  }
  body:has(.product-page) .chat-launcher > span:not(.launcher-wave) { display: none; }
  body:has(.product-page) .launcher-wave { font-size: 14px; letter-spacing: -2px; }
}

.guidance-reference { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; font-size: .8rem; }
.guidance-reference summary { display: flex; justify-content: space-between; gap: 12px; cursor: pointer; font-weight: 600; }
.guidance-reference summary > span:first-child { overflow-wrap: anywhere; }
.guidance-reference[open] summary { margin-bottom: 12px; }
.guidance-reference p { line-height: 1.65; color: var(--muted); }
.guidance-reference .assessment-sources { margin-top: 12px; }

/* Progressive reveal of a finished answer and the working indicator. */
.message.assistant.revealing .message-text { white-space: pre-wrap; }
.message.assistant.revealing .message-extras { opacity: 0; }
.message-extras { transition: opacity .35s ease; }
.message.pending { padding-bottom: 20px; }
.pending-row { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.pending-dots { display: inline-flex; gap: 4px; }
.pending-dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .35; animation: pending-pulse 1.1s ease-in-out infinite; }
.pending-dots i:nth-child(2) { animation-delay: .18s; }
.pending-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes pending-pulse { 0%, 100% { opacity: .25; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { .pending-dots i { animation: none; opacity: .7; } .message-extras { transition: none; } }

.chat-heard { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 2px; }
.chat-heard-label { font-size: 9px; letter-spacing: 1px; text-transform: uppercase; opacity: 0.7; width: 100%; }
.chat-heard .song-previews { display: inline-flex; }
.chat-heard-artist { font-size: 11px; opacity: 0.75; margin-right: 8px; }
.chat-heard-main { display: contents; }
.chat-heard-more { flex-basis: 100%; text-align: left; background: none; border: 0; padding: 4px 0 0; font: inherit; font-size: 11px; letter-spacing: 0.4px; opacity: 0.75; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; color: inherit; }
.chat-heard-more:hover, .chat-heard-more[aria-expanded="true"] { opacity: 1; }
.chat-heard-others:not([hidden]) { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex-basis: 100%; }
.chat-artist-link { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; padding: 14px 16px; background: var(--ink, #23231f); color: var(--paper, #f4f1e9); text-decoration: none; transition: background 0.2s; }
.chat-artist-link:hover { background: var(--orange, #ed4b25); }
.chat-artist-link span { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.chat-artist-link small { font-size: 9px; letter-spacing: 1.4px; opacity: 0.7; }
.chat-artist-link strong { font-size: 15px; letter-spacing: -0.3px; }
.chat-artist-link em { font-family: inherit; font-style: normal; font-size: 11px; opacity: 0.75; }
.chat-artist-link b { font-size: 20px; font-weight: 400; }


/* Launcher: big and explicit. People should know they can ask anything. */
.chat-launcher { padding: 20px 26px 20px 22px; gap: 18px; font-size: 13px; min-width: 360px; box-shadow: 0 12px 40px #29201238; transition: transform 0.18s ease, box-shadow 0.18s ease; }
.chat-launcher:hover { transform: translateY(-2px); box-shadow: 0 16px 48px #29201248; }
.chat-launcher .launcher-wave { font-size: 22px; }
.chat-launcher > .launcher-wave .chat-icon, .chat-launcher .chat-icon { width: 30px; height: 30px; }
.launcher-text { display: flex; flex-direction: column; gap: 4px; text-align: left; flex: 1; }
.launcher-text strong { font-size: 20px; font-weight: 650; letter-spacing: -0.3px; line-height: 1; }
.launcher-text small { font-size: 12px; font-weight: 500; opacity: 0.9; line-height: 1.35; max-width: 250px; }
.chat-launcher > span:last-child { font-size: 26px; }
@media (max-width: 650px) {
  .chat-launcher { min-width: 0; left: 14px; right: 14px; padding: 15px 18px; }
  .launcher-text strong { font-size: 17px; }
  .launcher-text small { font-size: 11px; max-width: none; }
}
@media (max-width: 650px) {
  body.ask-hero-visible .chat-launcher { opacity: 0; pointer-events: none; transform: translateY(20px); }
  .chat-launcher { transition: opacity 0.2s ease, transform 0.2s ease; }
}


/* Welcome: what the expert can do */
.advisor-welcome.caps h3 em { font-style: normal; }
.cap-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; }
.cap { position: relative; display: grid; gap: 4px; text-align: left; padding: 14px 34px 14px 14px; border: 1px solid var(--line); background: #fff; border-radius: 10px; cursor: pointer; color: var(--ink); transition: border-color 0.2s, transform 0.2s; }
.cap:hover, .cap.on { border-color: var(--orange); transform: translateY(-2px); }
.cap b { font-size: 15px; }
.cap small { font-size: 12px; color: var(--muted); line-height: 1.4; }
.cap span { position: absolute; top: 12px; right: 12px; color: var(--orange); }
.cap-panel { margin-top: 14px; padding: 14px; border-radius: 10px; background: var(--surface); animation: co-in 0.3s ease forwards; }
.cap-h { font-weight: 650; margin: 0 0 10px; }
.cap-note { font-size: 13px; color: var(--muted); margin: 0; }
.cap-artists { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.cap-artists button { border: 0; padding: 0; background: #fff; border-radius: 8px; overflow: hidden; cursor: pointer; text-align: left; }
.cap-artists img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.cap-artists span { display: block; padding: 6px 8px; font-size: 12px; font-weight: 600; color: var(--ink); }
.cap-artists button:hover span { color: var(--orange); }
.cap-select { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.cap-select select, .cap-compare select { flex: 1; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: #fff; color: var(--ink); }
.cap-compare { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cap-compare button { border: 0; background: var(--orange); color: #fff; padding: 10px 16px; border-radius: 6px; font-weight: 650; cursor: pointer; }
@media (max-width: 520px) { .cap-grid { grid-template-columns: 1fr; } .cap-artists { grid-template-columns: repeat(2, 1fr); } }

/* Phones: a compact "Ask me anything" pill in the corner, not a banner over the page. */
@media (max-width: 650px) {
  .chat-launcher, body:has(.product-page) .chat-launcher { left: auto; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom)); width: auto; height: auto; min-width: 0; padding: 12px 16px; gap: 10px; border-radius: 999px; justify-content: center; }
  .chat-launcher .launcher-text small, .chat-launcher > span:last-child { display: none; }
  body:has(.product-page) .chat-launcher > span.launcher-text { display: flex; }
  .chat-launcher .launcher-text strong { font-size: 15px; }
  .chat-launcher > .launcher-wave .chat-icon, .chat-launcher .chat-icon { width: 22px; height: 22px; }
  body { padding-bottom: 76px; }
}
