/* 画面別スタイル */

/* ── ログイン ─────────────────────── */
.login { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.persona-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); margin-top: 6px; }
.persona {
  display: flex; gap: 10px; align-items: flex-start; cursor: pointer;
  border: 2px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--surface);
}
.persona:hover { border-color: var(--border-strong); background: var(--surface-2); }
.persona:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.persona:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.persona__radio { margin: 5px 0 0; width: 18px; height: 18px; accent-color: var(--accent); flex: none; }
.persona__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.persona__name { font-weight: 700; }
.persona__title { font-size: 0.88rem; }

/* ── 質問・進捗・回答 ─────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.history-list { list-style: none; margin: 0 0 8px; padding: 0; }
.history-list li { padding: 10px 0; border-top: 1px solid var(--border); }
.history-list li:first-child { border-top: 0; padding-top: 0; }
.history-list__q {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 4px;
}
.progress-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.progress-steps li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.progress-steps li.is-current { border-color: var(--info-bd); background: var(--info-bg); color: var(--info-fg); font-weight: 700; }
.progress-steps li.is-done { color: var(--text-muted); }
.progress-steps__mark { width: 1.2em; text-align: center; font-weight: 800; }
.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ai-label { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; color: var(--text-muted); font-size: 0.88rem; }
.claims { padding-left: 1.6em; display: flex; flex-direction: column; gap: 10px; font-size: 1rem; line-height: 1.8; }
.claim__text { white-space: pre-wrap; }
.cite {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; min-height: 28px; padding: 0 6px; margin: 0 1px;
  border: 1px solid var(--info-bd); border-radius: 6px; background: var(--info-bg); color: var(--info-fg);
  font-weight: 700; font-size: 0.85rem; cursor: pointer; vertical-align: baseline;
}
.cite:hover { background: var(--accent-soft); border-color: var(--accent); }
.unknowns { border-left: 4px solid var(--warn-bd); background: var(--warn-bg); color: var(--warn-fg); padding: 10px 14px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.unknowns h3 { color: inherit; margin-bottom: 4px; }
.unknowns ul { margin: 0; }
.verif-badges { gap: 6px; }
.src-list { display: flex; flex-direction: column; gap: 12px; }
.src-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--surface-2); scroll-margin-top: 16px; }
.src-card.is-highlight { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.src-card h4 { margin-bottom: 8px; }
.src-card__sub { margin: 8px 0 4px; font-size: 0.85rem; color: var(--text-muted); }
.src-card__num { color: var(--info-fg); font-weight: 800; }
.quote { margin: 0; padding: 6px 12px; border-left: 3px solid var(--border-strong); background: var(--surface); white-space: pre-wrap; }
.is-quote-highlight .quote { border-left-color: var(--accent); background: var(--accent-soft); }
.rating-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rating-choice__box {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 16px;
  border: 2px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); cursor: pointer; font-weight: 600;
}
.rating-choice input:checked + .rating-choice__box { border-color: var(--accent); background: var(--accent-soft); }
.rating-choice input:focus-visible + .rating-choice__box { outline: 3px solid var(--focus); outline-offset: 2px; }
.feedback-comment { white-space: pre-wrap; margin: 8px 0 0; }
.run-question { white-space: pre-wrap; font-size: 1.05rem; margin: 0; }

/* ── タイムライン ─────────────────────── */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ''; position: absolute; left: 15px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.timeline__item { position: relative; display: flex; gap: 14px; padding: 6px 0 14px; }
.timeline__seq {
  flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; z-index: 1;
  background: var(--surface); border: 2px solid var(--accent); color: var(--text); font-weight: 700; font-size: 0.85rem;
}
.timeline__body { min-width: 0; flex: 1; }
.timeline__bar { margin-top: 6px; height: 6px; background: var(--neutral-bg); border-radius: 3px; max-width: 420px; }
.timeline__bar-fill { height: 100%; background: var(--series-bar); border-radius: 3px; }
.reason-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-bottom: 2px; }

/* ── ダッシュボード ─────────────────────── */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr)); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.kpi__label { color: var(--text-muted); font-size: 0.82rem; font-weight: 600; }
.kpi__value { font-size: 1.7rem; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.kpi__unit { font-size: 0.85rem; color: var(--text-muted); font-weight: 500; }

.chart { margin: 0; }
.chart figcaption { margin-bottom: 6px; }
.chart__plot { position: relative; width: 100%; min-height: 240px; }
.chart__svg { display: block; overflow: visible; }
.chart__grid { stroke: var(--grid); stroke-width: 1; }
.chart__axis { stroke: var(--axis); stroke-width: 1; }
.chart__label { fill: var(--text-muted); font-size: 11px; font-family: var(--font); }
.chart__col { outline: none; cursor: default; }
.chart__col .chart__hit { fill: transparent; }
.chart__col:hover .chart__hit, .chart__col.is-active .chart__hit { fill: var(--accent-soft); opacity: 0.6; }
.chart__col:focus-visible .chart__hit { stroke: var(--focus); stroke-width: 2; }
.chart__seg { stroke: none; }
.s1 { fill: var(--series-1); background: var(--series-1); }
.s2 { fill: var(--series-2); background: var(--series-2); }
.s3 { fill: var(--series-3); background: var(--series-3); }
.s-other { fill: var(--series-other); background: var(--series-other); }
.chart__tip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 130px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  padding: 6px 10px; font-size: 0.8rem; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}
.chart__tip-row { display: flex; align-items: center; gap: 6px; }
.chart__actions { margin-top: 8px; }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 8px; padding: 0; font-size: 0.85rem; }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend__swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; flex: none; }

.barlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.barlist__head { display: flex; justify-content: space-between; gap: 12px; font-size: 0.9rem; }
.barlist__value { font-variant-numeric: tabular-nums; font-weight: 700; }
.barlist__track { height: 8px; background: var(--neutral-bg); border-radius: 4px; margin-top: 3px; overflow: hidden; }
.barlist__fill { height: 100%; background: var(--series-bar); border-radius: 4px; }

.meter { display: flex; flex-direction: column; gap: 4px; }
.meter__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; font-size: 0.9rem; }
.meter__label { font-weight: 700; }
.meter__num { font-variant-numeric: tabular-nums; }
.meter__bar { height: 12px; background: var(--neutral-bg); border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.meter__fill { height: 100%; background: var(--series-bar); }
.meter__bar--warn .meter__fill { background: var(--warn-fg); }
.meter__bar--danger .meter__fill { background: var(--danger-fg); }
.meter__state { font-size: 0.85rem; font-weight: 700; }
.meter__state--warn { color: var(--warn-fg); }
.meter__state--danger { color: var(--danger-fg); }

.alert-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.alert-item { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); }
.alert-item--critical { border-color: var(--danger-bd); background: var(--danger-bg); }
.alert-item--warning { border-color: var(--warn-bd); background: var(--warn-bg); }

/* ── 案件カタログ ─────────────────────── */
.project-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); }
.project-card h3 { margin-bottom: 2px; }
.project-card.is-active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.project-card .kv { margin: 8px 0 10px; }

@media (max-width: 480px) {
  h1 { font-size: 1.3rem; }
  .kpi__value { font-size: 1.4rem; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .kpi { padding: 10px; }
  .card { padding: 12px; }
  .dialog__actions .btn { flex: 1 1 100%; }
}
