/* Opt-in refinement of the selected start and end mock, not the alternatives. */
body[data-chat-capsules] .popup-messages { padding: 22px 26px 10px; }
body[data-chat-capsules] .popup-composer { padding-left: 26px; padding-right: 26px; }
body[data-chat-capsules] .popup-compose-row:focus-within { outline: none; outline-offset: 0; border-color: #8193b5; box-shadow: none; }
body[data-chat-capsules] .popup-head { padding-left: 12px; padding-right: 12px; gap: 10px; }
body[data-chat-capsules] .popup-head-leading { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
body[data-chat-capsules] .popup-head-leading #popup-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body[data-chat-capsules] .popup-head-actions { gap: 8px; flex: none; }
body[data-chat-capsules] .popup-back { display: grid; place-items: center; width: 32px; height: 32px; flex: none; padding: 6px; border: 0; border-radius: 50%; background: transparent; color: #596779; cursor: pointer; }
body[data-chat-capsules] .popup-back svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
body[data-chat-capsules] .popup-back:disabled { opacity: .3; cursor: default; }
body[data-chat-capsules] .popup-back:enabled:hover { background: #edf2ff; color: var(--blue); }
body[data-chat-capsules] .popup-back:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
/* Keep the actual corner and both edges draggable; the header now owns Back. */
body[data-chat-capsules] #popup-resize { top: 0; left: 0; width: 12px; height: 12px; padding: 0; border-radius: 0; }
body[data-chat-capsules] #popup-resize svg { opacity: 0; }
body[data-chat-capsules] #popup-resize:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
body[data-chat-capsules] :is(.choice-icon-premium, .question-icon-premium) { display: block; width: 18px; height: 18px; flex: none; fill: none; stroke: var(--blue); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
body[data-chat-capsules] .example-suggestions .choice,
body[data-chat-capsules] .example-suggestions .choice[data-service] { gap: 8px; padding: 10px 14px 10px 20px; min-height: 48px; text-align: left; }
body[data-chat-capsules] .example-suggestions .choice > span { min-width: 0; flex: 1; hyphens: auto; overflow-wrap: anywhere; }
body[data-chat-capsules] .choice[data-choice] .choice-check { width: 14px; height: 14px; }
body[data-chat-capsules] .entry-prominent { padding-left: 20px; }
/* Chosen wishes share one colour; service classification stays out of the composer. */
body[data-chat-capsules] .picked-token { padding-left: 13px; background: var(--nx-light-blue-f2f5ff,#f2f5ff); border-color: #e0e7ff; color: var(--blue); outline: none; box-shadow: none; }
body[data-chat-capsules] .picked-token:is(:hover,:focus-visible) { border-color: var(--blue); outline: none; outline-offset: 0; }
body[data-chat-capsules] .picked-token:last-child { margin-inline-end: 8px; }
body[data-chat-capsules] .picked-token .choice-icon-premium { width: 14px; height: 14px; }
body[data-chat-capsules] .answer-alternatives .choice svg { width: 18px; height: 18px; }
body[data-chat-capsules] .popup-question { display: flex; align-items: flex-start; gap: 10px; }
body[data-chat-capsules] .popup-question > .question-icon-premium { width: 22px; height: 22px; margin-top: 3px; }
body[data-chat-capsules] .history-question { margin: 0 0 12px; }
/* Completed turns recede; the current question keeps its blue accent. */
body[data-chat-capsules] .history-question > p,
body[data-popup][data-chat-capsules] .popup-message.history-question > p { display: inline-flex; align-items: center; gap: 8px; width: fit-content; max-width: 92%; min-height: 34px; margin: 0; padding: 5px 18px; border: 2px solid #dce3f8; border-radius: 999px; background: #f7f9ff; font-size: 14px; line-height: 1.4; color: #5068d8; }
body[data-chat-capsules] .history-question > p > span { min-width: 0; overflow-wrap: anywhere; color: inherit; }
body[data-chat-capsules] .popup-message.history-response { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; width: 92%; max-width: 92%; margin: 0 0 22px auto; padding: 0; background: none; border-radius: 0; }
body[data-chat-capsules] .history-answer-choices { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; max-width: 100%; min-width: 0; }
body[data-chat-capsules] .history-answer-capsule { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-height: 34px; padding: 5px 18px; border: 2px solid #e3e7ee; border-radius: 999px; background: #fafbfc; color: #677489; font: inherit; font-size: 14px; line-height: 1.4; text-align: left; cursor: pointer; }
body[data-chat-capsules] .history-answer-capsule > span { min-width: 0; overflow-wrap: anywhere; }
body[data-chat-capsules] .history-edit { display: flex; flex: none; opacity: 0; }
body[data-chat-capsules] .history-edit svg { width: 14px; height: 14px; }
body[data-chat-capsules] .history-answer-capsule .choice-icon-premium { stroke: #909aaa; }
body[data-chat-capsules] .history-answer-capsule:is(:hover,:focus-visible) { border-color: #8e9eaf; background: #fff; color: #17243b; }
body[data-chat-capsules] .history-answer-capsule:is(:hover,:focus-visible) .choice-icon-premium { stroke: var(--blue); }
body[data-chat-capsules] .history-answer-capsule:is(:hover,:focus-visible) .history-edit { opacity: 1; }
body[data-chat-capsules] .history-answer-text { position: relative; width: fit-content; max-width: 100%; padding: 10px 38px 10px 14px; border: 2px solid #e3e7ee; border-radius: 20px; background: #fafbfc; color: #677489; font-size: 15px; line-height: 1.5; }
body[data-chat-capsules] .history-answer-text:is(:hover,:focus-within) { border-color: #8e9eaf; background: #fff; color: #17243b; }
body[data-chat-capsules] .history-answer-text p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
body[data-chat-capsules] .history-text-edit { display: grid; place-items: center; position: absolute; right: 5px; top: 7px; width: 28px; height: 28px; padding: 5px; border: 0; border-radius: 50%; background: transparent; color: var(--blue); opacity: 0; cursor: pointer; }
body[data-chat-capsules] .history-text-edit svg { width: 16px; height: 16px; }
body[data-chat-capsules] .history-answer-text:is(:hover,:focus-within) .history-text-edit { opacity: 1; }
body[data-chat-capsules] :is(.history-answer-capsule,.history-text-edit):focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
body[data-chat-capsules][data-result-mock=contrast] .rm-answer-heading .outcome-input-question { display: inline-flex; align-items: center; gap: 8px; padding-left: 18px; padding-right: 18px; }
body[data-chat-capsules][data-result-mock=contrast] .rm-answer-capsule { padding-left: 18px; padding-right: 18px; }
body[data-chat-capsules][data-result-mock=contrast] .rm-answer-capsule .choice-icon-premium { opacity: 1; width: 18px; height: 18px; stroke: var(--blue); }
@container kansenvinder (max-width: 420px) {
  body[data-chat-capsules] .popup-messages { padding-left: 20px; padding-right: 20px; }
  body[data-chat-capsules] .popup-composer { padding-left: 20px; padding-right: 20px; }
  body[data-chat-capsules] .popup-head-leading { gap: 6px; }
  body[data-chat-capsules] .popup-head-leading #popup-title { font-size: 17px; }
  body[data-chat-capsules] .popup-head-actions { gap: 4px; }
  body[data-chat-capsules] .entry-prominent { padding-left: 18px; }
  body[data-chat-capsules] .example-suggestions .choice,
  body[data-chat-capsules] .example-suggestions .choice[data-service] { padding: 10px 12px 10px 18px; gap: 7px; min-height: 56px; }
  body[data-chat-capsules] .example-suggestions .choice > .choice-icon-premium { width: 16px; height: 16px; }
  body[data-chat-capsules] .history-question > p { max-width: 95%; }
  body[data-chat-capsules] .popup-message.history-response { width: 95%; max-width: 95%; }
}
@media (hover: none), (pointer: coarse) {
  body[data-chat-capsules] :is(.history-edit,.history-text-edit) { opacity: 1; }
}

/* Keep contact available without making the answer send control ambiguous. */
body[data-chat-capsules] .conversation-contact { display: flex; justify-content: flex-end; margin-top: 8px; }
body[data-chat-capsules] .conversation-contact .small-link { color: #5e718f; font-size: 12px; padding: 4px 0; }
body[data-chat-capsules] .conversation-contact .small-link:hover { color: var(--blue); }


/* Narrow choice capsules wrap between words; selected state and action remain unchanged. */
@container kansenvinder (max-width: 360px) {
  body[data-brief][data-chat-capsules] .example-suggestions .choice > span,
  body[data-brief][data-chat-capsules] .choice[data-choice] .work-icon ~ span {
    hyphens: none;
    overflow-wrap: normal;
    word-break: normal;
  }
}
