@font-face {
  font-family: "Inter";
  src: url("assets/fonts/InterVariable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: "Noto Sans JP";
  src: url("assets/fonts/NotoSansJP-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --color-background: #F7F8FA;
  --color-surface: #FFFFFF;
  --color-border: #E6E8EC;
  --color-text: #0B2545;
  --color-muted: #526478;
  --color-ink: #0B2545;
  --color-accent: #14B8A6;
  --color-accent-text: #0F766E;
  --color-evidence: #FDE68A;
  --color-match: #15743A;
  --color-mismatch: #C11F1F;
  --color-information: #2563EB;
  --radius-card: 12px;
  --radius-control: 8px;
  --shadow-subtle: 0 1px 2px rgba(15,23,42,.06);
  --shadow-raised: 0 8px 24px rgba(15,23,42,.08);
  --motion-standard: 200ms cubic-bezier(.2,.8,.2,1);
  font-family: "Inter", "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", system-ui, sans-serif;
  color: var(--color-text);
  background: var(--color-background);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--color-background);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--color-background);
  color: var(--color-text);
  font-size: 16px;
  line-height: 1.6;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon {
  display: block;
  flex: 0 0 auto;
  fill: none;
}

.icon--16 {
  width: 16px;
  height: 16px;
}

.icon--20 {
  width: 20px;
  height: 20px;
}

.icon--24 {
  width: 24px;
  height: 24px;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto minmax(360px, 1fr);
  align-items: center;
  width: 100%;
  height: 56px;
  padding: 0 24px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-subtle);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.brand__mark {
  display: grid;
  width: 36px;
  height: 36px;
  margin-right: 12px;
  place-items: center;
  border-radius: var(--radius-control);
  background: var(--color-accent);
  color: var(--color-surface);
}

.brand__name {
  overflow: hidden;
  color: var(--color-ink);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand__company {
  margin-left: 12px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
}

.breadcrumbs {
  justify-self: center;
}

.breadcrumbs__list {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs__item {
  display: flex;
  align-items: center;
}

.breadcrumbs__link,
.breadcrumbs__current,
.breadcrumbs__future {
  border: 0;
  background: none;
  font-size: 14px;
  white-space: nowrap;
}

.breadcrumbs__link {
  padding: 4px;
  color: var(--color-muted);
  cursor: pointer;
}

.breadcrumbs__current {
  color: var(--color-ink);
  font-weight: 700;
}

.breadcrumbs__future {
  color: var(--color-muted);
}

.breadcrumbs__separator {
  margin: 0 8px;
  color: var(--color-muted);
}

.topbar__actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 12px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.status-pill__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--color-match);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-ink);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: border-color var(--motion-standard), box-shadow var(--motion-standard), transform var(--motion-standard);
}

.button:hover {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-subtle);
}

.button:active {
  transform: translateY(1px);
}

.button--primary {
  border-color: var(--color-accent-text);
  background: var(--color-accent-text);
  color: var(--color-surface);
}

.button--quiet {
  background: var(--color-surface);
}

.screen-root {
  width: 100%;
  min-height: calc(100vh - 104px);
  padding-bottom: 48px;
}

.screen-root--experience {
  padding-bottom: 48px;
}

.screen {
  width: 100%;
  max-width: 1280px;
  min-height: calc(100vh - 104px);
  margin: 0 auto;
  padding: 40px;
}

.screen--experience {
  max-width: 1440px;
}

/* 選択画面はデスクトップで縦中央へ寄せ、画面下半分の空白をなくす。
   内容が画面より高い場合は flex の自動伸長で従来どおり上から流れる。
   closing は CTA と下部バーの間隔契約（AC23: 24px 以上）を優先し対象外。 */
@media (min-width: 1280px) {
  .screen--industry,
  .screen--usecases {
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .screen--industry .screen-heading,
  .screen--usecases .screen-heading {
    flex: 0 0 auto;
  }
}

.screen-enter {
  animation: screen-enter var(--motion-standard) both;
}

@keyframes screen-enter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.screen-heading {
  max-width: 920px;
  margin-bottom: 32px;
  text-align: left;
}

.screen-heading__eyebrow {
  margin: 0 0 8px;
  color: var(--color-accent-text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
}

.screen-heading__title {
  margin: 0;
  color: var(--color-ink);
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.35;
}

.screen-heading__subtitle {
  margin: 8px 0 0;
  color: var(--color-muted);
  font-size: 18px;
  line-height: 1.6;
}

/* 公開デモの前提は業界画面だけに一行で置き、本文の情報密度を変えない。 */
.screen-heading__disclaimer {
  margin: 2px 0 0;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.5;
  white-space: nowrap;
}

.industry-grid {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
}

/* 公開数から求めた列・行数を受け取り、3件以下は1行、4件以上は3列で揃える。 */
.industry-featured-grid {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(var(--featured-columns), minmax(0, 1fr));
  grid-template-rows: repeat(var(--featured-rows), 160px);
  gap: 16px;
}

.industry-card {
  position: relative;
  display: flex;
  width: 360px;
  height: 160px;
  flex-direction: column;
  padding: 20px 24px;
  overflow: visible;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  color: var(--color-text);
  text-align: left;
  cursor: default;
  box-shadow: var(--shadow-subtle);
  transition: border-color var(--motion-standard), box-shadow var(--motion-standard), transform var(--motion-standard);
}

.industry-card--available {
  border-color: var(--color-accent);
  cursor: pointer;
}

/* 公開中の各業界を主役として表示し、未公開チップとの面積差を明確にする。 */
.industry-card--featured {
  display: grid;
  width: 100%;
  height: 160px;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: start;
  column-gap: 16px;
  padding: 20px 24px;
}

.industry-card--featured .industry-card__copy {
  margin-top: 0;
}

/* 未公開業界は操作要素にせず、名称と公開状態だけを一行で確認できる一覧にする。 */
.industry-chips {
  display: grid;
  grid-template-columns: repeat(var(--chip-count), minmax(0, 1fr));
  gap: 12px;
}

.industry-chip {
  display: flex;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-muted);
  box-shadow: var(--shadow-subtle);
}

.industry-chip__name {
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.industry-chip .availability-pill {
  flex: 0 0 auto;
}

.industry-card:hover,
.industry-card:focus-visible {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-raised);
  transform: translateY(-2px);
}

.industry-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
}

.industry-card__icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  color: var(--color-ink);
}

.industry-card--available .industry-card__icon {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.availability-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 10px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 600;
}

.industry-card__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  margin-top: 12px;
}

.industry-card__name {
  color: var(--color-ink);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}

.industry-card__scene-label {
  margin-top: 4px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.industry-card__scene {
  margin-top: 2px;
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.45;
  white-space: normal;
}

.industry-card__tooltip {
  position: absolute;
  right: 16px;
  bottom: -40px;
  z-index: 4;
  max-width: 320px;
  padding: 8px 12px;
  border-radius: var(--radius-control);
  background: var(--color-ink);
  color: var(--color-surface);
  font-size: 12px;
  line-height: 1.4;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity var(--motion-standard), transform var(--motion-standard);
}

.industry-card:hover .industry-card__tooltip,
.industry-card:focus-visible .industry-card__tooltip {
  opacity: 1;
  transform: translateY(0);
}

.screen--usecases {
  padding-top: 32px;
  padding-bottom: 32px;
}

.screen--usecases .screen-heading {
  margin-bottom: 24px;
}

.screen--usecases .screen-heading__title {
  font-size: 28px;
}

.screen--usecases .screen-heading__subtitle {
  font-size: 16px;
}

.usecase-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.usecase-row {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(280px, 1fr) 176px 264px 128px;
  align-items: center;
  width: 100%;
  height: 96px;
  gap: 16px;
  padding: 0 20px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-subtle);
  transition: border-color var(--motion-standard), box-shadow var(--motion-standard), transform var(--motion-standard);
}

.usecase-row:hover,
.usecase-row:focus-visible,
.usecase-row--selected {
  border-color: var(--color-accent);
  box-shadow: var(--shadow-raised);
  transform: translateY(-2px);
}

.usecase-row--selected {
  position: sticky;
  top: 64px;
  z-index: 3;
}

.usecase-row__number {
  color: var(--color-muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.usecase-row__title {
  min-width: 0;
  color: var(--color-ink);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -.01em;
  line-height: 1.45;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-height: 32px;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.file-types {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.file-type {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.file-type .icon {
  color: var(--color-information);
}

.usecase-row__action {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 8px;
  color: var(--color-accent-text);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

/* 回答形式はプレゼンターの選択補助に留め、カード本文の配置には参加させない。 */
.answer-kind-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.usecase-row__answer-kind {
  position: absolute;
  right: 20px;
  bottom: 8px;
  pointer-events: none;
}

.screen--experience {
  min-height: calc(100vh - 104px);
  padding: 16px 24px 20px;
}

.experience-stepper {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  margin: 0 0 10px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  list-style: none;
}

.experience-step {
  min-width: 0;
  border-right: 1px solid var(--color-border);
  color: var(--color-muted);
}

.experience-step:last-child {
  border-right: 0;
}

.experience-step--active {
  color: var(--color-ink);
  box-shadow: inset 0 -3px 0 var(--color-accent);
}

.experience-step__button {
  display: flex;
  width: 100%;
  min-height: 40px;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.experience-step__number {
  display: grid;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  font-size: 12px;
}

.experience-step--active .experience-step__number {
  border-color: var(--color-accent-text);
  background: var(--color-accent-text);
  color: var(--color-surface);
}

.screen--experience .screen-heading {
  position: relative;
  max-width: none;
  margin-bottom: 10px;
  padding-right: 96px;
}

.screen--experience .screen-heading__eyebrow {
  margin-bottom: 2px;
  font-size: 12px;
  line-height: 1.4;
}

.screen--experience .screen-heading__title {
  font-size: 28px;
  line-height: 1.3;
}

.experience-heading__answer-kind {
  position: absolute;
  right: 0;
  bottom: 7px;
}

.question-card {
  display: flex;
  width: 100%;
  gap: 16px;
  padding: 20px 24px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-subtle);
}

.question-card--compact {
  min-height: 62px;
  align-items: center;
  padding: 9px 16px;
  border-left: 3px solid var(--color-ink);
}

.question-card__icon {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border-radius: 999px;
  background: var(--color-ink);
  color: var(--color-surface);
}

.question-card__copy {
  min-width: 0;
}

.question-card__meta {
  display: block;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.question-card p {
  margin: 2px 0 0;
  color: var(--color-ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.45;
}

.experience-stage {
  width: 100%;
  margin-top: 12px;
}

/* 散在する資料は保管場所を面、答えの断片を右の一本の流れとして見せる。 */
.scatter-layout {
  display: grid;
  height: 390px;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
}

.scatter-lanes {
  display: grid;
  min-width: 0;
  /* 6断片でも各保管場所を一段に収め、1280px幅でカードの縦切れを防ぐ。 */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.scatter-lane {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.scatter-lane__heading {
  display: flex;
  height: 32px;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-ink);
}

.scatter-lane__heading h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.scatter-lane__cards {
  display: grid;
  gap: 6px;
  padding: 6px;
}

.scatter-card {
  display: grid;
  min-width: 0;
  min-height: 68px;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-background);
}

.scatter-card__thumbnail {
  width: 76px;
  height: 100%;
  min-height: 68px;
  object-fit: cover;
  border-right: 1px solid var(--color-border);
  background: var(--color-surface);
}

.scatter-card__body {
  display: grid;
  min-width: 0;
  align-content: center;
  padding: 5px 8px 5px 0;
}

.scatter-card__body strong,
.scatter-card__version,
.scatter-card q {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scatter-card__body strong {
  color: var(--color-ink);
  font-size: 14px;
  line-height: 1.3;
}

.scatter-card__version {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.scatter-card q {
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.4;
}

.scatter-collector {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 16px;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-subtle);
}

.scatter-collector__heading {
  display: flex;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.scatter-collector__icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-control);
  color: var(--color-accent);
}

.scatter-collector__copy h2,
.scatter-collector__copy p {
  margin: 0;
}

.scatter-collector__copy h2 {
  color: var(--color-ink);
  font-size: 18px;
  line-height: 1.35;
}

.scatter-collector__copy p {
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.4;
}

.scatter-fragments {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  margin: 8px 0;
  padding: 0;
  list-style: none;
}

.scatter-fragment {
  display: grid;
  min-height: 38px;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 5px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-background);
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity var(--motion-standard), transform var(--motion-standard), border-color var(--motion-standard);
}

.scatter-fragment--arrived {
  border-color: var(--color-accent);
  opacity: 1;
  transform: translateX(0);
}

.scatter-fragment__number {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: var(--color-accent-text);
  color: var(--color-surface);
  font-size: 12px;
  font-weight: 700;
}

.scatter-fragment q {
  overflow: hidden;
  color: var(--color-ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scatter-final-message {
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid var(--color-border);
  color: var(--color-ink);
  font-size: 16px;
  font-weight: 700;
  opacity: 0;
  transition: opacity var(--motion-standard);
}

.scatter-final-message--visible {
  opacity: 1;
}

/* ②と③は質問→回答の骨格を共有し、固有クラスでは質感だけを変える。 */
.chat-thread {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.chat-message {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 8px;
}

.chat-message__avatar {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-muted);
}

.chat-message__body {
  min-width: 0;
  flex: 1 1 auto;
}

.chat-message__label {
  display: block;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.chat-message__text {
  margin: 2px 0 0;
}

/* 素RAGだけは意図的に製品色を弱め、出典のない一般チャットとして見せる。 */
.naive-layout {
  display: grid;
  height: 300px;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
}

.naive-chat,
.naive-review {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-background);
}

.naive-chat__top {
  display: flex;
  height: 42px;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 14px;
  font-weight: 700;
}

.naive-chat__thread {
  gap: 0;
}

.naive-chat__thread .chat-message {
  display: block;
}

.naive-chat__thread .chat-message__avatar {
  display: none;
}

.naive-source-state {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
}

.naive-query,
.naive-answer {
  margin: 12px 16px;
  padding: 10px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
}

.naive-query {
  margin-left: 14%;
}

.naive-query > span,
.naive-answer__label {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
}

.naive-query p,
.naive-answer__text {
  margin: 2px 0 0;
  color: var(--color-text);
  font-size: 16px;
  line-height: 1.6;
}

.naive-answer__text--typing::after {
  display: inline-block;
  width: 1px;
  height: 1em;
  margin-left: 3px;
  background: var(--color-muted);
  content: "";
  vertical-align: -2px;
  animation: typing-caret 200ms cubic-bezier(.2,.8,.2,1) infinite alternate;
}

@keyframes typing-caret {
  from { opacity: 0; }
  to { opacity: 1; }
}

.naive-mark {
  position: relative;
}

.naive-mark sup {
  display: none;
  margin-left: 2px;
  color: var(--color-mismatch);
  font-size: 12px;
  font-weight: 700;
}

.naive-mark--revealed {
  color: var(--color-mismatch);
  text-decoration: underline 2px var(--color-mismatch);
  text-underline-offset: 4px;
}

.naive-mark--revealed sup {
  display: inline;
}

.naive-review {
  position: relative;
  padding: 14px;
  background: var(--color-surface);
}

.naive-review h2 {
  margin: 34px 0 8px;
  color: var(--color-ink);
  font-size: 18px;
}

.naive-annotation-legend {
  display: flex;
  min-height: 18px;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin: -4px 0 6px;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.3;
}

.naive-annotation-legend__item {
  white-space: nowrap;
}

.naive-summary {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border: 1px solid var(--color-mismatch);
  border-radius: 999px;
  color: var(--color-mismatch);
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  transition: opacity var(--motion-standard);
}

.naive-summary--visible {
  opacity: 1;
}

.naive-annotations {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.naive-annotation {
  display: grid;
  min-height: 42px;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 0 8px;
  padding: 4px 8px;
  border-left: 2px solid var(--color-mismatch);
  background: color-mix(in srgb, var(--color-mismatch) 6%, var(--color-surface));
  opacity: 0.4;
  transform: translateY(4px);
  filter: blur(5px) grayscale(55%);
  user-select: none;
  transition: opacity var(--motion-standard), transform var(--motion-standard), filter var(--motion-standard);
}

.naive-annotation--visible {
  opacity: 1;
  transform: translateY(0);
  filter: none;
  user-select: auto;
}

.naive-review__hint {
  margin: 0 0 8px;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.5;
}

.naive-review__hint[hidden] {
  display: none;
}

.naive-annotation__number {
  display: grid;
  width: 22px;
  height: 22px;
  grid-row: 1 / span 2;
  place-items: center;
  border-radius: 999px;
  background: var(--color-mismatch);
  color: var(--color-surface);
  font-size: 12px;
  font-weight: 700;
}

.naive-annotation__label {
  overflow: hidden;
  color: var(--color-mismatch);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.naive-annotation__correct {
  overflow: hidden;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.naive-check {
  position: absolute;
  right: 14px;
  bottom: 12px;
  min-height: 34px;
  padding: 6px 12px;
}

.naive-check:disabled {
  border-color: var(--color-border);
  background: var(--color-border);
  cursor: default;
}

.naive-closing {
  margin: 10px 0 0;
  padding: 9px 14px;
  border-left: 3px solid var(--color-mismatch);
  background: var(--color-surface);
  color: var(--color-ink);
  font-size: 16px;
  font-weight: 700;
  opacity: 0;
  transition: opacity var(--motion-standard);
}

.naive-closing--visible {
  opacity: 1;
}

.naive-footnote {
  margin: 6px 0 0;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.4;
}

/* 根拠つき回答は左の結論と右の原文を常に同時表示する。 */
.grounded-pipeline {
  display: grid;
  width: min(560px, 100%);
  height: 34px;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.grounded-pipeline__item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 700;
  transition: color var(--motion-standard), border-color var(--motion-standard), background var(--motion-standard);
}

.grounded-pipeline__item--active {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.grounded-pipeline__item--complete {
  border-color: var(--color-match);
  background: color-mix(in srgb, var(--color-match) 7%, var(--color-surface));
  color: var(--color-match);
}

.grounded-pipeline__icon {
  display: grid;
  place-items: center;
}

.grounded-layout {
  display: grid;
  height: clamp(380px, calc(100vh - 420px), 520px);
  grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: 12px;
  opacity: 1;
  transition: opacity var(--motion-standard), transform var(--motion-standard);
}

.grounded-layout--preparing {
  opacity: .18;
  transform: translateY(4px);
  pointer-events: none;
}

.grounded-answer,
.evidence-viewer {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.grounded-answer {
  border-top: 3px solid var(--color-accent);
}

.grounded-panel-heading {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--color-border);
}

.grounded-panel-heading h2 {
  margin: 0;
  color: var(--color-ink);
  font-size: 16px;
  font-weight: 700;
}

.grounded-panel-tools {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.grounded-scroll-hint {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.grounded-questions-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  border: 0;
  background: transparent;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.grounded-questions-button:hover {
  color: var(--color-accent-text);
}

.grounded-answer__scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-color: var(--color-accent) var(--color-background);
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.grounded-answer__scroll::-webkit-scrollbar {
  width: 10px;
}

.grounded-answer__scroll::-webkit-scrollbar-track {
  background: var(--color-background);
}

.grounded-answer__scroll::-webkit-scrollbar-thumb {
  border: 2px solid var(--color-background);
  border-radius: 999px;
  background: var(--color-accent);
}

.grounded-answer__summary {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 15px;
  line-height: 1.5;
}

.grounded-lines {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 8px;
  list-style: none;
}

.grounded-line {
  display: grid;
  width: 100%;
  min-height: 38px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 5px 7px 5px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--motion-standard), background var(--motion-standard);
}

.grounded-line--active {
  border-color: var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 6%, var(--color-surface));
}

.grounded-line__text {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.evidence-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border: 1px solid var(--color-accent);
  border-radius: 999px;
  color: var(--color-accent);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.mechanical-checks {
  padding: 0 8px 8px;
}

.mechanical-checks h3 {
  margin: 0 0 5px;
  color: var(--color-muted);
  font-size: 12px;
}

.mechanical-checks__list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.mechanical-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-muted);
  font-size: 11px;
  font-weight: 600;
  opacity: .45;
  transition: opacity var(--motion-standard), color var(--motion-standard), border-color var(--motion-standard);
}

.mechanical-check--matched {
  border-color: var(--color-match);
  color: var(--color-match);
  opacity: 1;
}

.verified-strip {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-top: 1px solid var(--color-match);
  background: color-mix(in srgb, var(--color-match) 8%, var(--color-surface));
  color: var(--color-match);
  font-size: 14px;
  font-weight: 700;
}

.evidence-position {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
}

.evidence-viewer__tabs {
  min-height: 32px;
  border-bottom: 1px solid var(--color-border);
  overflow-x: auto;
}

.evidence-tabs {
  display: flex;
  min-width: min-content;
  gap: 4px;
  padding: 4px 8px;
}

.evidence-tab {
  display: inline-flex;
  max-width: 240px;
  min-height: 24px;
  align-items: center;
  gap: 5px;
  padding: 2px 7px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.evidence-tab span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.evidence-tab--active {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.evidence-viewer__body {
  min-height: 0;
  flex: 1 1 auto;
  overflow: auto;
  background: var(--color-background);
}

/* Issue 137: 左58%のチャットと、右42%の一覧＋展開ビューアを一画面に固定する。 */
.experience-stage--step-3 {
  margin-top: 8px;
}

.grounded-layout {
  display: grid;
  height: clamp(550px, calc(100vh - 250px), 720px);
  grid-template-columns: minmax(0, 58fr) minmax(0, 42fr);
  gap: 12px;
  opacity: 1;
  transform: none;
}

.grounded-answer {
  position: relative;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-top: 3px solid var(--color-accent);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.grounded-panel-heading {
  min-height: 36px;
  padding: 4px 10px;
}

.grounded-panel-heading h2 {
  font-size: 15px;
}

.grounded-answer__scroll {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
}

.grounded-chat {
  gap: 8px;
  padding: 8px 10px;
}

.grounded-chat .chat-message__avatar {
  border-color: var(--color-ink);
  background: var(--color-ink);
  color: var(--color-surface);
}

.grounded-chat .chat-message--assistant .chat-message__avatar {
  border-color: var(--color-accent);
  background: var(--color-accent);
}

.grounded-chat .chat-message__body {
  max-width: calc(100% - 40px);
  padding: 16px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
}

.grounded-chat .chat-message--user .chat-message__body {
  margin-right: 10%;
  background: var(--color-background);
}

.grounded-chat .chat-message--assistant .chat-message__body {
  border-top: 2px solid var(--color-accent);
  box-shadow: var(--shadow-subtle);
}

.grounded-chat .chat-message__text {
  color: var(--color-text);
  font-size: 16px;
  line-height: 1.6;
}

.grounded-pipeline {
  width: 100%;
  height: 28px;
  margin: 6px 0 10px;
  gap: 4px;
}

.grounded-pipeline__item {
  gap: 3px;
  border-radius: var(--radius-control);
  font-size: 12px;
  line-height: 1;
}

.grounded-pipeline__icon .icon {
  width: 12px;
  height: 12px;
}

.grounded-chat__content {
  min-height: 0;
}

.grounded-typing-text {
  min-height: 116px;
}

.grounded-typing-text--typing::after {
  display: inline-block;
  width: 1px;
  height: 1em;
  margin-left: 3px;
  background: var(--color-accent);
  content: "";
  vertical-align: -2px;
  animation: typing-caret 200ms cubic-bezier(.2,.8,.2,1) infinite alternate;
}

.chat-sentences {
  display: grid;
}

/* Issue 139: 読む文章と根拠順を分離し、自然文を意味的なブロックで描画する。 */
.chat-answer-blocks {
  gap: 14px;
}

.chat-answer-block {
  margin: 0;
}

.chat-answer-block--ordered,
.chat-answer-block--bullets {
  padding-left: 20px;
}

.chat-answer-item {
  padding-left: 0;
}

.chat-answer-item + .chat-answer-item {
  margin-top: 4px;
}

.chat-answer-block--pending {
  display: none;
}

.chat-sentence {
  display: block;
  padding: 0;
  border-radius: var(--radius-control);
  color: var(--color-text);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
  opacity: 1;
  transition: background var(--motion-standard), opacity var(--motion-standard), text-decoration-color var(--motion-standard);
}

.chat-sentence--pending {
  opacity: 0;
}

.chat-sentence--active,
.chat-sentence--hover {
  background: color-mix(in srgb, var(--color-evidence) 38%, var(--color-surface));
  text-decoration: underline 3px var(--color-evidence);
  text-decoration-skip-ink: none;
  text-underline-offset: 3px;
}

.chat-sentence__links {
  display: inline-flex;
  gap: 2px;
  margin-left: 4px;
  vertical-align: 1px;
}

.evidence-link {
  display: inline-grid;
  width: 24px;
  height: 24px;
  padding: 0;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: var(--color-surface);
  color: var(--color-accent-text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
}

.evidence-link:hover,
.evidence-link:focus-visible {
  background: var(--color-accent);
  color: var(--color-surface);
}

.mechanical-checks {
  margin-top: 6px;
  padding: 5px 0 0;
  border-top: 1px solid var(--color-border);
}

.mechanical-checks__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.mechanical-checks__heading h3 {
  margin: 0;
  color: var(--color-muted);
  font-size: 12px;
  line-height: 1.3;
}

.mechanical-checks__count {
  color: var(--color-match);
  font-size: 12px;
  font-weight: 800;
}

.mechanical-checks__list {
  gap: 3px;
}

.mechanical-check {
  padding: 2px 5px;
  font-size: 12px;
  line-height: 1.25;
}

.mechanical-check .icon {
  width: 12px;
  height: 12px;
}

.grounded-evidence-pane {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: auto minmax(280px, 1fr);
  gap: 8px;
}

.evidence-list-panel,
.evidence-viewer {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.evidence-list-panel {
  align-self: start;
}

.evidence-list__header {
  display: flex;
  height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 12px;
  border-bottom: 1px solid var(--color-border);
}

.evidence-list__header h2 {
  margin: 0;
  color: var(--color-ink);
  font-size: 16px;
}

.evidence-list__status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.evidence-list__status--complete {
  color: var(--color-match);
}

.evidence-list__status-icon {
  display: grid;
  place-items: center;
}

.evidence-list {
  display: grid;
  overflow: visible;
}

.evidence-list__loading {
  margin: 0;
  padding: 10px;
  color: var(--color-muted);
  font-size: 12px;
}

.evidence-item {
  display: grid;
  width: 100%;
  height: 56px;
  min-width: 0;
  grid-template-columns: 22px 56px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  overflow: hidden;
  border: 0;
  border-bottom: 1px solid var(--color-border);
  border-left: 3px solid var(--color-surface);
  background: var(--color-surface);
  color: var(--color-text);
  text-align: left;
  cursor: pointer;
  transition: height 150ms cubic-bezier(.2,.8,.2,1), border-color var(--motion-standard), background var(--motion-standard);
}

.evidence-item:last-child {
  border-bottom: 0;
}

.evidence-item:hover,
.evidence-item--linked {
  background: color-mix(in srgb, var(--color-evidence) 24%, var(--color-surface));
}

.evidence-item--active {
  height: 72px;
  border-left-color: var(--color-accent);
  background: color-mix(in srgb, var(--color-accent) 7%, var(--color-surface));
}

.evidence-item__number {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-ink);
  font-size: 12px;
  font-weight: 800;
}

.evidence-item--active .evidence-item__number {
  border-color: var(--color-accent);
  color: var(--color-accent-text);
}

.evidence-format {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
  color: var(--color-information);
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.evidence-format .icon {
  width: 18px;
  height: 18px;
}

.evidence-item__copy {
  display: grid;
  min-width: 0;
  align-content: center;
  gap: 2px;
  overflow: hidden;
}

.evidence-item__metadata {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 5px;
  line-height: 1;
}

.evidence-item__title {
  flex: 1 1 auto;
  overflow: hidden;
  color: var(--color-ink);
  font-size: 14px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-item__version {
  flex: 0 0 auto;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.evidence-item__location {
  flex: 0 0 auto;
  color: var(--color-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.evidence-item__excerpt {
  display: -webkit-box;
  max-height: 20px;
  overflow: hidden;
  color: var(--color-muted);
  font-size: 14px;
  line-height: 1.5;
  opacity: 1;
  text-overflow: ellipsis;
  transition: max-height 150ms cubic-bezier(.2,.8,.2,1), opacity 150ms cubic-bezier(.2,.8,.2,1);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.evidence-item--active .evidence-item__excerpt {
  max-height: 39px;
  -webkit-line-clamp: 2;
}

.evidence-viewer {
  display: flex;
  min-height: 280px;
  flex-direction: column;
}

.evidence-viewer__header {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 12px;
  border-bottom: 1px solid var(--color-border);
}

.evidence-viewer__metadata {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 0 6px;
}

.evidence-position {
  grid-row: 1 / span 2;
  color: var(--color-accent-text);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.evidence-viewer__document {
  overflow: hidden;
  color: var(--color-ink);
  font-size: 14px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.evidence-viewer__location {
  color: var(--color-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}

.evidence-original-link {
  display: inline-flex;
  min-height: 24px;
  flex: 0 0 auto;
  align-items: center;
  gap: 3px;
  color: var(--color-accent-text);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.evidence-original-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.viewer-toolbar {
  display: flex;
  min-height: 30px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 10px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
}

.excel-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(92px, 1fr));
  padding: 8px;
}

.excel-cell {
  display: grid;
  min-width: 0;
  min-height: 42px;
  align-content: center;
  padding: 3px 6px;
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}

.excel-cell:nth-child(5n + 1) {
  border-left: 1px solid var(--color-border);
}

.excel-cell:nth-child(-n + 5) {
  border-top: 1px solid var(--color-border);
}

.excel-cell--highlighted {
  background: var(--color-evidence);
}

.excel-cell__reference {
  color: var(--color-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1;
}

.excel-cell__value {
  overflow: hidden;
  color: var(--color-ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  text-overflow: ellipsis;
}

.code-evidence {
  margin: 0 8px 8px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.code-lines-viewer {
  min-height: 100%;
}

.code-lines-viewer .code-evidence {
  margin-top: 8px;
}

.code-evidence__line {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 6px;
  padding: 2px 6px;
  color: var(--color-muted);
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.5;
}

.code-evidence__line--highlighted {
  background: var(--color-evidence);
  color: var(--color-ink);
}

.code-evidence code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdf-canvas {
  position: relative;
  width: fit-content;
  max-width: calc(100% - 16px);
  height: 238px;
  margin: 8px auto;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-subtle);
}

.pdf-canvas img {
  display: block;
  width: auto;
  height: 100%;
  object-fit: contain;
}

.pdf-marker {
  position: absolute;
  border: 3px solid var(--color-information);
  background: color-mix(in srgb, var(--color-evidence) 35%, transparent);
  pointer-events: none;
}

.document-page {
  width: calc(100% - 24px);
  margin: 8px auto;
  padding: 14px 18px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-subtle);
}

.document-page p {
  margin: 0 0 7px;
  color: var(--color-text);
  font-size: 13px;
  line-height: 1.5;
}

/* 図回答では本文階層を図内ラベルと揃え、左右ペインの文字段数を増やさない。 */
.diagram-layout .document-page p {
  font-size: 14px;
}

.document-page__highlight {
  background: var(--color-evidence);
}

.diagram-canvas {
  position: relative;
  margin: 8px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
}

.diagram-canvas img {
  display: block;
  width: 100%;
  height: 218px;
  object-fit: contain;
}

.diagram-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--color-information);
}

.diagram-overlay__path {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 12;
}

.diagram-overlay__node {
  fill: none;
  stroke: var(--color-evidence);
  stroke-width: 12;
}

.diagram-tags {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 8px 8px;
  color: var(--color-information);
}

.diagram-tags strong {
  font-size: 13px;
  line-height: 1.5;
}

.video-viewer {
  display: grid;
  min-height: 100%;
  grid-template-columns: minmax(0, 1.25fr) minmax(180px, .75fr);
  gap: 8px;
  padding: 8px;
}

.video-player-column video {
  display: block;
  width: 100%;
  max-height: 190px;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--color-border);
  background: var(--color-ink);
}

.video-jump {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  color: var(--color-information);
  font-size: 13px;
  line-height: 1.5;
}

.video-jump span:last-child {
  color: var(--color-muted);
  text-align: right;
}

.video-timeline {
  display: grid;
  align-content: start;
  gap: 4px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.video-timeline__item {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  padding: 5px;
  border-left: 2px solid var(--color-border);
  background: var(--color-surface);
}

.video-timeline__item--active {
  border-color: var(--color-information);
  background: color-mix(in srgb, var(--color-information) 7%, var(--color-surface));
}

.video-timeline time,
.video-timeline strong {
  color: var(--color-ink);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.video-timeline p {
  grid-column: 1 / -1;
  margin: 2px 0 0;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.5;
}

.glossary-captions {
  display: flex;
  justify-content: space-between;
  padding: 8px 42px 0;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
}

.glossary-graph {
  display: block;
  width: 100%;
  height: 240px;
  color: var(--color-ink);
}

.glossary-graph text {
  fill: currentColor;
  font-family: "Inter", "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
}

.glossary-graph__edge {
  stroke: var(--color-accent);
  stroke-width: 3;
}

.glossary-graph__variant {
  fill: var(--color-surface);
  stroke: var(--color-border);
  stroke-width: 2;
}

.glossary-graph__canonical {
  fill: var(--color-evidence);
  stroke: var(--color-accent);
  stroke-width: 3;
}

.glossary-graph__canonical-text {
  fill: var(--color-ink);
  font-size: 20px;
}

.glossary-graph__result {
  fill: var(--color-surface);
  stroke: var(--color-match);
  stroke-width: 3;
}

.diff-viewer {
  padding-bottom: 8px;
}

.diff-table {
  width: calc(100% - 16px);
  margin: 8px;
  border-collapse: collapse;
  table-layout: fixed;
  background: var(--color-surface);
}

.diff-table th,
.diff-table td {
  padding: 6px 8px;
  border: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 13px;
  line-height: 1.5;
  text-align: left;
  vertical-align: middle;
}

.diff-table thead th {
  color: var(--color-muted);
  font-weight: 700;
}

.diff-table tbody th {
  width: 42%;
}

.diff-table tbody th strong {
  display: block;
  margin-top: 2px;
  color: var(--color-ink);
}

.diff-kind {
  font-size: 12px;
  font-weight: 700;
}

.diff-row--changed {
  background: color-mix(in srgb, var(--color-information) 7%, var(--color-surface));
}

.diff-row--changed .diff-kind {
  color: var(--color-information);
}

.diff-row--added {
  background: color-mix(in srgb, var(--color-match) 7%, var(--color-surface));
}

.diff-row--added .diff-kind {
  color: var(--color-match);
}

.diff-row--removed {
  background: color-mix(in srgb, var(--color-mismatch) 7%, var(--color-surface));
}

.diff-row--removed .diff-kind {
  color: var(--color-mismatch);
}

.refusal-card {
  display: grid;
  width: calc(100% - 32px);
  min-height: 240px;
  margin: 12px auto;
  grid-template-columns: 44px minmax(0, 1fr);
  align-content: center;
  gap: 5px 12px;
  padding: 18px;
  border: 1px solid var(--color-match);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.refusal-card__icon {
  display: grid;
  width: 44px;
  height: 44px;
  grid-row: 1 / span 3;
  place-items: center;
  border: 1px solid var(--color-match);
  border-radius: 999px;
  color: var(--color-match);
}

.refusal-card__message {
  color: var(--color-ink);
  font-size: 20px;
  line-height: 1.45;
}

.refusal-card__nearby {
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 700;
}

.refusal-card ul {
  margin: 0;
  padding-left: 20px;
  color: var(--color-text);
  font-size: 14px;
}

.refusal-card__trust {
  grid-column: 1 / -1;
  margin: 10px 0 0;
  padding: 8px;
  border-left: 3px solid var(--color-match);
  background: color-mix(in srgb, var(--color-match) 7%, var(--color-surface));
  color: var(--color-ink);
  font-size: 16px;
  font-weight: 700;
}

.grounded-bottom {
  position: relative;
  height: 50px;
  flex: 0 0 50px;
  margin: 0 8px 8px;
}

.business-reason,
.experience-completion {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 10px;
  border: 1px solid var(--color-match);
  border-radius: var(--radius-control);
  background: color-mix(in srgb, var(--color-match) 6%, var(--color-surface));
}

.business-reason {
  color: var(--color-match);
}

.business-reason__label {
  font-size: 12px;
  font-weight: 700;
}

.business-reason strong {
  color: var(--color-ink);
  font-size: 13px;
  line-height: 1.35;
}

.experience-completion {
  justify-content: flex-end;
  border-color: var(--color-accent);
  background: var(--color-surface);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity var(--motion-standard), transform var(--motion-standard);
}

.experience-completion > strong {
  margin-right: auto;
  color: var(--color-ink);
  font-size: 13px;
}

.experience-completion--visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* Issue 149: 突合表は値・根拠番号・状態記号を同じセル内で読める密度に固定する。 */
.crosscheck-layout,
.diagram-layout {
  height: clamp(550px, calc(100vh - 237px), 840px);
}

/* 1600px以上は全抜粋を残しつつ、8根拠と280pxビューアをフッター上へ収める。 */
.crosscheck-layout .evidence-item,
.diagram-layout .evidence-item {
  height: 48px;
  padding-top: 4px;
  padding-bottom: 4px;
}

.crosscheck-layout .evidence-item--active,
.diagram-layout .evidence-item--active {
  height: 64px;
}

.grounded-answer__scroll--format {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 6px;
  padding: 6px 8px;
  overflow-x: hidden;
  overflow-y: auto;
}

.grounded-answer__scroll--format > .question-card {
  position: sticky;
  top: 0;
  z-index: 2;
  flex: 0 0 auto;
}

.crosscheck-content {
  display: grid;
  min-height: 0;
  flex: 0 0 auto;
  grid-template-rows: auto auto auto;
  gap: 6px;
  padding: 1px 0 0;
  overflow: visible;
}

.crosscheck-heading {
  display: flex;
  min-width: 0;
  min-height: 30px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.crosscheck-heading h3 {
  flex: 0 0 auto;
  margin: 0;
  color: var(--color-ink);
  font-size: 16px;
  line-height: 1.35;
}

.crosscheck-summary {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 2px 8px;
  color: var(--color-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 1.3;
}

.crosscheck-summary__item[data-status="match"] {
  color: var(--color-match);
}

.crosscheck-summary__item[data-status="mismatch"] {
  color: var(--color-mismatch);
}

.crosscheck-table {
  width: 100%;
  min-height: 0;
  border-spacing: 0;
  border-collapse: separate;
  table-layout: fixed;
  font-size: 13px;
  line-height: 1.25;
}

.crosscheck-table__row-label-column {
  width: 116px;
}

.crosscheck-table th,
.crosscheck-table td {
  min-width: 0;
  padding: 0;
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}

.crosscheck-table tr > :first-child {
  border-left: 1px solid var(--color-border);
}

.crosscheck-table thead th {
  height: 52px;
  border-top: 1px solid var(--color-border);
  background: var(--color-background);
  color: var(--color-muted);
  font-weight: 700;
  vertical-align: middle;
}

.crosscheck-table__corner,
.crosscheck-row__label {
  padding: 4px 7px !important;
  text-align: left;
}

.crosscheck-row__label {
  background: var(--color-background);
  color: var(--color-ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
}

.crosscheck-row {
  height: 46px;
}

.crosscheck-column-header {
  padding: 4px 5px !important;
}

.crosscheck-column-header__identity {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.crosscheck-column-header__identity > span {
  overflow: hidden;
  line-height: 1.1;
  overflow-wrap: anywhere;
  white-space: normal;
}

.crosscheck-column-header__identity .icon {
  color: var(--color-information);
}

.crosscheck-column-header__version {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin: 2px auto 0;
  padding: 1px 5px;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crosscheck-cell {
  position: relative;
  overflow: hidden;
  background: var(--color-surface);
  transition: background var(--motion-standard), box-shadow var(--motion-standard);
}

.crosscheck-cell--mismatch {
  background: color-mix(in srgb, var(--color-mismatch) 7%, var(--color-surface));
}

.crosscheck-cell__body {
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  padding: 3px 5px;
  border: 0;
  background: transparent;
  color: var(--color-text);
  text-align: left;
}

button.crosscheck-cell__body {
  cursor: pointer;
}

button.crosscheck-cell__body:hover,
.crosscheck-cell--linked,
.crosscheck-cell--active {
  background: color-mix(in srgb, var(--color-evidence) 30%, var(--color-surface));
}

.crosscheck-cell--active {
  box-shadow: inset 0 0 0 2px var(--color-accent-text);
}

.crosscheck-cell__content {
  display: grid;
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 3px;
  opacity: 0;
  transition: opacity var(--motion-standard);
}

.crosscheck-cell--revealed .crosscheck-cell__content {
  opacity: 1;
}

.crosscheck-cell__value {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  color: var(--color-text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.crosscheck-cell__evidence {
  width: 24px;
  height: 24px;
}

.crosscheck-cell__status {
  min-width: 14px;
  color: var(--color-muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
}

.crosscheck-cell--match .crosscheck-cell__status {
  color: var(--color-match);
}

.crosscheck-cell--mismatch .crosscheck-cell__status {
  color: var(--color-mismatch);
}

.crosscheck-cell--scanning {
  animation: crosscheck-scan 200ms cubic-bezier(.2,.8,.2,1) both;
}

.crosscheck-cell--presenter-highlight {
  animation: crosscheck-highlight 200ms cubic-bezier(.2,.8,.2,1) both;
}

@keyframes crosscheck-scan {
  from { box-shadow: inset 3px 0 0 var(--color-accent); }
  to { box-shadow: inset -3px 0 0 var(--color-accent); }
}

@keyframes crosscheck-highlight {
  from { box-shadow: inset 0 0 0 3px var(--color-mismatch); }
  to { box-shadow: inset 0 0 0 1px var(--color-mismatch); }
}

.crosscheck-conclusion,
.diagram-conclusion {
  min-height: 0;
  padding: 7px 9px;
  border-left: 3px solid var(--color-accent-text);
  background: var(--color-background);
}

.crosscheck-conclusion .chat-answer-blocks,
.diagram-conclusion .chat-answer-blocks {
  /* 結論・詳細・補足の意味ブロックを、通常回答と同じ12px以上で判別できるようにする。 */
  gap: 12px;
}

.crosscheck-conclusion .chat-sentence,
.diagram-conclusion .chat-sentence {
  font-size: 14px;
  line-height: 1.5;
}

/* SVGはinlineのまま、ノード→矢印→下段の順をCSSの線描画で見せる。 */
.diagram-content {
  display: flex;
  min-height: 0;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 6px;
  padding: 1px 0 0;
  overflow: visible;
}

.diagram-stage {
  display: block;
  width: 100%;
  min-width: 680px;
  min-height: 0;
  flex: 0 0 auto;
  overflow: visible;
}

.diagram-svg {
  display: block;
  width: 100%;
  min-width: 680px;
  max-width: none;
  height: auto;
  max-height: none;
  margin: 0;
  overflow: visible;
  color: var(--color-text);
}

.diagram-svg .dg-node,
.diagram-svg .dg-edge,
.diagram-svg .dg-row {
  opacity: 0;
  transition: opacity var(--motion-standard);
}

.diagram-svg .dg-node [pathLength],
.diagram-svg .dg-edge[pathLength],
.diagram-svg .dg-row [pathLength] {
  stroke-dashoffset: 1;
}

.diagram-svg .diagram-part--visible {
  opacity: 1;
}

.diagram-svg .diagram-part--visible [pathLength],
.diagram-svg .diagram-part--visible[pathLength],
.diagram-svg .diagram-stroke--visible {
  animation: diagram-stroke-in 200ms cubic-bezier(.2,.8,.2,1) both;
}

@keyframes diagram-stroke-in {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

.diagram-svg .dg-badge {
  color: var(--color-accent-text);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion-standard);
}

.diagram-stage--badges-visible .dg-badge {
  opacity: 1;
  pointer-events: auto;
}

.diagram-svg .dg-badge circle {
  fill: var(--color-surface) !important;
  stroke: var(--color-accent-text) !important;
}

.diagram-svg .dg-badge:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 3px;
}

.diagram-svg .diagram-element--linked [pathLength],
.diagram-svg .diagram-element--active [pathLength],
.diagram-svg .dg-badge.diagram-element--linked circle,
.diagram-svg .dg-badge.diagram-element--active circle {
  stroke: var(--color-accent-text) !important;
  stroke-width: 3;
}

.diagram-svg .dg-badge.diagram-element--active circle {
  fill: var(--color-accent) !important;
}

.diagram-svg .dg-badge.diagram-element--active text {
  fill: var(--color-ink) !important;
}

.questions-dialog {
  width: min(820px, calc(100% - 48px));
  max-height: min(720px, calc(100vh - 80px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-raised);
}

/* 回答＋提案が伸びても見切れないよう、開いている間は縦フレックスで
   一覧が譲り、回答欄は自前でスクロールできるようにする。 */
.questions-dialog[open] {
  display: flex;
  flex-direction: column;
}

.questions-dialog::backdrop {
  background: color-mix(in srgb, var(--color-ink) 30%, transparent);
}

.questions-dialog__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--color-border);
}

.questions-dialog__heading h2,
.questions-dialog__heading p {
  margin: 0;
}

.questions-dialog__heading h2 {
  color: var(--color-ink);
  font-size: 22px;
}

.questions-dialog__heading p {
  margin-top: 4px;
  color: var(--color-muted);
  font-size: 14px;
}

.questions-dialog__body {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 420px;
  padding: 12px;
  overflow-y: auto;
}

.questions-dialog__form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-background);
}

.questions-dialog__form input {
  min-width: 0;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 14px;
}

.questions-dialog__form input:focus {
  border-color: var(--color-accent);
  outline: 0;
}

.question-options {
  display: grid;
  gap: 6px;
}

.question-option {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.question-option:hover {
  border-color: var(--color-accent);
}

.question-option__action {
  flex: 0 0 auto;
  color: var(--color-accent);
  font-size: 12px;
  font-weight: 700;
}

.questions-dialog__result {
  flex: 0 0 auto;
  max-height: 300px;
  padding: 14px 20px;
  border-top: 1px solid var(--color-border);
  background: var(--color-background);
  overflow-y: auto;
}

.questions-dialog__result strong {
  color: var(--color-accent);
  font-size: 12px;
}

.questions-dialog__result .questions-dialog__matched {
  margin: 4px 0 0;
  color: var(--color-muted);
  font-size: 13px;
}

.questions-dialog__suggestions {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--color-muted);
  font-size: 13px;
  line-height: 1.6;
}

.questions-dialog__suggestions li + li {
  margin-top: 2px;
}

.questions-dialog__result p {
  margin: 4px 0 0;
  color: var(--color-ink);
  font-size: 16px;
}

.experience-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 48px;
  padding: 0 24px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-subtle);
}

/* 画面ごとの拡大倍率（--screen-zoom）。③は 1280 幅では等倍、広い画面では拡大する。 */
.screen-root--industry { --screen-zoom: 1; }
.screen-root--usecases { --screen-zoom: 1.08; }
.screen-root--step1 { --screen-zoom: 1.06; }
.screen-root--step2 { --screen-zoom: 1.12; }
.screen-root--step3 { --screen-zoom: 1; }
.screen-root--closing { --screen-zoom: 1; }

@media (min-width: 1600px) {
  .screen-root--industry { --screen-zoom: 1.08; }
  .screen-root--usecases { --screen-zoom: 1.32; }
  .screen-root--step1 { --screen-zoom: 1.3; }
  .screen-root--step2 { --screen-zoom: 1.38; }
  .screen-root--step3 { --screen-zoom: 1.12; }
  .screen-root--closing { --screen-zoom: 1.12; }

  /* ③の枠高さは vh を倍率で割ってから見出し分を引く（zoom 内で vh は拡大されない）。 */
  .screen-root--step3 .grounded-layout {
    height: clamp(550px, calc(100vh / var(--screen-zoom, 1) - 250px), 720px);
  }

  .screen-root--step3 .crosscheck-layout,
  .screen-root--step3 .diagram-layout {
    height: clamp(550px, calc(100vh / var(--screen-zoom, 1) - 248px), 840px);
  }
}

@media (min-width: 1900px) {
  .screen-root--industry { --screen-zoom: 1.1; }
  .screen-root--usecases { --screen-zoom: 1.5; }
  .screen-root--step1 { --screen-zoom: 1.4; }
  .screen-root--step2 { --screen-zoom: 1.5; }
  .screen-root--step3 { --screen-zoom: 1.16; }
  .screen-root--closing { --screen-zoom: 1.2; }
}

.screen-root--industry,
.screen-root--usecases,
.screen-root--step1,
.screen-root--step2,
.screen-root--step3,
.screen-root--closing {
  zoom: var(--screen-zoom, 1);
  /* zoom 内では vh が拡大されないため、最小高さと余白を倍率で割って画面内に収める。 */
  min-height: calc((100vh - 104px) / var(--screen-zoom, 1));
  padding-bottom: calc(48px / var(--screen-zoom, 1));
}

/* 広い画面では全画面の描画幅を 1720px に揃える（倍率で割った値を最大幅にする）。 */
.screen-root--industry .screen,
.screen-root--usecases .screen,
.screen-root--step1 .screen,
.screen-root--step2 .screen,
.screen-root--step3 .screen,
.screen-root--closing .screen {
  min-height: calc((100vh - 104px) / var(--screen-zoom, 1));
  max-width: calc(1720px / var(--screen-zoom, 1));
}

.screen-root--usecases .screen--usecases { padding-top: 24px; padding-bottom: 24px; }
.screen-root--usecases .screen--usecases .screen-heading { margin-bottom: 16px; }

.footer-controls {
  display: flex;
  justify-self: end;
  gap: 8px;
}

.footer-action {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  gap: 8px;
  padding: 4px 8px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--color-surface);
  color: var(--color-ink);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.footer-action--primary {
  min-height: 40px;
  padding: 6px 14px 6px 8px;
  gap: 10px;
  border-radius: 999px;
  background: var(--color-accent-text);
  color: var(--color-surface);
  font-size: 14px;
  box-shadow: var(--shadow-raised);
  animation: footer-primary-pulse 1.8s ease-in-out infinite;
}

.footer-action--primary .keycap {
  min-width: 52px;
  height: 28px;
  border-color: var(--color-surface);
  background: var(--color-surface);
  color: var(--color-accent-text);
  font-size: 13px;
  font-weight: 700;
}

.footer-action--primary .footer-action__arrow {
  font-size: 14px;
  font-weight: 700;
}

.footer-action--primary:hover,
.footer-action--primary:focus-visible {
  background: var(--color-accent);
  color: var(--color-ink);
}

.footer-action--primary:hover .keycap,
.footer-action--primary:focus-visible .keycap {
  color: var(--color-ink);
}

@keyframes footer-primary-pulse {
  0%, 100% { box-shadow: var(--shadow-raised), 0 0 0 0 var(--color-accent); }
  50% { box-shadow: var(--shadow-raised), 0 0 0 8px transparent; }
}

.footer-action--quiet {
  justify-self: start;
  color: var(--color-muted);
}

.footer-action:disabled {
  color: var(--color-muted);
  cursor: default;
}

.keycap {
  display: inline-grid;
  min-width: 24px;
  height: 22px;
  padding: 0 5px;
  place-items: center;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-background);
  color: var(--color-muted);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.progress-dots {
  display: flex;
  align-items: center;
  justify-self: center;
  gap: 8px;
}

.footer-context {
  justify-self: center;
  color: var(--color-muted);
  font-size: 12px;
  font-weight: 600;
}

.progress-dot {
  width: 24px;
  height: 24px;
  border: 7px solid transparent;
  border-radius: 999px;
  background: var(--color-surface);
  background-clip: padding-box;
  box-shadow: inset 0 0 0 1px var(--color-border);
}

.progress-dot--active {
  background: var(--color-accent);
  box-shadow: inset 0 0 0 1px var(--color-accent);
}

.screen--closing {
  padding: 8px 32px 8px;
}

.screen--closing .closing-heading {
  max-width: none;
  margin-bottom: 4px;
}

.screen--closing .closing-heading .screen-heading__eyebrow {
  margin-bottom: 1px;
  font-size: 13px;
  line-height: 1.35;
}

.screen--closing .closing-heading .screen-heading__title {
  font-size: 26px;
  font-weight: 650;
  line-height: 1.3;
}

.closing-illustration {
  width: min(100%, 1140px);
  margin: 0 auto;
}
.closing-illustration__image {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}
.closing-scenes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.closing-scenes--headings {
  margin-bottom: 4px;
}
.closing-scene__heading,
.closing-scene__detail {
  min-width: 0;
  margin: 0;
  text-align: center;
}
.closing-scene__heading {
  color: var(--color-ink);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
}
.closing-scene__detail {
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.closing-facts {
  display: grid;
  width: min(100%, 1140px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 16px auto 0;
}
/* 列幅は画像の三分割そのまま。タイルは左右8pxずつ内側に寄せ、列中心を画像の各シーンと一致させる。 */
.closing-fact {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0 8px;
  padding: 6px 12px 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  text-align: center;
}
.closing-fact strong {
  color: var(--color-ink);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}
.closing-fact span {
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}
.closing-cta {
  margin-top: 12px;
  text-align: center;
}
.closing-action-sentence {
  margin: 0;
  color: var(--color-ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}
.closing-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 20px;
}
.screen--closing .closing-actions .button {
  min-height: 48px;
  padding: 8px 24px;
  font-size: 14px;
}
.screen--closing .closing-actions .closing-contact {
  padding-right: 28px;
  padding-left: 28px;
  text-decoration: none;
}

.presenter-aids {
  position: fixed;
  right: 24px;
  bottom: 64px;
  z-index: 30;
  display: grid;
  width: min(340px, calc(100vw - 48px));
  gap: 8px;
  pointer-events: none;
}

.presenter-panel {
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-control);
  background: var(--color-surface);
  box-shadow: var(--shadow-raised);
  pointer-events: auto;
}

.presenter-panel__heading {
  display: block;
  margin-bottom: 6px;
  color: var(--color-ink);
  font-size: 12px;
  font-weight: 700;
}

.presenter-panel p {
  margin: 0;
  color: var(--color-text);
  font-size: 13px;
  line-height: 1.55;
}

.presenter-hints {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 5px 10px;
  margin: 0;
}

.presenter-hints dt {
  display: flex;
  gap: 4px;
}

.presenter-hints dd {
  margin: 0;
  color: var(--color-muted);
  font-size: 12px;
}

.loading-state {
  display: flex;
  min-height: calc(100vh - 56px);
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: var(--color-muted);
  font-size: 16px;
}

.loading-state__bar {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: var(--color-accent);
  animation: loading-pulse 200ms cubic-bezier(.2,.8,.2,1) infinite alternate;
}

@keyframes loading-pulse {
  from { transform: scaleX(.4); }
  to { transform: scaleX(1); }
}

.error-state {
  display: grid;
  width: min(560px, calc(100% - 48px));
  min-height: 280px;
  margin: 80px auto;
  padding: 32px;
  place-items: start;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
}

.error-state > .icon {
  color: var(--color-mismatch);
}

.error-state h1 {
  margin: 16px 0 0;
  color: var(--color-ink);
  font-size: 28px;
}

.error-state p {
  margin: 8px 0 24px;
  color: var(--color-muted);
  font-size: 16px;
}

/* Issue 140: 1280px幅では見出しを圧縮し、一覧全件と280pxビューアを同時表示する。 */
@media (max-width: 1599px) {
  .screen--experience[data-step="3"] .experience-stepper {
    margin-bottom: 4px;
  }

  .screen--experience[data-step="3"] .experience-step__button {
    min-height: 32px;
    padding-top: 3px;
    padding-bottom: 3px;
  }

  .screen--experience[data-step="3"] .experience-heading {
    display: flex;
    min-height: 30px;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 4px;
    padding-right: 96px;
  }

  .screen--experience[data-step="3"] .screen-heading__eyebrow {
    flex: 0 0 auto;
    margin: 0;
    white-space: nowrap;
  }

  .screen--experience[data-step="3"] .screen-heading__title {
    overflow: hidden;
    font-size: 24px;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .screen--experience[data-step="3"] .experience-heading__answer-kind {
    bottom: 7px;
  }

  .experience-stage--step-3 {
    margin-top: 0;
  }

  .grounded-layout {
    height: clamp(550px, calc(100vh - 192px), 720px);
  }

  .crosscheck-layout,
  .diagram-layout {
    height: clamp(550px, calc(100vh - 192px), 720px);
  }

  .evidence-item {
    height: 40px;
  }

  .evidence-item--active {
    height: 72px;
  }

  .evidence-item__excerpt {
    max-height: 0;
    opacity: 0;
  }

  .evidence-item--active .evidence-item__excerpt {
    max-height: 39px;
    opacity: 1;
    -webkit-line-clamp: 2;
  }

  /* 8根拠でも一覧と280pxビューアを1280×800へ同時に収める。 */
  .crosscheck-layout .evidence-item,
  .diagram-layout .evidence-item {
    height: 32px;
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .crosscheck-layout .evidence-item--active,
  .diagram-layout .evidence-item--active {
    height: 52px;
  }

  .crosscheck-layout .evidence-item--active .evidence-item__excerpt,
  .diagram-layout .evidence-item--active .evidence-item__excerpt {
    max-height: 20px;
    -webkit-line-clamp: 1;
  }
}

@media (max-width: 1199px) {
  .industry-featured-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .usecase-row {
    grid-template-columns: 40px minmax(260px, 1fr) 160px 220px 112px;
    gap: 12px;
    padding: 0 16px;
  }

  .usecase-row__answer-kind {
    right: 16px;
  }

  .brand__company {
    display: none;
  }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .breadcrumbs,
  .status-pill {
    display: none;
  }

  .industry-grid {
    grid-template-columns: 1fr;
  }

  .industry-card {
    width: 100%;
  }

  .usecase-row {
    height: auto;
    min-height: 112px;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    padding: 16px;
  }

  .role-pill,
  .file-types {
    grid-column: 2;
  }

  .usecase-row__action {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
}

/* issue 148: 原本由来の座標・段落・行番号を主役にしたローカル閲覧ページ。 */
.view-html,
body.view-page {
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

.view-icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.view-page .view-shell {
  display: flex;
  width: 100%;
  height: 100vh;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
}

.view-head {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  min-width: 0;
  min-height: 88px;
  flex: 0 0 auto;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  grid-template-rows: minmax(32px, auto) minmax(24px, auto);
  align-items: center;
  gap: 2px 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  box-shadow: var(--shadow-subtle);
}

.view-format-icon {
  display: grid;
  width: 40px;
  height: 40px;
  grid-column: 1;
  grid-row: 1 / span 2;
  place-items: center;
  border-radius: var(--radius-control);
  background: var(--color-background);
  color: var(--color-accent-text);
}

.view-identity {
  display: flex;
  min-width: 0;
  grid-column: 2;
  grid-row: 1;
  align-items: baseline;
  gap: 12px;
}

.view-title {
  overflow: hidden;
  margin: 0;
  color: var(--color-ink);
  font-size: 18px;
  font-weight: 750;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-meta {
  flex: 0 0 auto;
  margin: 0;
  color: var(--color-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.view-anchor {
  overflow: hidden;
  min-height: 24px;
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  color: var(--color-accent-text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  line-height: 24px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.view-download {
  display: inline-flex;
  min-height: 36px;
  grid-column: 3;
  grid-row: 1 / span 2;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-control);
  color: var(--color-accent-text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}

.view-download:hover {
  background: var(--color-background);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.view-main {
  width: 100%;
  min-width: 0;
  min-height: 0;
  flex: 1 1 auto;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.view-doc {
  width: 100%;
  min-width: 0;
}

.view-sheets {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  min-height: 44px;
  flex-wrap: wrap;
  align-items: end;
  gap: 4px;
  padding: 8px 16px 0;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-background);
}

.view-sheet-tab {
  min-height: 32px;
  padding: 4px 14px;
  border: 1px solid var(--color-border);
  border-bottom: 0;
  border-radius: var(--radius-control) var(--radius-control) 0 0;
  background: var(--color-surface);
  color: var(--color-muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  cursor: pointer;
}

.view-sheet-tab.is-active {
  border-color: var(--color-accent);
  color: var(--color-accent-text);
  box-shadow: inset 0 -3px 0 var(--color-accent);
}

.view-sheet {
  max-width: calc(100% - 32px);
  margin: 16px;
  overflow-x: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-subtle);
  overscroll-behavior-inline: contain;
}

.view-grid {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
  border-spacing: 0;
  border-collapse: separate;
  color: var(--color-text);
  font-size: 13px;
  line-height: 1.45;
}

.view-rowno-col {
  width: 52px;
}

.view-grid th,
.view-grid td {
  min-height: 32px;
  padding: 6px 8px;
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: middle;
  white-space: pre-wrap;
}

.view-grid tr:last-child > * {
  border-bottom: 0;
}

.view-grid tr > *:last-child {
  border-right: 0;
}

.view-grid thead th,
.view-rowno,
.view-corner {
  background: var(--color-background);
  color: var(--color-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: center;
}

.view-grid td.num {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.view-doc[data-format="docx"] {
  max-width: 920px;
  margin: 20px auto;
  padding: 24px 28px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-subtle);
}

.view-lead,
.view-para {
  display: grid;
  min-height: 34px;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
  border-left: 4px solid transparent;
  border-radius: var(--radius-control);
}

.view-lead {
  color: var(--color-muted);
}

.view-pno {
  padding: 7px 8px 0 0;
  color: var(--color-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  line-height: 1.5;
  text-align: right;
}

.view-lead p,
.view-lead h2,
.view-lead h3,
.view-para p,
.view-para h2,
.view-para h3 {
  margin: 0;
  padding: 6px 10px;
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.view-lead h2,
.view-para h2 {
  color: var(--color-ink);
  font-size: 18px;
  font-weight: 750;
}

.view-lead h3,
.view-para h3 {
  color: var(--color-ink);
  font-size: 16px;
  font-weight: 700;
}

.view-li {
  position: relative;
  padding-left: 26px !important;
}

.view-li::before {
  position: absolute;
  left: 10px;
  content: "•";
  color: var(--color-accent-text);
}

.view-table {
  display: block;
  max-width: 100%;
  margin: 12px 44px;
  overflow-x: auto;
  border-spacing: 0;
  border-collapse: separate;
}

.view-table td {
  min-width: 120px;
  padding: 7px 9px;
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text);
  font-size: 13px;
  line-height: 1.5;
  vertical-align: top;
}

.view-code {
  width: calc(100% - 32px);
  max-width: 1120px;
  margin: 16px auto;
  overflow: hidden;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: var(--color-surface);
  box-shadow: var(--shadow-subtle);
  color: var(--color-text);
  font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
  tab-size: 2;
}

.view-code code {
  display: block;
  min-width: 0;
}

.view-line {
  display: grid;
  min-width: 0;
  min-height: 24px;
  grid-template-columns: 52px minmax(0, 1fr);
  border-left: 4px solid transparent;
}

.view-lno {
  padding: 2px 9px 2px 4px;
  border-right: 1px solid var(--color-border);
  background: var(--color-background);
  color: var(--color-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  line-height: 1.65;
  text-align: right;
  user-select: none;
}

.view-src {
  min-width: 0;
  padding: 2px 10px;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.view-highlight {
  border-left-color: var(--color-accent-text) !important;
  background: var(--color-evidence) !important;
  box-shadow: inset 4px 0 0 var(--color-accent-text);
}

.view-grid td.view-highlight {
  border-left: 0;
}

@media (max-width: 760px) {
  .view-head {
    min-height: 112px;
    grid-template-columns: 40px minmax(0, 1fr);
    grid-template-rows: auto auto auto;
    padding: 8px 12px;
  }

  .view-format-icon {
    grid-row: 1 / span 2;
  }

  .view-identity {
    display: grid;
    gap: 0;
  }

  .view-download {
    min-height: 28px;
    grid-column: 2;
    grid-row: 3;
    justify-self: start;
  }

  .view-anchor {
    grid-column: 2;
  }

  .view-doc[data-format="docx"] {
    width: calc(100% - 24px);
    margin: 12px;
    padding: 16px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .footer-action--primary { animation: none; }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation: none !important;
    transition: none !important;
  }

  .diagram-svg .dg-node,
  .diagram-svg .dg-edge,
  .diagram-svg .dg-row,
  .diagram-svg .dg-badge {
    opacity: 1 !important;
    pointer-events: auto;
  }

  .diagram-svg [pathLength] {
    stroke-dashoffset: 0 !important;
  }
}
