/* 趣味测试：限定 .qw- 前缀，复用 /assets/style.css 与 workshop 设计变量 */

.qw {
  --qw-accent: #047857;
  --qw-accent-ink: #04624A;
  --qw-accent-soft: rgba(4, 120, 87, .08);
  --qw-accent-line: rgba(4, 120, 87, .28);
}
.qw--rose {
  --qw-accent: #B23A5E;
  --qw-accent-ink: #94304F;
  --qw-accent-soft: rgba(178, 58, 94, .08);
  --qw-accent-line: rgba(178, 58, 94, .28);
}

.qw .ts-main { padding-bottom: 56px; }

.qw-warn {
  margin: 14px 0 0;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--qw-accent);
  border-radius: 10px;
  background: var(--card);
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted-fg);
}
.qw-warn strong { color: var(--fg); }

.qw-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 18px 0 0;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.qw-nav__item {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  font-size: 13px;
  color: var(--muted-fg);
  text-decoration: none;
}
.qw-nav__item:hover { color: var(--qw-accent); border-color: var(--qw-accent-line); }
.qw-nav__item.is-active {
  background: var(--qw-accent);
  border-color: var(--qw-accent);
  color: #fff;
  font-weight: 600;
}

.qw-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid var(--qw-accent);
  border-radius: 10px;
  background: var(--qw-accent);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}
.qw-btn:hover { opacity: .9; }
.qw-btn:active { transform: translateY(1px); }
.qw-btn--ghost { background: var(--card); color: var(--fg); border-color: var(--border); }
.qw-btn--ghost:hover { border-color: var(--qw-accent-line); color: var(--qw-accent); opacity: 1; }
.qw-btn[disabled] { opacity: .5; cursor: not-allowed; }

.qw-kicker {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--qw-accent);
  font-weight: 600;
}
.qw-page-title {
  font-family: var(--display);
  font-size: clamp(26px, 3.6vw, 34px);
  line-height: 1.25;
  margin: 0 0 10px;
}

/* ---------- 首页 ---------- */
.qw-hero {
  display: grid;
  gap: 24px;
  padding: 28px 0 8px;
}
.qw-hero__title {
  font-family: var(--display);
  font-size: clamp(28px, 4.2vw, 40px);
  line-height: 1.22;
  margin: 0 0 12px;
}
.qw-hero__lead {
  margin: 0;
  font-size: 15px;
  line-height: 1.85;
  color: var(--muted-fg);
  max-width: 60ch;
}
.qw-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--muted-fg);
}
.qw-facts strong { color: var(--fg); font-size: 16px; }
.qw-acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.qw-hero__meta { margin: 14px 0 0; font-size: 12.5px; color: var(--muted-fg); }

.qw-hero__side { display: grid; gap: 10px; align-content: start; }
.qw-topic {
  display: grid;
  gap: 2px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}
.qw-topic__name { font-size: 14px; font-weight: 600; }
.qw-topic__desc { font-size: 12.5px; color: var(--muted-fg); line-height: 1.6; }
.qw-topic__n { font-family: var(--mono); font-size: 11px; color: var(--qw-accent); }
/* 三组主题卡本身也是页内锚点链接 */
a.qw-topic { color: inherit; text-decoration: none; }
a.qw-topic:hover { border-color: var(--qw-accent-line); }
a.qw-topic:focus-visible { outline: 2px solid var(--qw-accent); outline-offset: 2px; }
.qw-topic__count { margin-left: 6px; font-family: var(--mono); font-size: 11px; font-weight: 400; color: var(--muted-fg); }
.qw-topic__go { justify-self: start; margin-top: 4px; }

/* 分组小标题：序号 + 名称，右侧条数与题数 */
.qw-group__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
  margin: 0 0 6px;
}
.qw-group__head .qw-sec__title { margin: 0; }
.qw-group__n {
  display: inline-block;
  margin-right: 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  color: var(--qw-accent);
  vertical-align: 2px;
}
.qw-group__meta { font-size: 12.5px; color: var(--muted-fg); }
/* 页内锚点跳转时给固定头留出位置 */
.qw-sec[id] { scroll-margin-top: 84px; }

.qw-sec { margin-top: 34px; }
.qw-sec--first { margin-top: 26px; }
.qw-sec__title {
  font-family: var(--display);
  font-size: clamp(20px, 2.6vw, 24px);
  line-height: 1.3;
  margin: 0 0 8px;
}
.qw-sec__lead { margin: 0 0 16px; font-size: 14px; line-height: 1.8; color: var(--muted-fg); }
.qw-sec__lead--top { margin: 24px 0 0; }
.qw-sec__lead a, .qw-sec p a { color: var(--qw-accent); }
.qw-sec > p + p { margin-top: 10px; }

.qw-cards { display: grid; gap: 14px; }
.qw-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.qw-card__kicker { margin: 0; font-size: 12px; color: var(--qw-accent); font-weight: 600; letter-spacing: .04em; }
.qw-card__title { margin: 0; font-size: 19px; line-height: 1.35; }
.qw-card__sum { margin: 0; font-size: 14px; line-height: 1.8; color: var(--muted-fg); }
.qw-card__tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.qw-card__tag {
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted-fg);
  background: var(--bg);
}
.qw-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 6px; }
.qw-card__meta { font-size: 12.5px; color: var(--muted-fg); }
.qw-card__foot .btn { flex: none; white-space: nowrap; }

.qw-soon {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.qw-soon__item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  font-size: 13.5px;
  color: var(--muted-fg);
}
.qw-soon__item b { color: var(--fg); font-weight: 600; }
.qw-soon__item span { font-size: 12px; white-space: nowrap; }

.qw-tips { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.95; color: var(--muted-fg); }
.qw-tips li { margin-bottom: 4px; }

.qw-faq { display: grid; gap: 8px; }
.qw-faq details {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  padding: 0 16px;
}
.qw-faq summary {
  cursor: pointer;
  padding: 14px 0;
  font-size: 14px;
  font-weight: 600;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.qw-faq details[open] summary { padding-bottom: 8px; }
.qw-faq p { margin: 0 0 14px; font-size: 13.5px; line-height: 1.85; color: var(--muted-fg); }

.qw-sec--note p { font-size: 13.5px; line-height: 1.85; color: var(--muted-fg); }

/* ---------- 答题 ---------- */
.qw-test { padding-top: 24px; }
.qw-test__head { margin-bottom: 18px; }
.qw-test__title { font-family: var(--display); font-size: clamp(24px, 3.4vw, 32px); margin: 0 0 8px; }
.qw-test__lead { margin: 0 0 6px; font-size: 14px; line-height: 1.8; color: var(--muted-fg); }
.qw-test__hint { margin: 0; font-size: 12.5px; line-height: 1.7; color: var(--muted-fg); }

.qw-bar {
  height: 6px;
  border-radius: 999px;
  background: var(--muted);
  overflow: hidden;
  margin-bottom: 8px;
}
.qw-bar__fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--qw-accent);
  transition: width .25s var(--ease);
}
.qw-progress { margin: 0 0 16px; font-size: 12.5px; color: var(--muted-fg); }

.qw-form { display: grid; gap: 12px; }
.qw-page { display: grid; gap: 12px; }
.qw-page[hidden] { display: none; }

.qw-q {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
}
.qw-q.is-missing { border-color: #C2410C; box-shadow: 0 0 0 1px #C2410C inset; }
.qw-q__no { margin: 0 0 6px; font-family: var(--mono); font-size: 11.5px; color: var(--qw-accent); }
.qw-q__stem { margin: 0 0 12px; font-size: 15.5px; line-height: 1.7; color: var(--fg); font-weight: 600; }
.qw-q__hint { margin: -4px 0 12px; font-size: 12.5px; line-height: 1.7; color: var(--muted-fg); }

.qw-opts { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.qw-opt {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 6px 3px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  text-align: center;
  cursor: pointer;
  transition: border-color .16s var(--ease), background .16s var(--ease), color .16s var(--ease);
}
.qw-opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.qw-opt__text { font-size: 13px; line-height: 1.3; }
.qw-opt:hover { border-color: var(--qw-accent-line); }
.qw-opt:has(input:checked) {
  border-color: var(--qw-accent);
  background: var(--qw-accent-soft);
  color: var(--qw-accent-ink);
  font-weight: 700;
}
.qw-opt:has(input:focus-visible) { outline: 2px solid var(--qw-accent); outline-offset: 2px; }

.qw-opts--type { grid-template-columns: 1fr; gap: 8px; }
.qw-opts--type .qw-opt {
  justify-content: flex-start;
  gap: 10px;
  min-height: 52px;
  padding: 10px 14px;
  text-align: left;
  background: var(--card);
}
.qw-opts--type .qw-opt__key {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted-fg);
}
.qw-opts--type .qw-opt:has(input:checked) .qw-opt__key { background: var(--qw-accent); color: #fff; }
.qw-opts--type .qw-opt__text { font-size: 14px; line-height: 1.55; }

.qw-error {
  margin: 4px 0 0;
  padding: 10px 12px;
  border: 1px solid #FED7AA;
  border-radius: 8px;
  background: #FFF7ED;
  font-size: 13px;
  line-height: 1.6;
  color: #9A3412;
}
.qw-test__acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.qw-test__note { margin: 4px 0 0; font-size: 12.5px; line-height: 1.75; color: var(--muted-fg); }

/* ---------- 结果 ---------- */
.qw-result { padding-top: 24px; }
.qw-result__head { margin-bottom: 22px; }
.qw-result__kicker { margin: 0 0 8px; font-size: 12px; letter-spacing: .06em; color: var(--qw-accent); font-weight: 600; }
.qw-result__title { font-family: var(--display); font-size: clamp(26px, 3.8vw, 36px); line-height: 1.24; margin: 0 0 8px; }
.qw-result__tagline { margin: 0; font-size: 15px; line-height: 1.75; color: var(--muted-fg); }
.qw-result__alias { display: block; margin-top: 4px; font-size: 13px; color: var(--qw-accent); }

.qw-band { position: relative; overflow: hidden; display: grid; gap: 18px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.qw-band__total { display: flex; align-items: baseline; gap: 8px; }
.qw-band__num { font-family: var(--display); font-size: clamp(44px, 7vw, 60px); line-height: 1; color: var(--qw-accent); }
.qw-band__unit { font-size: 13px; color: var(--muted-fg); }
.qw-band__range { margin: 0; font-size: 12.5px; color: var(--muted-fg); }

.qw-meter { display: grid; gap: 6px; }
.qw-meter__track { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.qw-meter__seg { height: 10px; border-radius: 4px; background: var(--muted); }
.qw-meter__seg.is-active { background: var(--qw-accent); }
.qw-meter__labels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; font-size: 11.5px; text-align: center; color: var(--muted-fg); }
.qw-meter__labels span.is-active { color: var(--qw-accent-ink); font-weight: 700; }

.qw-block { margin-top: 26px; }
.qw-block__title { font-family: var(--display); font-size: 20px; margin: 0 0 10px; }
.qw-block__summary { margin: 0 0 14px; font-size: 14.5px; line-height: 1.9; color: var(--fg); }
.qw-lines { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.9; color: var(--muted-fg); }
.qw-lines li { margin-bottom: 4px; }

.qw-type__scores { display: grid; gap: 8px; margin: 0 0 18px; }
.qw-score-row { display: grid; grid-template-columns: 92px 1fr 28px; align-items: center; gap: 10px; }
.qw-score-row__name { font-size: 13px; color: var(--muted-fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qw-score-row__track { height: 8px; border-radius: 999px; background: var(--muted); overflow: hidden; }
.qw-score-row__fill { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--qw-accent-line); }
.qw-score-row.is-top .qw-score-row__name { color: var(--fg); font-weight: 600; }
.qw-score-row.is-top .qw-score-row__fill { background: var(--qw-accent); }
.qw-score-row__n { font-family: var(--mono); font-size: 12px; text-align: right; color: var(--muted-fg); }

.qw-second {
  margin-top: 22px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--qw-accent-line);
  border-radius: 10px;
  background: var(--card);
}
.qw-second__kicker { margin: 0 0 6px; font-size: 12px; color: var(--qw-accent); font-weight: 600; }
.qw-second__name { margin: 0 0 6px; font-size: 16px; }
.qw-second__text { margin: 0; font-size: 13.5px; line-height: 1.8; color: var(--muted-fg); }

.qw-basis {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 18px 0 0;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--qw-accent-soft);
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--muted-fg);
}
.qw-basis__label {
  flex: none;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--card);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--qw-accent-ink);
}

.qw-result__acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.qw-copy-note { flex-basis: 100%; margin: 2px 0 0; font-size: 12.5px; color: var(--muted-fg); }
.qw-result__keep {
  margin: 18px 0 0;
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--muted-fg);
  word-break: break-all;
}
.qw-result__token { font-family: var(--mono); color: var(--fg); }
.qw-result__disc { margin: 12px 0 0; font-size: 12.5px; line-height: 1.7; color: var(--muted-fg); }

/* ---------- 结果页：头部纹理、结构解读与图表 ---------- */
.qw-result__head {
  position: relative;
  overflow: hidden;
  padding: 18px 0 8px;
  border-bottom: 1px solid var(--border);
}
.qw-result__tex {
  position: absolute;
  top: -24px;
  right: -60px;
  width: min(760px, 128%);
  height: auto;
  opacity: .85;
  mix-blend-mode: multiply;
  pointer-events: none;
  user-select: none;
  -webkit-mask-image: linear-gradient(100deg, transparent 0%, #000 46%, #000 100%);
  mask-image: linear-gradient(100deg, transparent 0%, #000 46%, #000 100%);
}
.qw-result__hero { position: relative; max-width: 64ch; }

.qw-lead {
  margin: 0;
  max-width: 68ch;
  font-size: 15px;
  line-height: 1.95;
  color: var(--fg);
}

.qw-sections {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  margin-top: 18px;
}
.qw-sec-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-top: 2px solid var(--qw-accent-line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.qw-sec-card__head { display: flex; align-items: center; gap: 10px; }
.qw-sec-card__icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--qw-accent-line);
  border-radius: 10px;
  background: var(--qw-accent-soft);
  color: var(--qw-accent);
}
.qw-ico { display: block; }
.qw-sec-card__title { margin: 0; font-size: 16px; line-height: 1.4; }
.qw-sec-card__list { display: grid; gap: 12px; margin: 14px 0 0; padding: 0; list-style: none; }
.qw-sec-card__item { min-width: 0; }
.qw-sec-card__item h4 {
  margin: 0 0 3px;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--qw-accent-ink);
}
.qw-sec-card__item p { margin: 0; font-size: 13.5px; line-height: 1.85; color: var(--muted-fg); }

.qw-chart {
  position: relative;
  overflow: hidden;
  margin-top: 10px;
  padding: 20px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.qw-chart > *:not(.qw-chart__glow),
.qw-band > *:not(.qw-band__glow) { position: relative; z-index: 1; }
.qw-chart__glow,
.qw-band__glow {
  position: absolute;
  top: -90px;
  right: -80px;
  width: 300px;
  height: auto;
  opacity: .6;
  pointer-events: none;
  user-select: none;
}
.qw-chart__head { max-width: 62ch; }
.qw-chart__title { margin: 0 0 6px; font-family: var(--display); font-size: 20px; line-height: 1.35; }
.qw-chart__lead { margin: 0 0 16px; font-size: 13px; line-height: 1.8; color: var(--muted-fg); }
.qw-chart__body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: center; }
.qw-chart .qw-type__scores { margin: 0; }

.qw-radar { min-width: 0; }
.qw-radar svg { display: block; width: 100%; max-width: 320px; height: auto; margin: 0 auto; overflow: visible; }
.qw-radar__grid { fill: none; stroke: var(--border); stroke-width: 1; }
.qw-radar__axis { stroke: var(--border); stroke-width: 1; }
.qw-radar__shape { fill: var(--qw-accent-soft); stroke: var(--qw-accent); stroke-width: 2; stroke-linejoin: round; }
.qw-radar__dot { fill: var(--qw-accent); stroke: #fff; stroke-width: 2; }
.qw-radar text { fill: var(--muted-fg); font-size: 12px; }
.qw-radar text.is-top { fill: var(--qw-accent-ink); font-weight: 700; }
.qw-radar__zero { fill: var(--muted-fg); font-size: 12px; }

.qw-gauge { display: block; width: 100%; max-width: 520px; height: auto; }
.qw-gauge__track { fill: var(--muted); }
.qw-gauge__seg { fill: var(--qw-accent-line); }
.qw-gauge__seg.is-active { fill: var(--qw-accent); }
.qw-gauge__mark { fill: var(--qw-accent-ink); }
.qw-gauge text { fill: var(--muted-fg); font-size: 11px; }
.qw-gauge text.is-active { fill: var(--qw-accent-ink); font-weight: 700; }

.qw-low {
  margin: 0 0 20px;
  padding: 14px 18px;
  border: 1px solid #EFD9A9;
  border-left: 3px solid #B8862B;
  border-radius: 10px;
  background: #FFFAF0;
}
.qw-low strong { display: block; margin-bottom: 4px; font-size: 14px; color: #7E5310; }
.qw-low p { margin: 0; font-size: 13.5px; line-height: 1.8; color: #7A5C28; }

/* ---------- 空态 ---------- */
.qw-empty { padding: 46px 0; text-align: center; }
.qw-empty__title { font-family: var(--display); font-size: 24px; margin: 0 0 10px; }
.qw-empty p { margin: 0 auto 20px; max-width: 46ch; font-size: 14px; line-height: 1.8; color: var(--muted-fg); }
.qw-empty__acts { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; }

/* ---------- 页内 AI 问答 ---------- */
.qw-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.qw-chat { margin: 30px 0 0; }
.qw-chat__head { max-width: 68ch; }
.qw-chat__kicker {
  margin: 0 0 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--qw-accent);
}
.qw-chat__title {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: clamp(21px, 3vw, 26px);
  line-height: 1.3;
}
.qw-chat__lead { margin: 0 0 14px; font-size: 14px; line-height: 1.8; color: var(--muted-fg); }
.qw-chat__panel {
  padding: 16px;
  border: 1px solid var(--qw-accent-line);
  border-radius: 16px;
  background:
    radial-gradient(120% 90% at 100% 0%, var(--qw-accent-soft) 0%, rgba(255, 255, 255, 0) 58%),
    var(--card);
}
.qw-chat__log {
  display: grid;
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
  padding: 2px 2px 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--qw-accent-line) transparent;
  overscroll-behavior: contain;
}
.qw-chat__empty {
  margin: 0;
  padding: 14px 16px;
  border: 1px dashed var(--qw-accent-line);
  border-radius: 12px;
  background: #fff;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--muted-fg);
}
.qw-chat__msg { display: grid; gap: 4px; max-width: 88%; }
.qw-chat__msg--user { justify-self: end; justify-items: end; }
.qw-chat__msg--bot { justify-self: start; justify-items: start; }
.qw-chat__who { padding: 0 3px; font-size: 11.5px; color: var(--muted-fg); }
.qw-chat__bubble {
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 14px;
  border-top-left-radius: 4px;
  background: #fff;
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.qw-chat__msg--user .qw-chat__bubble {
  border-color: var(--qw-accent);
  border-radius: 14px;
  border-top-right-radius: 4px;
  background: var(--qw-accent);
  color: #fff;
}
.qw-chat__typing { display: inline-flex; align-items: center; gap: 5px; min-height: 24px; }
.qw-chat__typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--qw-accent);
  opacity: .6;
  animation: qw-chat-dot 1.1s ease-in-out infinite;
}
.qw-chat__typing i:nth-child(2) { animation-delay: .16s; }
.qw-chat__typing i:nth-child(3) { animation-delay: .32s; }
@keyframes qw-chat-dot {
  0%, 80%, 100% { opacity: .28; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}
.qw-chat__chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.qw-chat__chip {
  padding: 7px 13px;
  border: 1px solid var(--qw-accent-line);
  border-radius: 999px;
  background: #fff;
  color: var(--qw-accent);
  font: inherit;
  font-size: 12.5px;
  line-height: 1.4;
  cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.qw-chat__chip:hover { background: var(--qw-accent-soft); border-color: var(--qw-accent); }
.qw-chat__chip:disabled { opacity: .5; cursor: not-allowed; }
.qw-chat__form { display: grid; gap: 8px; }
.qw-chat__input {
  box-sizing: border-box;
  width: 100%;
  min-height: 64px;
  max-height: 120px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--fg);
  font: inherit;
  font-size: 14px;
  line-height: 1.7;
  resize: none;
}
.qw-chat__input::placeholder { color: var(--muted-fg); opacity: .85; }
.qw-chat__input:focus {
  outline: none;
  border-color: var(--qw-accent);
  box-shadow: 0 0 0 3px var(--qw-accent-soft);
}
.qw-chat__bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qw-chat__note { min-width: 0; font-size: 11.5px; line-height: 1.4; color: var(--muted-fg); }
.qw-chat__send {
  flex: none;
  min-height: 40px;
  padding: 0 22px;
  border: 1px solid var(--qw-accent);
  border-radius: 999px;
  background: var(--qw-accent);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s var(--ease);
}
.qw-chat__send:hover { opacity: .9; }
.qw-chat__send:disabled { opacity: .5; cursor: not-allowed; }
.qw-chat__disc { margin: 10px 0 0; font-size: 11.5px; line-height: 1.7; color: var(--muted-fg); }
.qw-chat__err {
  margin: 0;
  padding: 9px 12px;
  border: 1px solid #f2b8a2;
  border-radius: 10px;
  background: #fff5f0;
  color: #9a3412;
  font-size: 13px;
  line-height: 1.7;
}

@media (max-width: 480px) {
  .qw-opts { gap: 4px; }
  .qw-opt { min-height: 52px; padding: 4px 2px; }
  .qw-opt__text { font-size: 12px; }
  .qw-q { padding: 14px; }
  .qw-score-row { grid-template-columns: 78px 1fr 24px; }
  .qw-chat__panel { padding: 13px; border-radius: 14px; }
  .qw-chat__msg { max-width: 94%; }
  .qw-chat__bubble { padding: 10px 12px; font-size: 13.5px; }
  .qw-chat__note { display: none; }
  .qw-chat__bar { justify-content: flex-end; }
  .qw-chat__send { width: 100%; }
  .qw-sec-card { padding: 15px; }
  .qw-sec-card__item p { font-size: 13px; line-height: 1.8; }
  .qw-chart { padding: 16px 14px; }
  .qw-chart__glow, .qw-band__glow { top: -70px; right: -60px; width: 220px; }
  .qw-lead { font-size: 14.5px; line-height: 1.9; }
}
@media (min-width: 720px) {
  .qw-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qw-soon { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qw-opts--type { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qw-sections { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qw-result__head { padding: 24px 0 12px; }
}
@media (min-width: 900px) {
  .qw-hero { grid-template-columns: minmax(0, 1.5fr) minmax(260px, .8fr); align-items: start; }
  .qw-chat__panel { padding: 20px 22px; }
  .qw-chat__log { max-height: 420px; }
  .qw-chat__msg { max-width: 78%; }
  .qw-chart__body { grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 26px; }
  .qw-chart { padding: 24px 22px; }
  .qw-sec-card { padding: 20px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .qw-btn, .qw-bar__fill, .qw-opt, .qw-chat__chip, .qw-chat__send { transition: none; }
  .qw-chat__typing i { animation: none; opacity: .6; }
}
