/* Site chat v2 with Aura after the test: Figma «Аура дизайн», sections «V2 · …» (mobile and 1440) and
   «Компоненты v2 · результат в чате». Tokens are declared in psy-test-flow.css. The conversation is a scene:
   full screen on phones, a 1200 px block under the site header on desktop. Saved prechat cards П1–П6 stay inline. */

/* ── Shared pieces ─────────────────────────────────────────────────────── */
.ptf-hue--teal { --ptf-hue: var(--ptf-logo-teal); } .ptf-hue--green { --ptf-hue: var(--ptf-logo-green); }
.ptf-hue--sand { --ptf-hue: var(--ptf-logo-sand); } .ptf-hue--coral { --ptf-hue: var(--ptf-logo-coral); }
.ptf-hue--lilac { --ptf-hue: var(--ptf-logo-lilac); }
/* BeckFlow/AuraIcon: hearts keep the inset of their 24 px frame, the bulb rises 1.7 % above it. */
.ptf-emoji { display: inline-flex; flex: none; align-items: center; justify-content: center; width: var(--ptf-emoji); height: var(--ptf-emoji); }
.ptf-emoji img { display: block; width: 100%; height: 100%; margin: 0; }
.ptf-emoji--heart-lilac img { width: 90.33%; height: 79.77%; }
.ptf-emoji--insight img { height: 101.7%; margin-top: -1.7%; }
.ptf-flower { display: block; flex: none; width: var(--ptf-flower); height: var(--ptf-flower); margin: 0; padding: 2%; object-fit: contain; }
/* BeckFlow/ResultAction. */
.ptf-action { display: inline-flex; flex: none; align-items: center; justify-content: center; gap: 6px; margin: 0; padding: 9px 14px 9px 12px; border: 1px solid var(--ptf-border-secondary-2); border-radius: 999px; background: var(--ptf-bg-surface); cursor: pointer; font: 600 13px/18px var(--ptf-font); color: var(--ptf-content-primary); white-space: nowrap; transition: background-color .15s; }
.ptf-action:hover { background: var(--ptf-bg-secondary); }
.ptf-action--soft { padding: 9px 12px 9px 14px; background: var(--ptf-bg-primary); }
.ptf-level { display: inline-flex; flex: none; align-items: center; gap: 8px; padding: 7px 14px 7px 12px; border-radius: 999px; background: rgb(var(--ptf-hue, var(--ptf-logo-sand)) / .32); font: 600 13px/18px var(--ptf-font); color: var(--ptf-content-primary); white-space: nowrap; }
.ptf-level__dot { width: 8px; height: 8px; border-radius: 50%; background: rgb(var(--ptf-hue, var(--ptf-logo-sand))); }

/* Calm scale: muted level segments, the current one accented, the marker on the score. */
.ptf-cs { position: relative; width: 100%; height: 38px; }
.ptf-cs--legend { height: 40px; }
.ptf-cs__track { position: absolute; top: 5px; left: 0; right: 0; display: grid; gap: 3px; height: 8px; }
.ptf-cs__segment { border-radius: 4px; background: rgb(var(--ptf-hue) / .28); }
.ptf-cs__segment.is-current { background: rgb(var(--ptf-hue)); }
.ptf-cs__marker { position: absolute; top: 0; left: 0; width: 18px; height: 18px; border: 4px solid rgb(var(--ptf-hue, var(--ptf-logo-sand))); border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(102, 77, 51, .15); transform: translateX(-50%); }
.ptf-cs__end { position: absolute; top: 22px; font: 500 12px/14px var(--ptf-font); color: var(--ptf-content-tertiary); }
.ptf-cs--legend .ptf-cs__end { top: 24px; }
.ptf-cs__end--min { left: 0; } .ptf-cs__end--max { right: 0; }
.ptf-cs__legend { position: absolute; top: 22px; left: 0; right: 0; display: grid; gap: 3px; font: 600 13px/18px var(--ptf-font); color: var(--ptf-content-secondary); }
.ptf-cs__legend span { justify-self: center; white-space: nowrap; }
.ptf-cs__legend span:first-child { justify-self: start; } .ptf-cs__legend span:last-child { justify-self: end; }

/* ── Chat block: saved prechat cards in the page (П1–П6) ─────────────────── */
.ptf-chat { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1.5px solid var(--ptf-border-brand-subtle); border-radius: 24px; background: var(--ptf-bg-surface); }
.ptf-chat__glow { display: none; }
.ptf-chat__intro { display: flex; align-items: center; gap: 10px; }
.ptf-chat__intro-avatar { display: flex; flex: none; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ptf-bg-primary); }
.ptf-chat__intro-title { font-weight: 600; }
.ptf-chat__intro-subtitle { margin-top: 2px !important; font-size: 12px; line-height: 14px; color: var(--ptf-content-tertiary); }
.ptf-chat__bar { display: none; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--ptf-border-secondary-2); background: var(--ptf-bg-primary); }
.ptf-chat__avatar { display: flex; flex: none; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--ptf-border-secondary-2); border-radius: 50%; background: var(--ptf-bg-surface); }
.ptf-chat__avatar .ptf-favicon { width: 24px; height: 24px; }
.ptf-chat__who { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.ptf-chat__name { font-weight: 600; }
.ptf-chat__status { display: flex; align-items: center; gap: 6px; font-size: 12px; line-height: 14px; color: var(--ptf-content-tertiary); white-space: nowrap; }
.ptf-chat__wide, .ptf-chat__wide-action { display: none; }
.ptf-chat__bar .ptf-pill { align-self: center; white-space: nowrap; }
.ptf-chat__close { display: flex; flex: none; align-items: center; justify-content: center; width: 40px; height: 40px; margin: 0; padding: 0; border: 1px solid var(--ptf-border-secondary-2); border-radius: 12px; background: var(--ptf-bg-surface); cursor: pointer; }
.ptf-chat__messages { max-height: 560px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.ptf-chat__list { display: flex; flex-direction: column; gap: 12px; container-type: inline-size; }
.ptf-chat__footer { display: flex; flex-direction: column; gap: 8px; }
.ptf-chat__footnote { font-size: 12px; line-height: 14px; color: var(--ptf-content-tertiary); text-align: center; }
.ptf-chat__error { font-size: 14px; line-height: 20px; color: var(--ptf-state-error-text); }
.ptf-chat__footer > .ptf-btn--plain { align-self: flex-start; }

/* ── The scene: full screen on phones, 1200 px under the site header on desktop ── */
.ptf-chat.is-scene { gap: 0; padding: 0; overflow: hidden; background: var(--ptf-bg-primary); }
.is-scene .ptf-chat__intro { display: none; }
.is-scene .ptf-chat__bar { position: relative; z-index: 1; display: flex; }
.is-scene .ptf-chat__messages { position: relative; display: flex; flex: 1; flex-direction: column; min-height: 0; max-height: none; padding: 16px; }
.is-scene .ptf-chat__list { margin-top: auto; }
.is-scene .ptf-chat__footer { position: relative; padding: 8px 16px 12px; border-top: 1px solid var(--ptf-border-secondary-2); background: var(--ptf-bg-primary); }
.is-scene .ptf-chat__footer > .ptf-btn--plain { align-self: center; }
.is-scene .ptf-chat__error { text-align: center; }
.is-scene .ptf-chat__caption { padding: 0 16px 16px; }
@media (max-width: 767px) {
  .ptf-chat.is-scene { position: fixed; z-index: 10050; top: var(--ptf-vv-top, 0); left: 0; right: 0; height: var(--ptf-vv-height, 100dvh); border: 0; border-radius: 0; }
  .is-scene .ptf-chat__footer { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
}
@media (min-width: 768px) {
  /* The scene takes the place of the test and the page title (Д3–Д7). */
  body.ptf-scene-open .ptf-page-header { display: none; }
  .ptf.is-scene > :not(.ptf-chat, template, script) { display: none !important; }
  .ptf-chat.is-scene { --ptf-scene: min(1200px, calc(100vw - 48px)); width: var(--ptf-scene); height: calc(100dvh - 134px); min-height: 560px; margin-left: calc((100% - var(--ptf-scene)) / 2); border-radius: 28px; }
  .is-scene .ptf-chat__glow { position: absolute; top: -160px; left: 50%; display: block; width: 1000px; max-width: none; height: 520px; margin: 0; transform: translateX(-50%); pointer-events: none; }
  .is-scene .ptf-chat__bar { height: 72px; padding: 14px 20px 14px 24px; background: transparent; }
  .is-scene .ptf-chat__avatar { width: 44px; height: 44px; }
  .is-scene .ptf-chat__avatar .ptf-favicon { width: 26px; height: 26px; }
  .is-scene .ptf-chat__name { font-size: 14px; font-weight: 700; line-height: 20px; }
  .is-scene .ptf-chat__wide { display: inline; }
  .is-scene .ptf-chat__wide-action { display: inline-flex; }
  .is-scene .ptf-chat__close { display: none; }
  .is-scene .ptf-chat__messages { padding: 16px 24px; }
  .is-scene .ptf-chat__list { width: 100%; max-width: 760px; margin-inline: auto; }
  .is-scene .ptf-chat__footer { gap: 10px; padding: 12px 24px 14px; }
  .is-scene .ptf-chat__footer > :not(.ptf-btn) { width: 100%; max-width: 760px; margin-inline: auto; }
  .is-scene .ptf-chips { justify-content: center; }
  .is-scene .ptf-input { padding-inline: 16px; }
}

/* ── Messages ───────────────────────────────────────────────────────────── */
.ptf-msg--aura { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border: 1px solid var(--ptf-border-secondary-2); border-radius: 20px; background: var(--ptf-bg-surface); }
.ptf-msg__author { display: flex; align-items: center; gap: 6px; font: 600 13px/18px var(--ptf-font); color: var(--ptf-content-tertiary); }
.ptf-msg__text { white-space: pre-wrap; overflow-wrap: anywhere; }
.ptf-msg--aura.is-streaming .ptf-msg__text { color: var(--ptf-content-secondary); }
.ptf-msg--user { display: flex; justify-content: flex-end; }
.ptf-msg__bubble { display: flex; flex-direction: column; gap: 4px; max-width: 81%; padding: 12px 16px; border-radius: 20px 20px 6px 20px; background: linear-gradient(90deg, #ff8f68, #ffb489); color: var(--ptf-content-static-white); }
.ptf-msg__status { font-size: 12px; line-height: 14px; opacity: .8; }
.ptf-system { display: flex; justify-content: center; }
.ptf-system span { padding: 6px 12px; border-radius: 999px; background: var(--ptf-bg-tertiary); font-size: 12px; line-height: 14px; color: var(--ptf-content-secondary); text-align: center; }
/* BeckFlow/TestAttachment. */
.ptf-attach { display: flex; align-items: center; gap: 12px; max-width: 100%; padding: 12px 16px 12px 12px; border-radius: 20px 20px 6px 20px; background: linear-gradient(90deg, #ff8f68, #ffb489); color: var(--ptf-content-static-white); }
.ptf-attach__icon { display: flex; flex: none; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: rgba(255, 255, 255, .22); }
.ptf-attach__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ptf-attach__title { font-size: 14px; font-weight: 700; line-height: 20px; }
.ptf-attach__meta { font-size: 12px; line-height: 14px; opacity: .85; }
.ptf-hint { display: flex; align-items: flex-start; gap: 8px; padding: 12px; border-radius: 20px; background: var(--ptf-bg-secondary-3); font-size: 14px; line-height: 20px; color: var(--ptf-content-secondary); }
.ptf-limit { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px 12px 12px; border-radius: 16px; background: var(--ptf-bg-info); font-size: 14px; line-height: 20px; }
@container (min-width: 600px) {
  .ptf-msg--aura:not(.ptf-msg--result), .ptf-hint, .ptf-limit { max-width: 640px; }
  .ptf-msg__bubble { max-width: 460px; }
}

/* BeckFlow/AuraResultMessage with BeckFlow/ResultCard; ResultCardWide from 600 px of the list. */
.ptf-msg--result { gap: 10px; padding: 14px 16px 16px; }
.ptf-rc { display: flex; flex-direction: column; gap: 16px; padding: 16px; border-radius: 16px; background: var(--ptf-bg-primary); }
.ptf-rc__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 12px; }
.ptf-rc__score-box { display: flex; flex-direction: column; gap: 2px; }
.ptf-rc__overline { font: 600 12px/16px var(--ptf-font); letter-spacing: .6px; text-transform: uppercase; color: var(--ptf-content-tertiary); }
.ptf-rc__score { display: flex; align-items: baseline; gap: 8px; color: var(--ptf-content-tertiary); }
.ptf-rc__value { font-size: 40px; font-weight: 700; line-height: 48px; color: var(--ptf-content-primary); }
.ptf-rc__text { color: var(--ptf-content-primary-2); }
.ptf-rc__details { display: flex; flex-direction: column; gap: 16px; padding-top: 16px; border-top: 1px solid var(--ptf-border-secondary-2); }
.ptf-rc__group { display: flex; flex: 1; flex-direction: column; gap: 10px; min-width: 0; }
.ptf-rc__group--top { gap: 8px; }
.ptf-rc__heading { font: 600 13px/18px var(--ptf-font); color: var(--ptf-content-tertiary); }
.ptf-rc__bar { display: flex; flex-direction: column; gap: 6px; }
.ptf-rc__bar-head { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; line-height: 20px; color: var(--ptf-content-primary-2); }
.ptf-rc__bar-value { flex: none; color: var(--ptf-content-tertiary); }
.ptf-rc__track { display: block; height: 6px; overflow: hidden; border-radius: 3px; background: var(--ptf-border-secondary-2); }
.ptf-rc__fill { display: block; width: 0; height: 100%; border-radius: 3px; background: rgb(var(--ptf-hue) / .85); }
.ptf-rc__symptoms { display: flex; flex-direction: column; gap: 8px; }
.ptf-rc__symptoms li { display: flex; align-items: center; gap: 10px; font-size: 14px; line-height: 20px; color: var(--ptf-content-primary-2); }
.ptf-rc__symptoms li::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: rgb(var(--ptf-hue) / .9); }
.ptf-rc__footer { display: flex; flex-direction: column; gap: 10px; }
.ptf-rc__actions { display: flex; gap: 8px; }
.ptf-rc__actions .ptf-action { flex: 1 1 0; min-width: 0; padding-block: 12px; }
.ptf-rc__note { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; line-height: 14px; color: var(--ptf-content-tertiary); }
.ptf-rc__note a { color: var(--ptf-content-accent); text-decoration: none; }
.ptf-rc__note a:hover { text-decoration: underline !important; }
@container (min-width: 600px) {
  .ptf-msg--result { gap: 12px; padding: 16px; }
  .ptf-rc { padding: 20px; border-radius: 20px; }
  .ptf-rc__head { flex-wrap: nowrap; }
  .ptf-rc__details { flex-direction: row; gap: 28px; }
  .ptf-rc__footer { flex-direction: row; align-items: center; justify-content: space-between; }
  .ptf-rc__note { order: -1; }
  .ptf-rc__actions .ptf-action { flex: none; padding-block: 9px; }
}

/* ── Footer: BeckFlow/SuggestionChip row, ChatInput, caption ─────────────── */
.ptf-chips { display: flex; gap: 8px; margin: 0 -16px; padding: 0 16px 2px; overflow-x: auto; scrollbar-width: none; }
.ptf-chips::-webkit-scrollbar { display: none; }
.ptf-chip { display: inline-flex; flex: none; align-items: center; gap: 8px; margin: 0; padding: 8px 14px 8px 8px; border: 1px solid var(--ptf-border-brand-subtle); border-radius: 999px; background: var(--ptf-bg-surface); box-shadow: 0 2px 3px rgba(255, 153, 102, .08); cursor: pointer; font: 600 13px/18px var(--ptf-font); color: var(--ptf-content-primary); white-space: nowrap; }
.ptf-chip:hover { background: var(--ptf-bg-secondary); }
.ptf-input { margin: 0; }
.ptf-input__main { display: flex; align-items: center; gap: 12px; min-height: 64px; margin: 0; padding: 8px 8px 8px 16px; border: 2px solid var(--ptf-border-secondary); border-radius: 999px; background: var(--ptf-bg-surface); transition: border-color .15s; }
.ptf-input__main:focus-within { border-color: var(--ptf-border-brand-subtle); }
.ptf-input__main textarea { flex: 1; min-width: 0; min-height: 24px; max-height: 120px; margin: 0; padding: 0; border: 0; outline: 0; resize: none; background: transparent; box-shadow: none; font: 500 16px/24px var(--ptf-font); color: var(--ptf-content-primary); }
.ptf-input__main textarea::placeholder { color: var(--ptf-content-placeholder); opacity: 1; }
.ptf-input__main textarea:focus-visible { outline: none; }
.ptf-input__send { display: flex; flex: none; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: var(--ptf-gradient-solid); cursor: pointer; }
.ptf-input__send:disabled { opacity: .5; cursor: default; }
.ptf-input__send .ptf-icon { transform: translate(-1px, 1px); }
/* Closed field: before the intro card, after the handoff and in the crisis branch. */
.ptf-chat__locked { display: flex; flex-direction: column; gap: 6px; padding: 15px 16px 18px; border-top: 1px solid var(--ptf-border-secondary-2); background: var(--ptf-bg-primary); }
.ptf-chat__locked-title { display: flex; align-items: center; justify-content: center; gap: 8px; font: 600 13px/18px var(--ptf-font); color: var(--ptf-content-tertiary); text-align: center; }
.ptf-chat__locked[data-variant="crisis"] .ptf-chat__locked-title { justify-content: flex-start; color: var(--ptf-content-secondary); text-align: left; }
.ptf-chat__locked-text { font-size: 12px; line-height: 14px; color: var(--ptf-content-tertiary); }
.ptf-chat:not(.is-scene) .ptf-chat__locked { padding: 16px 0 4px; background: none; }
.ptf-chat__caption { font-size: 12px; line-height: 14px; color: var(--ptf-content-tertiary); text-align: center; }
.ptf-chat__caption.is-panel { padding-top: 14px; border-top: 1px solid var(--ptf-border-secondary-2); }

/* ── BeckFlow/IntroCard: the only form, inside the conversation ──────────── */
.ptf-intro { display: flex; flex-direction: column; overflow: hidden; margin: 0; border: 1.5px solid var(--ptf-border-brand-subtle); border-radius: 24px; background: var(--ptf-bg-surface); box-shadow: var(--ptf-shadow-sm); }
.ptf-intro__hero { display: flex; align-items: center; gap: 14px; padding: 16px; background: linear-gradient(159deg, #ffece2 0%, #f0e4f6 100%); }
.ptf-intro__lead { display: flex; flex: 1; flex-direction: column; gap: 4px; min-width: 0; }
.ptf-intro__title { font: 600 18px/24px var(--ptf-font); color: var(--ptf-content-primary); }
.ptf-intro__title:focus { outline: none; }
.ptf-intro__text { font-size: 14px; line-height: 20px; color: var(--ptf-content-secondary); }
.ptf-intro__body { display: flex; flex-direction: column; gap: 16px; padding: 16px; }
.ptf-field { display: flex; flex-direction: column; gap: 8px; margin: 0; }
.ptf-field__label { float: none; width: auto; margin: 0 0 8px; padding: 0; font: 600 13px/18px var(--ptf-font); color: var(--ptf-content-primary); }
.ptf-field .ptf-field__label { margin: 0; }
.ptf-field__input { width: 100%; min-height: 56px; margin: 0; padding: 14.5px 16px; border: 1.5px solid var(--ptf-border-secondary); border-radius: 16px; background: var(--ptf-bg-tertiary); font: 500 16px/24px var(--ptf-font); color: var(--ptf-content-primary); caret-color: var(--ptf-border-brand-strong); }
.ptf-field__input:focus { border-color: var(--ptf-border-brand-strong); outline: none; }
.ptf-address { min-width: 0; margin: 0; padding: 0; border: 0; }
.ptf-address__options { display: flex; gap: 8px; }
.ptf-address__options .ptf-option { flex: 1 1 0; min-width: 0; }
.ptf-intro__checks { display: flex; flex-direction: column; gap: 12px; }
.ptf-check { display: flex; align-items: flex-start; gap: 12px; margin: 0; cursor: pointer; font: 500 16px/24px var(--ptf-font); color: var(--ptf-content-primary); }
.ptf-check__label { flex: 1; }
/* main.css removes underlines from every link with !important. */
.ptf-check a { color: var(--ptf-content-accent); text-decoration: underline !important; }
.ptf-intro__age { font-size: 12px; line-height: 14px; color: var(--ptf-content-tertiary); text-align: center; }
.ptf-intro__privacy { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12px; line-height: 14px; color: var(--ptf-content-tertiary); }
.ptf-intro__captcha { font-size: 11px; line-height: 14px; color: var(--ptf-content-tertiary); text-align: center; }
.ptf-intro__captcha a { color: inherit; text-decoration: underline !important; }
.ptf-intro .ptf-chat__error { text-align: center; }
@container (min-width: 600px) {
  .ptf-intro { width: 100%; max-width: 560px; margin-inline: auto; }
  .ptf-intro__hero { padding: 20px; }
  .ptf-intro__hero .ptf-flower { --ptf-flower: 52px !important; }
  .ptf-intro__title { font-size: 20px; line-height: 28px; }
  .ptf-intro__body { padding: 20px; }
}

/* ── BeckFlow/HandoffCard and BeckFlow/AppFeatureTile ─────────────────────── */
.ptf-handoff { display: flex; flex-direction: column; overflow: hidden; border: 1.5px solid var(--ptf-border-brand-subtle); border-radius: 24px; background: var(--ptf-bg-surface); box-shadow: var(--ptf-shadow-sm); }
.ptf-handoff__hero { display: flex; flex-direction: column; gap: 12px; padding: 16px; background: linear-gradient(157deg, #ffece2 0%, #f0e4f6 100%); }
.ptf-handoff__top { display: flex; align-items: center; gap: 12px; }
.ptf-handoff__lead { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
.ptf-handoff__title { font: 600 18px/24px var(--ptf-font); color: var(--ptf-content-primary); }
.ptf-handoff__text { display: none; font-size: 14px; line-height: 20px; color: var(--ptf-content-secondary); }
.ptf-saved { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 6px; border-radius: 999px; background: var(--ptf-state-success-bg); font: 600 13px/18px var(--ptf-font); color: var(--ptf-state-success-text); }
.ptf-handoff__saved { display: flex; flex-wrap: wrap; gap: 6px; }
.ptf-saved--item { padding: 5px 10px 5px 6px; background: rgba(255, 255, 255, .75); font-size: 12px; font-weight: 500; line-height: 14px; color: var(--ptf-content-primary); }
.ptf-handoff__body { display: flex; flex-direction: column; gap: 12px; padding: 16px; }
.ptf-handoff__overline { font: 600 12px/16px var(--ptf-font); letter-spacing: .6px; text-transform: uppercase; color: var(--ptf-content-tertiary); }
.ptf-handoff__tiles { display: flex; flex-direction: column; gap: 8px; }
.ptf-tile { display: flex; align-items: flex-start; gap: 12px; padding: 12px 16px 12px 14px; border-radius: 20px; }
.ptf-tile--summary { background: linear-gradient(156deg, #d7eaac 0%, #b4d7c8 100%); }
.ptf-tile--diary { background: linear-gradient(156deg, #a8d8ea 0%, #c7ceea 100%); }
.ptf-tile--insight { background: linear-gradient(156deg, #ffe8be 0%, #ffd6c8 100%); }
.ptf-tile__content { display: flex; flex: 1; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; font-size: 14px; line-height: 20px; }
.ptf-tile__title { font-weight: 700; color: var(--ptf-content-primary); }
.ptf-tile__text { color: var(--ptf-content-primary-2); }
.ptf-tile__badge { display: none; padding: 5px 10px; border-radius: 999px; background: rgba(255, 255, 255, .65); font: 600 13px/18px var(--ptf-font); color: var(--ptf-content-primary); }
.ptf-handoff__cta { display: flex; flex-direction: column; gap: 12px; }
.ptf-handoff__free { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 16px; background: var(--ptf-bg-secondary); font-size: 14px; line-height: 20px; }
.ptf-handoff__note { font-size: 12px; line-height: 14px; color: var(--ptf-content-tertiary); text-align: center; }
@container (min-width: 600px) {
  .ptf-handoff { width: 100%; max-width: 680px; margin-inline: auto; }
  .ptf-handoff__hero { gap: 16px; padding: 24px 24px 20px; }
  .ptf-handoff__top { gap: 16px; }
  .ptf-handoff__top .ptf-flower { --ptf-flower: 64px !important; }
  .ptf-handoff__title { font-size: 20px; line-height: 28px; }
  .ptf-handoff__title .ptf-chat__wide, .ptf-handoff__note .ptf-chat__wide { display: inline; }
  .ptf-handoff__short { display: none; }
  .ptf-handoff__text { display: block; }
  .ptf-handoff__body { gap: 16px; padding: 20px 24px 24px; }
  .ptf-handoff__tiles { flex-direction: row; gap: 10px; }
  .ptf-tile { flex: 1 1 0; flex-direction: column; padding: 16px; }
  .ptf-tile .ptf-emoji { --ptf-emoji: 48px !important; }
  .ptf-tile__content { flex: 1; gap: 6px; }
  .ptf-tile__badge { display: inline-block; margin-top: auto; }
  .ptf-handoff__cta { flex-direction: row; align-items: stretch; }
  .ptf-handoff__free { flex: 1; padding-block: 10px; }
  .ptf-handoff__cta .ptf-btn { flex: none; width: 240px; }
  .ptf-handoff__note { text-align: right; }
}

/* ── Status blocks of the saved prechat (П1–П6) and the crisis card (10) ── */
.ptf-status { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; padding: 20px; border: 1px solid var(--ptf-border-secondary-2); border-radius: 20px; background: var(--ptf-bg-surface); }
.ptf-status__icon { display: flex; flex: none; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 999px; background: var(--ptf-bg-secondary); }
.ptf-status__text { display: flex; flex-direction: column; gap: 6px; width: 100%; }
.ptf-status__title { font: 600 18px/24px var(--ptf-font); color: var(--ptf-content-primary); }
.ptf-status__body { font-size: 14px; line-height: 20px; color: var(--ptf-content-secondary); }
.ptf-status__actions { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.ptf-status__error { width: 100%; font-size: 14px; line-height: 20px; color: var(--ptf-state-error-text); }
.ptf-status__note { width: 100%; font-size: 12px; line-height: 14px; color: var(--ptf-content-tertiary); text-align: center; }
/* Button Secondary: Medium in the card, XSmall in the chat header. */
.ptf-btn--secondary { padding: 12px 20px; border: 1px solid var(--ptf-border-secondary); border-radius: 12px; background: var(--ptf-bg-primary); color: var(--ptf-content-primary-2); font-size: 16px; font-weight: 600; line-height: 24px; }
.ptf-btn--secondary:hover { background: var(--ptf-bg-secondary); }
.ptf-btn--xs { flex: none; padding: 6px 12px; border-radius: 8px; font-size: 13px; line-height: 18px; white-space: nowrap; }
@media (max-width: 400px) { .ptf-status .ptf-btn { padding-inline: 12px; } }
.ptf-crisis { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 20px; background: var(--ptf-bg-error); }
.ptf-crisis__title { font: 600 16px/24px var(--ptf-font); color: var(--ptf-content-primary); }
.ptf-crisis__subtitle { font-size: 14px; line-height: 20px; color: var(--ptf-content-secondary); }
.ptf-crisis__list { display: flex; flex-direction: column; gap: 12px; }
.ptf-crisis__list:empty { display: none; }
.ptf-contact { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 16px; background: var(--ptf-bg-surface); color: inherit; text-decoration: none; }
.ptf-contact__body { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.ptf-contact__title { font-weight: 600; color: var(--ptf-content-primary); overflow-wrap: anywhere; }
.ptf-contact__text { font-size: 12px; line-height: 14px; color: var(--ptf-content-secondary); }

/* ── The page of a collapsed chat (screen 8, Д4, Д8) ───────────────────── */
/* «Проходите тест заново». */
.ptf-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 16px 14px 14px; border: 1.5px solid var(--ptf-border-brand-subtle); border-radius: 16px; background: var(--ptf-bg-surface); }
.ptf-banner__icon { display: flex; flex: none; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ptf-bg-secondary); }
.ptf-banner__text { display: flex; flex: 1 1 220px; flex-direction: column; gap: 2px; min-width: 0; font-size: 14px; line-height: 20px; color: var(--ptf-content-secondary); }
.ptf-banner__title { font-weight: 700; color: var(--ptf-content-primary); }
@media (max-width: 599px) { .ptf-banner .ptf-action { margin-left: 52px; } }
/* BeckFlow/TestStrip: Колонка on phones, Строка on desktop. */
.ptf-strip { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--ptf-border-secondary); border-radius: 16px; background: var(--ptf-bg-surface); }
.ptf-strip > .ptf-icon { position: absolute; top: 14px; left: 16px; }
.ptf-strip__text { padding-left: 28px; font: 600 13px/18px var(--ptf-font); color: var(--ptf-content-primary); }
.ptf-strip .ptf-btn--plain { padding-block: 11px; }
@media (min-width: 600px) {
  .ptf-strip { flex-direction: row; align-items: center; gap: 12px; min-height: 56px; padding: 10px 12px 10px 20px; }
  .ptf-strip > .ptf-icon { position: static; }
  .ptf-strip__text { flex: 1; padding-left: 0; }
  .ptf-strip .ptf-btn--plain { padding-block: 8px; }
}
/* BeckFlow/ResultSummary; ResultSummaryDesktop puts «Вернуться к разговору» into the head row. */
.ptf-summary { display: grid; grid-template-areas: "head" "result" "scale" "action"; gap: 14px; padding: 16px; border: 1px solid var(--ptf-border-brand-subtle); border-radius: 24px; background: var(--ptf-bg-surface); }
.ptf-summary__head { grid-area: head; display: flex; align-items: center; gap: 10px; }
.ptf-summary__avatar { display: flex; flex: none; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: var(--ptf-bg-primary); }
.ptf-summary__text { display: flex; flex: 1; flex-direction: column; gap: 2px; min-width: 0; }
.ptf-summary__title { margin: 0; font: 600 16px/24px var(--ptf-font); color: var(--ptf-content-primary); }
.ptf-summary__subtitle { font-size: 12px; line-height: 14px; color: var(--ptf-content-tertiary); }
.ptf-summary__long { display: none; }
.ptf-summary__result { grid-area: result; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ptf-summary__score { display: flex; align-items: baseline; gap: 6px; font-size: 14px; line-height: 20px; color: var(--ptf-content-secondary); }
.ptf-summary__score > :first-child { font-size: 26px; font-weight: 700; line-height: 34px; color: var(--ptf-content-primary); }
.ptf-summary .ptf-level { gap: 6px; padding: 6px 12px 6px 10px; }
.ptf-summary .ptf-cs { grid-area: scale; }
.ptf-summary > .ptf-btn { grid-area: action; }
.ptf-summary__error { grid-column: 1 / -1; font-size: 14px; line-height: 20px; color: var(--ptf-state-error-text); }
@media (min-width: 600px) {
  .ptf-summary { grid-template-areas: "head action" "result result" "scale scale"; grid-template-columns: 1fr auto; gap: 16px; padding: 24px; }
  .ptf-summary__head { gap: 12px; }
  .ptf-summary__avatar { width: 44px; height: 44px; }
  .ptf-summary__avatar .ptf-favicon { width: 26px; height: 26px; }
  .ptf-summary__subtitle { font-size: 13px; font-weight: 700; line-height: 18px; }
  .ptf-summary__short { display: none; } .ptf-summary__long { display: inline; }
  .ptf-summary__result { justify-content: flex-start; gap: 16px; }
  .ptf-summary > .ptf-btn { align-self: center; width: auto; min-height: 0; padding: 12px 20px; border-radius: 12px; font-size: 16px; line-height: 24px; }
}
/* «Чат с Аурой» in the corner. */
.ptf-float { position: fixed; z-index: 60; right: 16px; bottom: max(24px, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 8px; margin: 0; padding: 8px 16px 8px 8px; border: 1px solid var(--ptf-border-brand-subtle); border-radius: 999px; background: var(--ptf-bg-surface); box-shadow: var(--ptf-shadow-sm); cursor: pointer; font: 600 13px/18px var(--ptf-font); color: var(--ptf-content-primary); text-align: left; }
.ptf-float__avatar { display: flex; flex: none; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ptf-bg-primary); }
.ptf-float__text { display: flex; flex-direction: column; gap: 2px; white-space: nowrap; }
.ptf-float__text small { display: none; font-size: 12px; font-weight: 500; line-height: 14px; color: var(--ptf-content-tertiary); }
.ptf-float__dot { width: 8px; height: 8px; }
@media (min-width: 768px) {
  .ptf-float { right: 32px; bottom: 32px; gap: 12px; padding-right: 20px; }
  .ptf-float__avatar { width: 44px; height: 44px; }
  .ptf-float__avatar .ptf-favicon { width: 26px; height: 26px; }
  .ptf-float__text small { display: block; }
  .ptf-float__dot { width: 10px; height: 10px; }
}

/* «Сохранить в PDF» prints the card it belongs to (js/psy-test-flow/chat-result.js). */
@media print {
  body.ptf-printing > :not(.ptf-print) { display: none !important; }
  .ptf-print { display: block !important; font: 500 16px/24px var(--ptf-font); color: var(--ptf-content-primary); }
  .ptf-print .ptf-rc__actions, .ptf-print .ptf-rc__note a { display: none !important; }
  .ptf-chat, .ptf-float { display: none !important; }
}
/* Without the scene the result offers the application (external widget behaviour); the chat shows it otherwise. */
.ptf--chat:not(.ptf--app) > .ptf-result { display: none !important; }
.ptf-print { display: none; container-type: inline-size; }
