/* Chat page — 家づくりユーザー向け（離脱抑制・タイパ・信頼感） */
html.chat-boot-pending body.chat-page {
  background: #F4F6FF;
  visibility: hidden;
}
html.chat-boot-pending #chat-root {
  visibility: hidden;
}
html.chat-boot-pending .demo-banner,
html.chat-prod-host .demo-banner {
  display: none;
}

body.chat-page {
  background: linear-gradient(180deg, var(--bg-warm) 0%, var(--bg) 40%, var(--bg) 100%);
  margin: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

body.chat-page #chat-root {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

#screen-start {
  max-width: var(--chat-max);
  width: 100%;
  margin: 0 auto;
  padding: clamp(24px, 6vw, 48px) 20px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
#screen-start.is-hidden { display: none; }

.start-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 5vw, 32px);
  box-shadow: var(--shadow-lg);
}

.start-card h1 {
  font-size: clamp(1.375rem, 5vw, 1.75rem);
  color: var(--brand-deep);
  margin: 10px 0 12px;
  line-height: 1.35;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.start-card > p,
#chat-sub {
  color: var(--muted);
  margin-bottom: 20px;
  font-size: 15px;
  line-height: 1.65;
  max-width: 36ch;
}

.start-trust-grid {
  display: grid;
  gap: 10px;
  margin: 0 0 24px;
  list-style: none;
  padding: 0;
}

.start-trust-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: #f8fafc;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink);
}

.start-trust-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--green-soft);
  color: var(--green);
  display: grid;
  place-items: center;
}

.start-trust-item strong {
  display: block;
  font-size: 14px;
  color: var(--brand-deep);
  margin-bottom: 2px;
}

.start-trust-item span {
  font-size: 12px;
  color: var(--muted);
}

.btn-start-full {
  width: 100%;
  min-height: 52px;
  font-size: 16px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--green) 0%, var(--cta) 100%);
  box-shadow: 0 4px 16px rgba(15, 118, 110, 0.25);
}
.btn-start-full:hover {
  background: linear-gradient(135deg, #0d6b64 0%, #0f766e 100%);
  box-shadow: 0 6px 20px rgba(15, 118, 110, 0.3);
}

.start-footnote {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 14px;
  line-height: 1.5;
}

.start-footnote svg {
  vertical-align: -2px;
  margin-right: 4px;
}

#captcha-start { margin-top: 16px; display: none; }
#captcha-start.is-visible { display: block; }
.start-error { color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 1.2em; text-align: center; }

#screen-chat {
  display: none;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: var(--chat-max);
  margin: 0 auto;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
}
#screen-chat.is-visible { display: flex; }
#screen-chat.embed-mode { max-width: 100%; margin: 0; box-shadow: none; min-height: 100%; height: 100%; }
body.embed-mode .demo-banner { display: none; }
body.embed-mode { background: var(--paper); }

.chat-brand-label {
  color: var(--green);
  font-weight: 700;
  letter-spacing: 0.1em;
  font-size: 11px;
  text-transform: uppercase;
}

.chat-title-bar { font-weight: 800; font-size: 15px; color: var(--brand-deep); line-height: 1.3; }
.chat-subtitle-bar { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.chat-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.chat-start-logo {
  display: block;
  max-width: 200px;
  max-height: 72px;
  margin: 0 0 16px;
  object-fit: contain;
}

#chat-widget-area { padding: 0 16px 8px; display: none; }
#chat-widget-area.is-visible { display: block; }
#chat-form { display: none; }
#chat-form.is-visible { display: flex; flex-wrap: wrap; }

.consent-row { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; margin-top: 10px; line-height: 1.55; }
.consent-row input { margin-top: 4px; min-width: 18px; min-height: 18px; accent-color: var(--green); }
.consent-link { margin-left: 6px; color: var(--green); font-weight: 600; }
.bubble.ai.is-streaming { opacity: 0.92; }

.chat-widget-input,
.chat-widget-select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-top: 8px;
  font-size: 16px;
  font-family: inherit;
  min-height: var(--touch-min);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.chat-widget-input:focus,
.chat-widget-select:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: var(--focus-ring);
}
.chat-widget-textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.55;
}
.text-preset-hint {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.chat-widget-field { margin-top: 8px; }
.chat-widget-field .field-error {
  display: none;
  margin: 6px 0 0;
  font-size: 12px;
  color: #b91c1c;
  line-height: 1.45;
}
.chat-widget-field.has-error .field-error { display: block; }
.chat-widget-field.has-error .chat-widget-input {
  border-color: #fca5a5;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.18);
}
.chat-widget-inline-error {
  display: none;
  margin: 8px 0 0;
  font-size: 12px;
  color: #b91c1c;
  line-height: 1.45;
}
.chat-widget-inline-error.is-visible { display: block; }

.other-input-panel {
  margin-top: 10px;
  padding-top: 2px;
}

.btn-mt-sm { margin-top: 8px; }
.btn-mt-md { margin-top: 12px; width: 100%; min-height: var(--touch-min); }
.chip.is-selected { background: var(--green-soft); border-color: var(--green); color: var(--green); }

.result-summary { margin-top: 10px; font-size: 14px; opacity: 0.95; line-height: 1.55; }
.answer-summary { margin: 14px 0; }
.answer-summary h3 { margin-bottom: 10px; font-size: 15px; color: var(--brand-deep); }
.answer-summary ul { padding-left: 20px; font-size: 14px; color: var(--muted); line-height: 1.6; }
.goal-cta-block { margin: 14px 0; }
.goal-cta-block h3 { margin-bottom: 8px; font-size: 15px; }
.goal-cta-desc { font-size: 13px; color: var(--muted); margin-bottom: 12px; line-height: 1.55; }
.goal-cta-actions { display: flex; flex-direction: column; gap: 8px; }
.goal-cta-actions .btn { width: 100%; }

.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.captcha-inline { margin-top: 14px; }
.form-error-box {
  display: none;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: #fef2f2;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid #fecaca;
}
.form-error-box.is-visible { display: block; }

.chat-error-page {
  padding: 32px 24px;
  font-family: inherit;
  text-align: center;
  max-width: var(--chat-max);
  margin: 0 auto;
  color: var(--muted);
}
.chat-error-page::before {
  content: "";
  display: block;
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #fee2e2;
  border: 2px solid #fecaca;
}

@media (max-width: 639px) {
  body.chat-page {
    background: var(--paper);
  }

  #screen-start,
  #screen-chat {
    max-width: 100%;
    margin: 0;
    box-shadow: none;
  }

  .start-card {
    border-radius: 0;
    border-left: none;
    border-right: none;
    box-shadow: none;
  }

  #screen-start {
    padding: 20px 16px;
    justify-content: flex-start;
    padding-top: clamp(16px, 4vh, 32px);
  }

  .start-card > p,
  #chat-sub {
    max-width: none;
  }
}

@media (max-width: 380px) {
  .start-trust-item { padding: 12px; gap: 10px; }
  .chat-body { padding: 12px 12px 6px; }
  #chat-widget-area { padding: 0 12px 8px; }
}

#screen-start.is-leaving {
  animation: screen-leave 0.38s var(--ease) forwards;
}
#screen-chat.is-enter {
  opacity: 0;
  transform: translateY(16px);
}
#screen-chat.is-enter.is-enter-active,
#screen-chat.is-visible.is-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

@keyframes warm-msg-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes line-msg-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes options-rise-warm {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes options-rise-line {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes cursor-fade {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 0; }
}

.start-welcome {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.start-welcome--editorial {
  gap: 0;
  padding: clamp(8px, 2vw, 16px) 0;
}
.start-welcome--centered {
  flex: 1;
  min-height: 0;
}

.font-mincho {
  font-family: "Shippori Mincho", "Noto Serif JP", serif;
}

.start-brand-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--d-muted, #7A7060);
  letter-spacing: 0.06em;
  margin-bottom: 20px;
}
.start-headline {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  line-height: 1.55;
  color: var(--d-fg, #1C1810);
  font-weight: 500;
  margin: 0 0 20px;
}
.start-accent-rule {
  width: 44px;
  height: 2px;
  background: var(--d-accent, #F5C440);
  border-radius: 1px;
  margin-bottom: 20px;
}
.start-lead {
  font-size: 14px;
  line-height: 1.9;
  color: rgba(28, 24, 16, 0.82);
  max-width: 22rem;
  margin-bottom: 20px;
}
.start-safety-box {
  padding: 14px 16px;
  border-left: 2px solid var(--d-accent, #F5C440);
  background: rgba(245, 196, 64, 0.06);
  margin-bottom: 20px;
}
.start-safety-box p {
  font-size: 12px;
  line-height: 1.65;
  color: var(--d-muted, #7A7060);
  margin: 0;
}
.start-pre-btn {
  font-size: 12px;
  line-height: 1.65;
  color: var(--d-muted, #7A7060);
  margin-bottom: 20px;
}
.start-cta-wrap { margin-top: 0; margin-bottom: 28px; }
.start-cta-arrow {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font: inherit;
  color: var(--d-fg, #1C1810);
}
.start-cta-arrow span:first-child {
  font-size: 14px;
  font-weight: 600;
}
.start-cta-arrow:hover span:first-child { color: var(--d-accent, #F5C440); }
.start-cta-arrow-icon {
  color: var(--d-accent, #F5C440);
  display: inline-flex;
  animation: arrow-nudge 2s ease-in-out infinite;
}
.start-cta-arrow.is-loading { opacity: 0.55; pointer-events: none; }

.btn-start-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 32px;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: var(--d-accent, #4338CA);
  color: #fff;
  transition: opacity 0.2s var(--ease);
}
.btn-start-pill:hover { opacity: 0.88; }
.btn-start-pill.is-loading { opacity: 0.65; pointer-events: none; }

.line-welcome-header {
  flex-shrink: 0;
  background: var(--d-header, #fff);
  border-bottom: 1px solid var(--d-border, #E5E7EB);
  margin: -20px -20px 0;
  padding: 12px 20px;
}
.line-welcome-header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: var(--chat-max);
  margin: 0 auto;
}
.line-welcome-header-avatar,
.line-welcome-avatar-img,
.line-welcome-hero-img {
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}
.line-welcome-header-avatar {
  width: 40px;
  height: 40px;
  border: 2px solid var(--d-accent, #4338CA);
}
.line-welcome-avatar-img { width: 40px; height: 40px; }
.line-welcome-header-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--d-ai-text, #1E1B4B);
  line-height: 1.2;
}
.line-welcome-header-status {
  font-size: 10px;
  color: var(--d-muted, #9CA3AF);
  margin-top: 2px;
}
.line-welcome-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 16px;
  padding: 32px 8px 24px;
}
.line-welcome-hero-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  border: 4px solid var(--d-accent, #4338CA);
}
.line-welcome-hero-img { width: 80px; height: 80px; }
.line-welcome-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--d-ai-text, #1E1B4B);
}
.line-welcome-sub {
  font-size: 12px;
  line-height: 1.65;
  color: var(--d-muted, #9CA3AF);
  max-width: 20rem;
}
.line-welcome-safety {
  font-size: 10px;
  line-height: 1.65;
  color: var(--d-muted, #9CA3AF);
  max-width: 20rem;
}

.start-trust-grid--editorial {
  margin: 0 0 20px;
}
.start-trust-grid--centered {
  margin-top: 8px;
  width: 100%;
  max-width: 320px;
}

/* --- Motion (shared) --- */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes screen-leave {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-12px); }
}
@keyframes arrow-nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}
@keyframes dot-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes mincho-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

.is-enter {
  animation: rise-in 0.35s var(--ease) both;
}
.chat-widget.is-enter { animation-delay: 0.05s; }

/* --- Chat design: shared components --- */
.bubble-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  align-self: flex-start;
  max-width: 100%;
}
.bubble-row--ai .bubble {
  max-width: min(220px, 78vw);
}
.bubble-inline-avatar,
.warm-ai-avatar {
  border-radius: 50%;
  flex-shrink: 0;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.bubble-inline-avatar {
  width: 28px;
  height: 28px;
  background: var(--d-chip-bg, #eef2ff);
  color: var(--d-accent, #4338ca);
  font-size: 10px;
  font-weight: 800;
}
.warm-ai-avatar {
  width: 48px;
  height: 48px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.bubble-inline-avatar .chat-avatar-img,
.warm-ai-avatar .chat-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 10%;
}
.chat-online-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  margin-right: 4px;
  vertical-align: 1px;
}

.warm-msg-block.is-entering {
  animation: warm-msg-rise 0.3s ease both;
}
.line-msg-block.is-entering {
  animation: line-msg-rise 0.2s ease both;
}
.line-msg-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-self: flex-start;
  width: 100%;
  max-width: 100%;
}
.line-msg-block.is-enter {
  animation: line-msg-rise 0.2s ease both;
}
.line-msg-block--user {
  align-items: flex-end;
  align-self: stretch;
}
.line-user-row {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}
.warm-msg-block--user {
  display: flex;
  justify-content: flex-end;
}

.warm-yetti-avatar {
  width: 48px;
  height: 48px;
  border: 2px solid #F5C440;
  background: #F5F0E0;
  border-radius: 50%;
}
.warm-yetti-avatar .chat-avatar-img {
  object-position: 50% 10%;
}

.warm-ai-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  align-self: flex-start;
  max-width: 36rem;
}
.warm-ai-avatar-col {
  padding-top: 4px;
  flex-shrink: 0;
}
.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 0.9em;
  background: currentColor;
  border-radius: 1px;
  opacity: 0.7;
  margin-left: 1px;
  vertical-align: middle;
  animation: cursor-fade 0.45s linear infinite;
}
@keyframes cursor-blink {
  from { opacity: 0.7; }
  to { opacity: 0; }
}

.warm-typing-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  align-self: flex-start;
}
.warm-typing-dots {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px 0;
  font-size: 1.5rem;
  line-height: 1;
  color: #F5C440;
}
.warm-typing-dot {
  animation: mincho-dot-pulse 1.5s ease-in-out infinite;
}
@keyframes mincho-dot-pulse {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

.msg-typing-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  align-self: flex-start;
}
.msg-typing-bubble {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 14px 16px;
  background: var(--d-ai-bg, #fff);
  border: 1px solid var(--d-border, #E5E7EB);
  border-radius: 18px 18px 18px 4px;
}
.msg-typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--d-muted, #9CA3AF);
  animation: dot-bounce 0.7s ease-in-out infinite;
}

.warm-ai-text.is-streaming::after,
.bubble.ai.is-streaming::after {
  content: none;
  animation: none;
}

body[data-chat-design="clean"] .warm-ai-text .typewriter-cursor {
  background: var(--d-fg, #1C1810);
}
body[data-chat-design="line"] .bubble.ai .typewriter-cursor {
  background: var(--d-ai-text, #1E1B4B);
}

.warm-ai-body {
  flex: 1;
  min-width: 0;
}
.warm-ai-text {
  flex: 1;
  font-family: "Shippori Mincho", "Noto Serif JP", serif;
  font-size: 1.25rem;
  line-height: 1.85;
  color: var(--d-fg, #1C1810);
  margin: 0 0 1.75rem;
  white-space: pre-wrap;
}
.warm-ai-text.is-streaming {
  margin-bottom: 0;
}
.warm-ai-text.is-done {
  margin-bottom: 1.75rem;
}
.warm-ai-options {
  margin-top: 0;
}
.warm-options-block.is-reveal {
  animation: options-rise-warm 0.35s ease both;
}
.msg-options-block.is-reveal {
  animation: options-rise-line 0.25s ease both;
}
body[data-chat-design="line"] .msg-options-block.is-reveal .chip,
body[data-chat-design="line"] .msg-options-block.is-reveal .chip--line {
  animation: line-chip-in 0.25s ease both;
}
body[data-chat-design="line"] .msg-options-block.is-reveal .line-image-option {
  animation: line-image-in 0.3s ease both;
}
body[data-chat-design="line"] .line-confirm-btn {
  display: block;
  width: 100%;
  max-width: 220px;
  margin-top: 10px;
  padding: 10px 16px;
  border: none;
  border-radius: 999px;
  background: var(--d-accent, #4338CA);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
body[data-chat-design="line"] .line-confirm-btn:active {
  transform: scale(0.95);
}
@keyframes line-chip-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes line-image-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.warm-options-block,
.msg-options-block {
  width: 100%;
}
.warm-options-block .chip-row,
.msg-options-block .chip-row {
  margin-top: 0;
  gap: 8px;
}

.warm-options-block .area-select-ranked,
.msg-options-block .area-select-ranked,
.chat-widget--choices .area-select-ranked {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.warm-options-block .area-select-ranked label,
.msg-options-block .area-select-ranked label,
.chat-widget--choices .area-select-ranked label {
  font-size: 13px;
  font-weight: 600;
  color: var(--d-muted, #7A7060);
}

.warm-options-block .area-muni-check-grid,
.msg-options-block .area-muni-check-grid,
.chat-widget--choices .area-muni-check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 6px 10px;
  max-height: 240px;
  overflow-y: auto;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid var(--d-border, #e5e8f2);
  border-radius: 8px;
  background: var(--d-surface, #fafbfd);
}

.warm-options-block .area-muni-check-grid label,
.msg-options-block .area-muni-check-grid label,
.chat-widget--choices .area-muni-check-grid label {
  font-size: 12px;
  display: flex;
  gap: 6px;
  align-items: flex-start;
  line-height: 1.4;
  cursor: pointer;
}

.warm-options-block .area-muni-check-grid input,
.msg-options-block .area-muni-check-grid input,
.chat-widget--choices .area-muni-check-grid input {
  flex-shrink: 0;
  margin-top: 2px;
}

body[data-chat-design="line"] .msg-options-block .area-muni-check-grid {
  border-color: rgba(0, 0, 0, 0.08);
  background: #f7f7f8;
}

body[data-chat-design="line"] .msg-options-block .area-muni-check-grid label {
  font-size: 11px;
  color: #444;
}

.options-desc {
  font-size: 13px;
  color: var(--d-muted, #7A7060);
  line-height: 1.55;
  margin: 0 0 12px;
}
.warm-action-row {
  margin-top: 16px;
}
.warm-next-btn {
  margin-top: 4px;
}

.msg-inline-options {
  padding-left: 36px;
  margin: 2px 0 10px;
  max-width: 100%;
}

.warm-user-row {
  display: flex;
  justify-content: flex-end;
  align-self: flex-end;
  max-width: 100%;
}
.warm-user-box {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  background: var(--d-user-bg, #FEF4D2);
  color: var(--d-user-fg, #6B5A10);
  border: 1px solid rgba(245, 196, 64, 0.4);
}

/* --- Theme: clean (PanelWarm) --- */
body[data-chat-design="clean"].chat-page {
  --d-bg: #FAF8EE;
  --d-fg: #1C1810;
  --d-muted: #7A7060;
  --d-accent: #F5C440;
  --d-border: rgba(0, 0, 0, 0.08);
  --d-user-bg: #FEF4D2;
  --d-user-fg: #6B5A10;
  background: var(--d-bg);
}
body[data-chat-design="clean"] #screen-start,
body[data-chat-design="clean"] #screen-chat {
  background: var(--d-bg);
  box-shadow: none;
}
body[data-chat-design="clean"] .start-trust-item {
  background: rgba(255, 255, 255, 0.55);
  border-color: var(--d-border);
}
body[data-chat-design="clean"] .start-trust-icon {
  background: rgba(245, 196, 64, 0.15);
  color: #6B5A10;
}
body[data-chat-design="clean"] .start-trust-item strong { color: var(--d-fg); }
body[data-chat-design="clean"] .start-footnote { color: var(--d-muted); }

body[data-chat-design="clean"] .chat-top {
  padding: 16px 32px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--d-border);
}
body[data-chat-design="clean"] .chat-top-brand .avatar,
body[data-chat-design="clean"] .chat-top-titles .chat-subtitle-bar {
  display: none;
}
body[data-chat-design="clean"] .chat-top-progress {
  display: none;
}
body[data-chat-design="clean"] .chat-top-progress.is-visible {
  display: flex;
}
body[data-chat-design="clean"] .progress-step-label {
  color: var(--d-muted);
}
body[data-chat-design="clean"] .chat-title-bar {
  font-family: "Shippori Mincho", serif;
  font-weight: 500;
  font-size: 16px;
  color: var(--d-fg);
  letter-spacing: 0.04em;
}
body[data-chat-design="clean"] .progress-wrap {
  background: #E8E0C8;
  border-bottom: none;
  padding: 0;
}
body[data-chat-design="clean"] .progress-meta {
  display: none;
}
body[data-chat-design="clean"] .progress {
  height: 2px;
  background: #E8E0C8;
  border-radius: 0;
}
body[data-chat-design="clean"] .progress > span {
  background: var(--d-accent);
  transition: width 0.55s ease;
  border-radius: 0;
}
body[data-chat-design="clean"] .chat-body {
  gap: 32px;
  padding: 48px 40px 24px;
  max-width: 42rem;
  margin: 0 auto;
}
body[data-chat-design="clean"] .chat-choice-hint {
  border-top-color: rgba(0, 0, 0, 0.08);
}
body[data-chat-design="clean"] .chat-choice-hint p {
  color: rgba(122, 112, 96, 0.4);
}
body[data-chat-design="clean"] .warm-user-box {
  padding: 8px 16px;
  font-size: 14px;
}
body[data-chat-design="clean"] .chip {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0;
  color: var(--d-fg);
  font-weight: 400;
  font-size: 14px;
  padding: 10px 20px;
  min-height: auto;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
body[data-chat-design="clean"] .chip:active {
  transform: scale(0.97);
}
body[data-chat-design="clean"] .warm-options-block .chip-row,
body[data-chat-design="clean"] .warm-ai-options .chip-row {
  gap: 8px;
}
body[data-chat-design="clean"] .bubble.ai,
body[data-chat-design="clean"] .bubble.user {
  display: none;
}
body[data-chat-design="clean"] .chip:hover {
  background: #FEF9E5;
  border-color: #F5C440;
}
body[data-chat-design="clean"] .chip.is-selected {
  background: #FEF9E5;
  border-color: #F5C440;
  color: var(--d-fg);
}
body[data-chat-design="clean"] .options-select {
  display: block;
  width: 100%;
  max-width: 280px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--d-fg);
  font-family: inherit;
}
body[data-chat-design="clean"] .options-select:focus {
  outline: none;
  border-color: #F5C440;
  box-shadow: 0 0 0 2px rgba(245, 196, 64, 0.2);
}
body[data-chat-design="clean"] .warm-options-block .btn-solid,
body[data-chat-design="clean"] .warm-ai-options .btn-solid {
  background: #fff;
  color: var(--d-fg);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 0;
  font-weight: 600;
}
body[data-chat-design="clean"] .warm-options-block .btn-solid:hover,
body[data-chat-design="clean"] .warm-ai-options .btn-solid:hover {
  background: #FEF9E5;
  border-color: #F5C440;
}
body[data-chat-design="clean"] .warm-options-block .btn-solid:hover,
body[data-chat-design="clean"] .warm-ai-options .btn-solid:hover {
  background: #FEF9E5;
  border-color: #F5C440;
}
body[data-chat-design="clean"] .warm-image-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-width: 20rem;
  margin-top: 4px;
}
body[data-chat-design="clean"] .warm-image-option {
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: #fff;
  padding: 0;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
body[data-chat-design="clean"] .warm-image-option:hover {
  border-color: #F5C440;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
body[data-chat-design="clean"] .warm-image-option:active { transform: scale(0.97); }
body[data-chat-design="clean"] .warm-image-option.is-selected {
  border-color: #F5C440;
  box-shadow: 0 0 0 1px #F5C440;
}
body[data-chat-design="clean"] .warm-image-media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f2efe8;
}
body[data-chat-design="clean"] .warm-image-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
body[data-chat-design="clean"] .warm-image-option:hover .warm-image-media img {
  transform: scale(1.05);
}
body[data-chat-design="clean"] .warm-image-caption {
  padding: 10px 12px;
  background: #fff;
}
body[data-chat-design="clean"] .warm-image-caption span {
  font-size: 12px;
  line-height: 1.45;
  color: rgba(28, 24, 16, 0.72);
}
body[data-chat-design="clean"] .warm-image-option:hover .warm-image-caption span,
body[data-chat-design="clean"] .warm-image-option.is-selected .warm-image-caption span {
  color: #1C1810;
}
body[data-chat-design="clean"] #chat-widget-area .chat-widget--choices {
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 0;
}
body[data-chat-design="clean"] .chat-input-area:not(.is-visible) {
  display: none;
}
body[data-chat-design="clean"] .chat-input-area.is-visible {
  display: flex;
  flex-wrap: wrap;
}
body[data-chat-design="clean"] .chat-input-area {
  border-top: 1px solid var(--d-border);
  background: rgba(255, 255, 255, 0.7);
}
body[data-chat-design="clean"] .chat-input-area button {
  background: var(--d-fg);
  color: #fff;
}
body[data-chat-design="clean"] .btn-solid {
  background: var(--d-accent);
  color: var(--d-fg);
  border: none;
  font-weight: 700;
}
body[data-chat-design="clean"] .btn-solid:hover {
  background: #e6b535;
}
body[data-chat-design="clean"] .warm-options-block .btn-solid:hover,
body[data-chat-design="clean"] .warm-ai-options .btn-solid:hover {
  background: #FEF9E5;
  border-color: #F5C440;
}
body[data-chat-design="clean"] .result-card {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}
body[data-chat-design="clean"] .result-card::before {
  content: "✓ 診断完了";
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--d-muted);
  margin-bottom: 20px;
}
body[data-chat-design="clean"] .result-card h2 {
  font-family: "Shippori Mincho", serif;
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: 1.45;
  color: var(--d-fg);
}
body[data-chat-design="clean"] .result-card h2::after {
  content: "";
  display: block;
  width: 44px;
  height: 2px;
  background: var(--d-accent);
  margin-top: 16px;
  margin-bottom: 16px;
}
body[data-chat-design="clean"] .answer-summary,
body[data-chat-design="clean"] .goal-cta-block {
  border-color: var(--d-border);
  background: rgba(255, 255, 255, 0.5);
}

/* --- Theme: line (PanelMessenger) --- */
body[data-chat-design="line"].chat-page {
  --d-bg: #F4F6FF;
  --d-header: #FFFFFF;
  --d-border: #E5E7EB;
  --d-fg: #1E1B4B;
  --d-muted: #9CA3AF;
  --d-accent: #4338CA;
  --d-ai-bg: #FFFFFF;
  --d-ai-text: #1E1B4B;
  --d-user-bg: #4338CA;
  --d-user-fg: #FFFFFF;
  --d-chip-bg: #EEF2FF;
  --d-chip-border: #C7D2FE;
  --d-chip-text: #4338CA;
  background: var(--d-bg);
}
body[data-chat-design="line"] #screen-start,
body[data-chat-design="line"] #screen-chat {
  background: var(--d-bg);
  max-width: var(--chat-max);
}
body[data-chat-design="line"] #screen-start {
  padding: 0;
  justify-content: stretch;
}
body[data-chat-design="line"] .line-welcome-header {
  margin: 0;
}
body[data-chat-design="line"] .start-trust-grid--centered .start-trust-item {
  background: var(--d-ai-bg);
  border-color: var(--d-border);
  text-align: left;
}
body[data-chat-design="line"] .start-trust-icon {
  background: var(--d-chip-bg);
  color: var(--d-accent);
}
body[data-chat-design="line"] .chat-top {
  background: var(--d-header);
  border-bottom: 1px solid var(--d-border);
}
body[data-chat-design="line"] .chat-top-progress {
  display: none;
}
body[data-chat-design="line"] .chat-top-progress.is-visible {
  display: flex;
}
body[data-chat-design="line"] .progress-meta {
  display: none;
}
body[data-chat-design="line"] .progress-wrap {
  display: none;
}
body[data-chat-design="line"] .progress-segment {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--d-border);
  transition: background 0.3s ease;
}
body[data-chat-design="line"] .progress-segment.is-active {
  width: 8px;
  background: var(--d-accent);
}
body[data-chat-design="line"] .chat-body {
  gap: 12px;
  padding: 16px 16px 8px;
  display: flex;
  flex-direction: column;
}
body[data-chat-design="line"] .bubble.note {
  display: none;
}
body[data-chat-design="line"] .chat-choice-hint {
  border-top: 1px solid var(--d-border);
  background: var(--d-header);
  padding: 12px 16px;
}
body[data-chat-design="line"] .chat-choice-hint p {
  margin: 0;
  padding: 10px 16px;
  background: var(--d-bg);
  border: 1px solid var(--d-border);
  border-radius: 999px;
  text-align: center;
  text-transform: none;
  letter-spacing: normal;
  font-size: 12px;
  color: var(--d-muted);
}
body[data-chat-design="line"] .bubble.ai {
  font-size: 12px;
  line-height: 1.65;
  padding: 12px 16px;
}
body[data-chat-design="line"] .chat-top .avatar {
  border: 2px solid var(--d-accent);
  background: var(--d-chip-bg);
  color: var(--d-accent);
  box-shadow: none;
}
body[data-chat-design="line"] .chat-title-bar {
  color: var(--d-ai-text);
  font-weight: 600;
}
body[data-chat-design="line"] .chat-subtitle-bar {
  color: var(--d-muted);
  font-weight: 600;
  font-size: 10px;
}
body[data-chat-design="line"] .progress-wrap {
  background: var(--d-chip-bg);
  border-bottom: 1px solid var(--d-border);
}
body[data-chat-design="line"] .progress > span {
  background: var(--d-accent);
  transition: width 0.55s var(--ease);
}
body[data-chat-design="line"] .chat-body {
  gap: 12px;
}
body[data-chat-design="line"] .warm-ai-row,
body[data-chat-design="line"] .warm-user-row { display: none; }
body[data-chat-design="line"] .msg-inline-options .chip-row {
  margin-top: 0;
  gap: 6px;
}
body[data-chat-design="line"] .options-select {
  display: block;
  width: 100%;
  max-width: 240px;
  background: var(--d-bg);
  border: 1px solid var(--d-border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--d-ai-text);
  font-family: inherit;
}
body[data-chat-design="line"] .msg-options-block .img-grid--pick {
  max-width: 220px;
}
body[data-chat-design="line"] .line-image-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  max-width: 220px;
  margin-top: 4px;
}
body[data-chat-design="line"] .line-image-option {
  overflow: hidden;
  border: 1.5px solid var(--d-chip-border, #c7ccf5);
  border-radius: 12px;
  background: var(--d-ai-bg, #fff);
  padding: 0;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
body[data-chat-design="line"] .line-image-option:active { transform: scale(0.97); }
body[data-chat-design="line"] .line-image-option.is-selected {
  border-color: var(--d-accent, #4338CA);
  box-shadow: 0 0 0 1px var(--d-accent, #4338CA);
}
body[data-chat-design="line"] .line-image-media {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #E8EAFF;
}
body[data-chat-design="line"] .line-image-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
body[data-chat-design="line"] .line-image-caption {
  padding: 8px 10px;
  background: var(--d-ai-bg, #fff);
}
body[data-chat-design="line"] .line-image-caption span {
  font-size: 10px;
  font-weight: 600;
  color: var(--d-ai-text, #1e1b4b);
}
body[data-chat-design="line"] #chat-widget-area .chat-widget--choices {
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 0;
}
body[data-chat-design="line"] .chat-widget--choices .chat-widget-header {
  display: none;
}
body[data-chat-design="line"] .bubble.ai {
  background: var(--d-ai-bg);
  color: var(--d-ai-text);
  border: 1px solid var(--d-border);
  border-radius: 18px 18px 18px 4px;
  box-shadow: none;
  max-width: min(220px, 78vw);
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
}
body[data-chat-design="line"] .bubble.user {
  background: var(--d-user-bg);
  color: var(--d-user-fg);
  border-radius: 18px 18px 4px 18px;
  max-width: min(200px, 72vw);
  font-size: 12px;
}
body[data-chat-design="line"] .chip {
  border-radius: 999px;
  background: var(--d-chip-bg);
  border: 1.5px solid var(--d-chip-border);
  color: var(--d-chip-text);
  font-weight: 600;
  font-size: 12px;
  padding: 6px 14px;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
body[data-chat-design="line"] .chip:active {
  transform: scale(0.95);
}
body[data-chat-design="line"] .chip.is-selected {
  background: var(--d-accent);
  border-color: var(--d-accent);
  color: #fff;
}
body[data-chat-design="line"] .chat-input-area:not(.is-visible) {
  display: none;
}
body[data-chat-design="line"] .chat-input-area.is-visible {
  display: flex;
  flex-wrap: wrap;
}
body[data-chat-design="line"] .chat-input-area {
  background: var(--d-header);
  border-top: 1px solid var(--d-border);
}
body[data-chat-design="line"] .chat-input-area input {
  background: var(--d-bg);
  border-color: var(--d-border);
}
body[data-chat-design="line"] .chat-input-area button {
  background: var(--d-accent);
}
body[data-chat-design="line"] .chat-input-area button:hover {
  background: #3730a3;
}
body[data-chat-design="line"] .chat-assist-chip {
  border-radius: 999px;
  border-color: var(--d-chip-border);
  color: var(--d-chip-text);
  background: var(--d-chip-bg);
}
body[data-chat-design="line"] .btn-solid {
  background: var(--d-accent);
  border-radius: 999px;
}
body[data-chat-design="line"] .btn-solid:hover {
  background: #3730a3;
}
body[data-chat-design="line"] .result-card {
  background: var(--d-accent);
  color: #fff;
  border: none;
  border-radius: 16px;
}
body[data-chat-design="line"] .result-card .result-lead,
body[data-chat-design="line"] .result-card .result-summary {
  color: rgba(255, 255, 255, 0.9);
}
body[data-chat-design="line"] .result-card h2 {
  color: #fff;
}
body[data-chat-design="line"] .answer-summary,
body[data-chat-design="line"] .goal-cta-block {
  border-color: var(--d-border);
}
body[data-chat-design="line"] .goal-form--line {
  background: var(--d-ai-bg);
  border: 1px solid var(--d-border);
  border-radius: 18px 18px 18px 4px;
  box-shadow: none;
  padding: 14px 16px;
  color: var(--d-ai-text);
}
body[data-chat-design="line"] .goal-form--line h4 {
  color: var(--d-fg);
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 6px;
}
body[data-chat-design="line"] .goal-form--line .desc,
body[data-chat-design="line"] .goal-form--line .hint {
  color: var(--d-muted);
  font-size: 12px;
  line-height: 1.6;
}
body[data-chat-design="line"] .goal-form--line .form-step {
  color: var(--d-muted);
}
body[data-chat-design="line"] .goal-form--line .form-step--active {
  color: var(--d-accent);
}
body[data-chat-design="line"] .goal-form--line .form-step--active .form-step-num {
  background: var(--d-accent);
  border-color: var(--d-accent);
  color: #fff;
}
body[data-chat-design="line"] .goal-form--line .form-step--done {
  color: var(--d-accent);
}
body[data-chat-design="line"] .goal-form--line .form-step--done .form-step-num {
  background: var(--d-chip-bg);
  border-color: var(--d-chip-border);
  color: var(--d-accent);
}
body[data-chat-design="line"] .goal-form--line .form-step-num {
  border-color: var(--d-border);
  background: var(--d-bg);
}
body[data-chat-design="line"] .goal-form--line .form-step-line {
  background: var(--d-border);
}
body[data-chat-design="line"] .goal-form--line .form-field label {
  color: var(--d-fg);
  font-size: 12px;
}
body[data-chat-design="line"] .goal-form--line .form-input {
  background: var(--d-bg);
  border-color: var(--d-border);
  border-radius: 12px;
  color: var(--d-fg);
}
body[data-chat-design="line"] .goal-form--line .form-input:focus {
  border-color: var(--d-accent);
  box-shadow: 0 0 0 2px rgba(67, 56, 202, 0.15);
}
body[data-chat-design="line"] .goal-form--line .consent-label {
  color: var(--d-fg);
  font-size: 12px;
}
body[data-chat-design="line"] .goal-form--line .consent-label a {
  color: var(--d-accent);
}
body[data-chat-design="line"] .goal-form--line .form-confirm-dl dt {
  color: var(--d-muted);
}
body[data-chat-design="line"] .goal-form--line .form-confirm-dl dd {
  color: var(--d-fg);
}
body[data-chat-design="line"] .goal-form--line .btn-ghost {
  border-radius: 999px;
  border-color: var(--d-border);
  color: var(--d-accent);
  background: transparent;
}
body[data-chat-design="line"] .goal-form--line.form-complete {
  text-align: center;
}

/* --- Phase panels: diagnosing / result (PanelWarm full-page) --- */
.chat-phase-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: block;
}
.chat-phase-panel.is-hidden { display: none !important; }

.diagnosing-screen {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 6vw, 40px) clamp(20px, 5vw, 40px) 48px;
}
.diagnosing-screen--warm {
  max-width: 32rem;
  margin: 0 auto;
}
.diagnosing-dots {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
}
.diagnosing-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--d-accent, #F5C440);
  animation: diagnosing-pulse 1.3s ease-in-out infinite;
}
.diagnosing-headline {
  font-size: clamp(1.25rem, 3.5vw, 1.5rem);
  line-height: 1.65;
  color: var(--d-fg, #1C1810);
  white-space: pre-line;
  margin: 0 0 28px;
}
.diagnosing-headline--inline {
  font-size: 12px;
  font-weight: 600;
  margin: 10px 0 8px;
  white-space: normal;
}
.diagnosing-message {
  font-size: 14px;
  line-height: 1.75;
  color: var(--d-muted, #7A7060);
  min-height: 3rem;
  margin: 0;
  transition: opacity 0.35s ease;
}
.diagnosing-message--inline {
  font-size: 11px;
  min-height: 2.5rem;
}
.diagnosing-bubble {
  max-width: min(260px, 82vw) !important;
  padding: 14px 16px !important;
}
.line-diagnosing-block { margin-top: 4px; }

@keyframes diagnosing-pulse {
  0%, 100% { transform: scale(1); opacity: 0.45; }
  50% { transform: scale(1.45); opacity: 1; }
}

.result-screen {
  padding: clamp(24px, 5vw, 32px) clamp(20px, 5vw, 40px) 48px;
}
.result-screen--warm {
  max-width: 36rem;
  margin: 0 auto;
}
.result-done-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--d-muted, #7A7060);
  margin-bottom: 28px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.result-done-chip.is-visible,
[data-result-step].is-visible {
  opacity: 1;
  transform: translateY(0);
}
.result-done-chip-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--d-accent, #F5C440);
  color: #1C1810;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}
.result-headline {
  font-size: clamp(1.75rem, 4.5vw, 2rem);
  line-height: 1.45;
  color: var(--d-fg, #1C1810);
  font-weight: 500;
  margin: 0 0 24px;
}
.result-accent-rule {
  width: 44px;
  height: 2px;
  background: var(--d-accent, #F5C440);
  border-radius: 1px;
  margin-bottom: 20px;
}
.result-personal {
  font-size: 14px;
  line-height: 1.85;
  color: rgba(28, 24, 16, 0.82);
  margin: 0 0 32px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.result-personal strong {
  font-weight: 600;
  color: var(--d-fg, #1C1810);
}
.result-candidates {
  margin-bottom: 8px;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.result-candidate-cards {
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}
.result-candidate-card {
  flex: 1;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--d-border, rgba(0, 0, 0, 0.08));
  overflow: hidden;
}
.result-candidate-logo {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.result-candidate-bar {
  display: block;
  height: 5px;
  border-radius: 2px;
  opacity: 0.3;
}
.result-candidate-body {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.result-candidate-line {
  display: block;
  height: 6px;
  background: #EAEAEA;
  border-radius: 2px;
}
.result-candidate-line--lg { width: 68%; }
.result-candidate-line--sm { width: 44%; height: 5px; background: #F2F2F2; }
.result-candidate-line--xs { width: 52%; height: 4px; background: #F2F2F2; }
.result-candidate-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  padding-top: 2px;
}
.result-candidate-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--d-accent, #F5C440);
  flex-shrink: 0;
}
.result-candidates-caption {
  font-size: 10px;
  text-align: center;
  color: var(--d-muted, #7A7060);
  margin: 0;
}
.result-video-block {
  margin-bottom: 32px;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.result-video-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--d-fg, #1C1810);
  margin: 0 0 12px;
  line-height: 1.5;
}
.result-video-iframe-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #111;
  border: 1px solid var(--d-border, rgba(0, 0, 0, 0.08));
}
.result-video-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.line-result-video {
  margin: 16px 0 4px;
  opacity: 1;
  transform: none;
}
.line-result-video .result-video-iframe-wrap {
  border-radius: 10px;
}
.result-cta-block {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.result-divider {
  height: 1px;
  background: var(--d-border, rgba(0, 0, 0, 0.08));
  margin: 28px 0;
}
.result-body-copy {
  font-size: 14px;
  line-height: 1.85;
  color: var(--d-muted, #7A7060);
  margin: 0 0 24px;
}
.result-cta-primary {
  display: block;
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 0;
  background: var(--d-accent, #F5C440);
  color: #1C1810;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 12px;
  transition: opacity 0.2s ease;
}
.result-cta-primary:hover { opacity: 0.85; }
.result-cta-secondary {
  display: block;
  width: 100%;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--d-muted, #7A7060);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s ease;
}
.result-cta-secondary:hover { color: var(--d-fg, #1C1810); }
.result-restart {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 24px;
  padding: 0;
  border: none;
  background: transparent;
  color: rgba(122, 112, 96, 0.45);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s ease;
}
.result-restart:hover { color: var(--d-muted, #7A7060); }

body[data-chat-design="line"] .line-result-card {
  margin: 8px 8px 16px;
  padding: 16px;
  border-radius: 16px;
  background: var(--d-user-bg, #4338CA);
  color: #fff;
  animation: rise-in 0.35s var(--ease) both;
}
body[data-chat-design="line"] .line-result-title {
  font-size: 12px;
  font-weight: 700;
  margin: 0 0 8px;
}
body[data-chat-design="line"] .line-result-body {
  font-size: 10px;
  line-height: 1.65;
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.82);
}
body[data-chat-design="line"] .line-result-cta {
  display: block;
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 999px;
  background: #fff;
  color: var(--d-accent, #4338CA);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
}
body[data-chat-design="line"] .line-result-restart {
  display: block;
  width: 100%;
  padding: 8px;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  cursor: pointer;
}

body[data-chat-design="clean"] [data-result-step] {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
body[data-chat-design="clean"] [data-result-step].is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  #screen-start.is-leaving,
  .is-enter,
  .start-cta-arrow-icon,
  #screen-chat.is-enter,
  .warm-typing-dot,
  .msg-typing-dot,
  .typewriter-cursor,
  .warm-msg-block.is-entering,
  .line-msg-block.is-entering,
  .warm-options-block.is-reveal,
  .msg-options-block.is-reveal,
  body[data-chat-design="line"] .msg-options-block.is-reveal .chip,
  body[data-chat-design="line"] .msg-options-block.is-reveal .line-image-option,
  .line-msg-block.is-enter,
  .diagnosing-dot,
  [data-result-step] {
    animation: none !important;
    transition: none !important;
    transform: none !important;
    opacity: 1 !important;
  }
}

