:root {
  --ink: #222d38;
  --ink-soft: #3b4754;
  --accent: #e2701f;
  --accent-d: #c75f15;
  --teal: #2f7d8d;
  --duck: #f5c63e;
  --bg: #fbf9f5;
  --card: #ffffff;
  --muted: #5a6671;
  --line: #e4ded4;
  --shadow: 0 10px 30px rgba(44, 58, 75, .08);
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

/* ---- 待機スピナー（共通） ---- */
.spinner {
  display: inline-block;
  width: 1em;
  height: 1em;
  border: 2px solid rgba(226, 112, 31, .25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  vertical-align: -.15em;
  margin-right: .5em;
  flex-shrink: 0;
}
.spinner[hidden] { display: none; }
/* 色付きボタン上で使う白いスピナー */
.spinner-on-dark {
  border-color: rgba(255, 255, 255, .45);
  border-top-color: #fff;
}
@keyframes spin { to { transform: rotate(360deg); } }

body {
  font-family: "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .88em;
  background: #f1ede6;
  padding: .1em .4em;
  border-radius: 5px;
  word-break: break-all;
}

/* ---- header ---- */
.site-header {
  padding: .85rem 2rem;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex;
  align-items: baseline;
  gap: .9rem;
  text-decoration: none;
}
.wordmark {
  font-weight: 900;
  letter-spacing: .03em;
  color: var(--accent);
  font-size: 1.95rem;
  line-height: 1;
}
.wordmark-sub { color: var(--ink-soft); font-size: .9rem; font-weight: 500; }

/* ---- main ---- */
.main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: .6rem 1.6rem 1rem;
}

/* ---- hero (Phase 0) ---- */
.hero {
  display: flex;
  flex-direction: column;
  max-width: 1180px;
  width: 100%;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 2.4rem;
  align-items: start;  /* ラバ子を上寄せに */
  width: 100%;
}
.hero-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.hero-right {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.pipeline {
  font-size: .9rem;
  color: var(--muted);
  letter-spacing: .02em;
  margin-bottom: 1rem;
}
.pipeline strong {
  color: var(--teal);
  background: rgba(62, 142, 158, .1);
  padding: .12em .5em;
  border-radius: 6px;
  font-weight: 700;
}
.catch {
  font-size: 2.9rem;
  font-weight: 900;
  line-height: 1.25;
  margin: .2rem 0 1rem;
  color: var(--accent);
}
.catch-hero {
  font-size: clamp(2.1rem, 3.4vw, 3.1rem);
  line-height: 1.18;
  margin: 0 0 .8rem;
}
.subcatch { font-size: 1.05rem; font-weight: 700; margin: 0 0 1.2rem; color: var(--ink); }
.subcatch strong { color: var(--accent); }
.muted { color: var(--muted); font-weight: 400; font-size: .92rem; }

/* ---- ヒーロー下部の説明（何をするか）---- */
.hero-explainer {
  margin-top: 1.3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  text-align: center;
}
.explainer-lead { font-size: 1.25rem; font-weight: 500; line-height: 1.75; margin: 0 0 .8rem; }
.explainer-lead strong { color: var(--accent); }

/* ヒーロー右: 吹き出しの下の説明＋「やること」1→2→3（縦並び） */
.hero-steps { margin-top: 1rem; max-width: 430px; width: 100%; }
.steps-intro {
  font-size: .88rem;
  line-height: 1.7;
  color: var(--ink-soft);
  margin: 0 0 .7rem;
}
.steps-intro strong { color: var(--accent); }
.explainer-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .45rem;
  width: 100%;
}
.explainer-steps li {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-size: .82rem;
  color: var(--ink-soft);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .4rem .9rem;
  box-shadow: var(--shadow);
}
.explainer-steps strong { color: var(--ink); }
.es-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-weight: 700;
  font-size: .8rem;
  flex-shrink: 0;
}
@media (max-width: 820px) {
  .explainer-steps { flex-direction: column; align-items: stretch; }
}

/* ---- form ---- */
.check-form {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .65rem; }
.field-label { font-size: .8rem; font-weight: 700; color: var(--ink-soft); }
.field input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .58rem .8rem;
  font-size: .95rem;
  font-family: inherit;
  color: var(--ink);
  background: #fcfbf8;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(236, 126, 58, .15);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.btn-primary {
  width: 100%;
  border: none;
  border-radius: 11px;
  padding: .7rem;
  margin-top: .3rem;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, transform .05s;
}
.btn-primary:hover { background: var(--accent-d); }
.btn-primary:active { transform: translateY(1px); }
.form-note { font-size: .75rem; color: var(--muted); text-align: center; margin: .6rem 0 0; }

/* ---- character ---- */
.char-img {
  width: 280px;
  max-width: 80%;
  height: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 18px 24px rgba(44, 58, 75, .14));
}
/* TOPのラバ子: ときどき跳ねて「やろうよ！」と誘う */
.hero-right .char-img {
  width: 230px;  /* 1画面に収めるため少し小さく */
  transform-origin: bottom center;
  animation: labako-invite 3s ease-in-out infinite;
}
.hero-right .char-img:hover {
  animation-duration: 1.2s;  /* ホバーで元気に */
}
@keyframes labako-invite {
  0%, 55%, 100% { transform: translateY(0) rotate(0); }
  63% { transform: translateY(-16px) rotate(-4deg); }
  71% { transform: translateY(0) rotate(0); }
  78% { transform: translateY(-9px) rotate(3deg); }
  86% { transform: translateY(0) rotate(0); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-right .char-img,
  .analyzing .char-img,
  .result-char,
  .msg-typing .msg-avatar { animation: none; }
}
.char-bubble {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: .6rem 1rem;
  font-size: .9rem;
  font-weight: 500;
  box-shadow: var(--shadow);
}
.char-bubble.below {
  max-width: 430px;
  width: 100%;
  margin-top: 1.4rem;
  text-align: left;
  line-height: 1.75;
  padding: 1rem 1.3rem;
  font-size: .96rem;
}
.char-bubble.below::before {
  content: "";
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 9px solid var(--card);
}
.char-name {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .03em;
  margin-bottom: .3rem;
}
.bubble-catch {
  display: block;
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1.35;
  margin-bottom: .55rem;
}

/* ---- analyzing (Phase 1) ---- */
.analyzing {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 2.5rem;
  align-items: center;
  max-width: 980px;
  width: 100%;
}
.analyzing-char { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.char-bubble.live { min-width: 200px; text-align: center; }
.analyzing-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.8rem;
  box-shadow: var(--shadow);
}
.analyzing-panel h2 { margin: 0 0 .6rem; font-size: 1.4rem; }
.target { font-size: .9rem; margin: 0 0 1.2rem; }
.steps { list-style: none; padding: 0; margin: 0 0 1.2rem; }
.steps li {
  padding: .5rem .2rem .5rem 1.8rem;
  position: relative;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.steps li::before { content: "○"; position: absolute; left: .2rem; }
.steps li.done { color: var(--ink); }
.steps li.done::before { content: "●"; color: var(--teal); }
.steps li.active { color: var(--accent); font-weight: 700; }
.steps li.active::before { content: "◐"; color: var(--accent); }
.wip-note {
  font-size: .78rem;
  color: var(--muted);
  background: #f6f2ea;
  padding: .6rem .8rem;
  border-radius: 8px;
}
.btn-ghost {
  display: inline-block;
  margin-top: 1rem;
  color: var(--teal);
  text-decoration: none;
  font-weight: 700;
  font-size: .9rem;
}
.btn-ghost:hover { text-decoration: underline; }

/* 解析中の実況フィード */
.char-bubble.live { min-width: 200px; text-align: center; }
/* 解析中はラバ子がぴょこぴょこ動く（待機の可視化） */
.analyzing .char-img { animation: labako-bob 1.5s ease-in-out infinite; }
@keyframes labako-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.analyzing-sub { font-size: .92rem; color: var(--ink-soft); margin: -.2rem 0 1rem; line-height: 1.7; }
.analyzing-sub strong { color: var(--teal); }

/* ADKエージェントの段階表示 */
.stage-track { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.stage { display: flex; align-items: center; gap: .65rem; font-size: .92rem; color: var(--muted); transition: color .2s; }
.stage-name { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.stage-name em {
  font-style: normal;
  font-size: .7rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted);
  background: #f1ede6;
  padding: .05em .45em;
  border-radius: 4px;
}
.stage-dot {
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  border: 2px solid var(--line);
  box-sizing: border-box;
  flex-shrink: 0;
  position: relative;
}
.stage.active { color: var(--teal); font-weight: 700; }
.stage.active .stage-dot {
  border-color: rgba(47, 125, 141, .3);
  border-top-color: var(--teal);
  animation: spin .7s linear infinite;
}
.stage.done { color: var(--ink-soft); }
.stage.done .stage-dot { background: var(--teal); border-color: var(--teal); }
.stage.done .stage-dot::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
}

.live-feed {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  height: 240px;          /* 固定高さ: 進行で伸び縮みしない */
  overflow-y: auto;
}
.feed-item {
  font-size: .85rem;
  line-height: 1.6;
  padding: .5rem .8rem;
  border-radius: 8px;
  background: #f6f2ea;
  color: var(--ink-soft);
  animation: feed-in .25s ease;
}
.feed-phase { font-weight: 700; color: var(--teal); background: rgba(47, 125, 141, .08); }
.feed-tool { color: var(--accent-d); background: rgba(226, 112, 31, .08); }
.feed-thought { white-space: pre-wrap; }
@keyframes feed-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* ---- result (議題抽出の結果) ---- */
.result { max-width: 760px; width: 100%; margin: 0 auto; }
.result-head {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 1.4rem;
}
.result-char {
  width: 110px;
  height: auto;
  flex-shrink: 0;
  transform-origin: bottom center;
  animation: labako-invite 3s ease-in-out infinite;
}
.result-char:hover { animation-duration: 1.2s; }
.result-bubble {
  position: relative;
  flex: 1;
  line-height: 1.8;
}
.result-bubble::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -8px;
  transform: translateY(-50%);
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-right: 8px solid var(--card);
}
.result-bubble strong { color: var(--accent); font-size: 1.15em; }

.issues { list-style: none; padding: 0; margin: 0 0 1.4rem; display: grid; gap: .9rem; }
.issue-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  box-shadow: var(--shadow);
}
.issue-top { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.issue-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-weight: 700;
  font-size: .85rem;
  flex-shrink: 0;
}
.issue-title { font-weight: 700; font-size: 1.02rem; }
.issue-summary { margin: .6rem 0 0; color: var(--ink-soft); font-size: .92rem; }
.issue-files {
  margin: .5rem 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .78rem;
  color: var(--muted);
}
.tag {
  font-size: .72rem;
  font-weight: 700;
  padding: .15em .6em;
  border-radius: 999px;
  white-space: nowrap;
}
.tag-missing_test { background: rgba(47, 125, 141, .14); color: var(--teal); }
.tag-security { background: rgba(214, 79, 51, .16); color: #b23b22; }
.tag-complex { background: rgba(226, 112, 31, .14); color: var(--accent-d); }
.tag-external_dep { background: rgba(214, 158, 0, .18); color: #8a6d00; }
.tag-breaking { background: rgba(120, 80, 160, .16); color: #6b4a92; }

.btn-start {
  margin-top: .9rem;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent-d);
  font-weight: 700;
  font-size: .88rem;
  font-family: inherit;
  padding: .5rem .9rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-start:hover { background: var(--accent); color: #fff; }
.btn-start:disabled { opacity: .6; cursor: default; }

/* 論点カードのアクション行（開始＋差分確認） */
.issue-actions { margin-top: .9rem; display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.issue-actions .btn-start { margin-top: 0; }
.btn-diff {
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-soft);
  font-weight: 700;
  font-size: .88rem;
  font-family: inherit;
  padding: .5rem .9rem;
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn-diff:hover { background: #f1ede6; border-color: var(--muted); }

/* ---- dialogue (Phase 4) ---- */
.dialogue {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 1.6rem;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  min-height: 72vh;
}
.dia-main { display: flex; flex-direction: column; min-width: 0; }
.chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .9rem;
  padding: .4rem .2rem 1rem;
  overflow-y: auto;
  max-height: 64vh;
}
.msg { display: flex; align-items: flex-end; gap: .6rem; max-width: 85%; }
.msg-labako { align-self: flex-start; }
.msg-developer { align-self: flex-end; flex-direction: row-reverse; }
.msg-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
/* 考え中の吹き出しの時だけ、ラバ子を元気に跳ねさせる */
.msg-typing .msg-avatar {
  transform-origin: bottom center;
  animation: labako-invite 3s ease-in-out infinite;
}
.msg-bubble {
  padding: .7rem 1rem;
  border-radius: 14px;
  font-size: .95rem;
  line-height: 1.7;
  white-space: pre-wrap;
}
.msg-labako .msg-bubble {
  background: var(--card);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow);
}
.msg-developer .msg-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg-tool {
  display: block;
  margin-top: .4rem;
  font-size: .72rem;
  color: var(--teal);
  font-weight: 700;
}
/* クリア合図のラバ子バブル（強調） */
.msg-cleared .msg-bubble {
  background: rgba(46, 160, 87, .12);
  border: 1px solid rgba(46, 160, 87, .45);
  color: #237a3f;
  font-weight: 700;
}
/* 一旦締める（未クリア）バブル */
.msg-wrapup .msg-bubble {
  background: rgba(226, 158, 0, .1);
  border: 1px solid rgba(226, 158, 0, .4);
  color: #8a6d00;
  line-height: 1.8;
}
/* クリア後のネクストアクション */
.next-actions {
  align-self: center;
  align-items: center;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  max-width: 92%;
  margin: .2rem 0 .4rem;
}
.next-actions .na-done { font-weight: 700; color: #237a3f; line-height: 1.6; }
.next-actions .na-note { font-size: .8rem; color: var(--muted); }
.na-btn {
  display: inline-block;
  width: auto;
  text-decoration: none;
  padding: .7rem 1.3rem;
}
.chat-input {
  display: flex;
  gap: .6rem;
  align-items: flex-end;
  border-top: 1px solid var(--line);
  padding-top: .9rem;
}
.chat-input textarea {
  flex: 1;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .7rem .8rem;
  font-family: inherit;
  font-size: .95rem;
  color: var(--ink);
  background: #fcfbf8;
}
.chat-input textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(236, 126, 58, .15);
}
.chat-input .btn-primary { width: auto; padding: .7rem 1.4rem; margin: 0; }

.dia-side { display: flex; flex-direction: column; gap: 1rem; }
.side-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
}
.side-label {
  display: block;
  font-size: .72rem;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .03em;
  margin-bottom: .5rem;
}
.side-issue { font-size: 1.02rem; margin: 0 0 .5rem; }

/* 理解度メーター */
.meter {
  height: 10px;
  background: #ece8e0;
  border-radius: 999px;
  overflow: hidden;
  margin: .35rem 0 .5rem;
}
.meter-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal), #2ea057);
  transition: width .7s ease;
}
.meter-note { font-size: .82rem; color: var(--muted); margin: 0; }
.meter-note strong { color: var(--teal); font-size: 1.1em; }
.side-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .5rem; }
.side-summary { font-size: .85rem; color: var(--ink-soft); margin: 0; }

.status-chip {
  display: inline-block;
  padding: .35em .9em;
  border-radius: 999px;
  font-weight: 700;
  font-size: .9rem;
}
.st-unverified { background: #ece8e0; color: var(--muted); }
.st-unexplained { background: rgba(226, 112, 31, .15); color: var(--accent-d); }
.st-deep { background: rgba(47, 125, 141, .15); color: var(--teal); }
.st-verified { background: rgba(46, 160, 87, .16); color: #237a3f; }
.status-note { font-size: .76rem; color: var(--muted); margin: .6rem 0 0; }

.evidence-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.evidence-list li { font-size: .8rem; line-height: 1.5; color: var(--ink-soft); }
.evidence-list code { font-size: .72rem; }
.evidence-empty { color: var(--muted); }

/* 差分モーダル */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(34, 45, 56, .5);
}
.modal-overlay[hidden] { display: none; }
.modal {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 920px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1.2rem;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
}
.modal-close {
  border: none;
  background: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}
.modal-close:hover { color: var(--ink); }
.diff-view {
  margin: 0;
  overflow: auto;
  padding: .6rem 0;
  background: #ffffff;
  color: #1f2328;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .8rem;
  line-height: 1.55;
  white-space: pre;
  tab-size: 4;
}
/* GitHub の Diff 画面風の色使い（行全体を着色） */
.diff-view .d-line { display: block; min-height: 1.55em; padding: 0 1.2rem; }
.diff-view .d-add { background: #e6ffec; }        /* 追加行: 薄い緑 */
.diff-view .d-del { background: #ffebe9; }        /* 削除行: 薄い赤 */
.diff-view .d-hunk { background: #ddf4ff; color: #0550ae; }  /* @@ ハンク: 薄い青 */
.diff-view .d-meta { color: #57606a; }            /* diff/index/+++/--- : グレー */

/* 登場演出 */
.dia-intro {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  background: var(--bg);
  transition: opacity .6s ease;
}
.dia-intro-char { width: 220px; height: auto; animation: labako-pop .6s ease both; }
.dia-intro-line { font-size: 1.3rem; font-weight: 700; text-align: center; line-height: 1.6; }
.dia-intro-line strong { color: var(--accent); }
.dia-intro.intro-done { opacity: 0; pointer-events: none; }
@keyframes labako-pop {
  0% { transform: scale(.4) translateY(24px); opacity: 0; }
  60% { transform: scale(1.06); }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

@media (max-width: 820px) {
  .dialogue { grid-template-columns: 1fr; }
  .dia-side { order: -1; }
  .chat { max-height: 50vh; }
}

/* ---- nav row (結果/ダッシュボード/レポート共通) ---- */
.result-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.4rem;
  align-items: center;
  margin-top: 1rem;
}

/* ---- report (Phase 8: Understand レポート) ---- */
.report { max-width: 820px; width: 100%; margin: 0 auto; }
.report-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin: 1rem 0; }
.report-actions .btn-start { text-decoration: none; }
.report-text {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .82rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--card);
  resize: vertical;
}

/* ---- dashboard (Phase 2) ---- */
.dash { max-width: 980px; width: 100%; margin: 0 auto; }
.dash-head { margin-bottom: 1.4rem; }
.dash-title { font-size: 1.8rem; margin: 0 0 .6rem; color: var(--accent); font-weight: 900; }
.dash-note { font-size: .88rem; color: var(--muted); margin: .6rem 0 0; }
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.dash-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}
.chart-wrap { max-width: 220px; margin: .6rem auto; }
.legend { list-style: none; padding: 0; margin: .6rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.legend li { font-size: .82rem; color: var(--ink-soft); }
.legend-dot, .concern-dot {
  display: inline-block; width: .7rem; height: .7rem; border-radius: 50%;
  margin-right: .35rem; vertical-align: middle;
}
.st-untouched { background: #ece8e0; color: var(--muted); }
.concern-dot.st-untouched { background: #d8d2c6; }
.concern-dot.st-unexplained { background: var(--accent); }
.concern-dot.st-unverified { background: #8a93a0; }

.concern-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.concern-item { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.concern-title { flex: 1; }
.concern-state { font-size: .78rem; color: var(--muted); }
.concern-link { font-size: .8rem; color: var(--teal); font-weight: 700; text-decoration: none; white-space: nowrap; }
.concern-link:hover { text-decoration: underline; }
.concern-empty { color: var(--teal); font-size: .9rem; }

.heatmap-scroll { overflow-x: auto; }
.heatmap { width: 100%; border-collapse: collapse; font-size: .82rem; margin-top: .6rem; }
.heatmap th, .heatmap td { padding: .5rem .6rem; text-align: center; border-bottom: 1px solid var(--line); }
.heatmap th { font-weight: 700; color: var(--ink-soft); font-size: .78rem; }
.heatmap .hm-issue { text-align: left; max-width: 240px; }
.hm-cell { font-size: .76rem; border-radius: 4px; }
.hm-hi { background: rgba(46, 160, 87, .18); color: #237a3f; font-weight: 700; }
.hm-mid { background: rgba(226, 158, 0, .2); color: #8a6d00; }
.hm-lo { background: rgba(214, 79, 51, .16); color: #b23b22; }
.hm-none { color: var(--muted); }

.share-row { display: flex; gap: .6rem; margin: .5rem 0 1rem; }
.share-input {
  flex: 1; border: 1px solid var(--line); border-radius: 10px;
  padding: .6rem .8rem; font-size: .85rem; background: #fcfbf8; color: var(--ink-soft);
}
.share-card .btn-start { margin-top: 0; }

@media (max-width: 820px) {
  .dash-grid { grid-template-columns: 1fr; }
}

/* ---- footer ---- */
.site-footer {
  display: flex;
  gap: .6rem;
  justify-content: center;
  align-items: center;
  padding: .75rem 1.2rem;
  color: var(--muted);
  font-size: .78rem;
  border-top: 1px solid var(--line);
}
.site-footer .dot { opacity: .5; }

/* ---- responsive ---- */
@media (max-width: 820px) {
  .hero-grid, .analyzing { grid-template-columns: 1fr; gap: 2rem; }
  .hero-right { order: -1; }
  .char-img { width: 220px; }
  .char-bubble.below { max-width: 100%; }
  .field-row { grid-template-columns: 1fr; }
}
