/* ココミル 共通スタイル。プロダクトごとの違いは :root の変数だけに寄せる */
:root {
  --accent: #3f51b5;        /* 主要ボタン・スコア・ユーザー吹き出し */
  --accent-soft: #e8ebf7;   /* アクセントの淡色背景 */
  --header-bg: #26304d;     /* ヘッダー背景 */
}

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

body {
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  background: #f4f2ee;
  color: #2b2b2b;
  line-height: 1.6;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 24px;
  background: var(--header-bg);
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { font-size: 30px; }
.brand h1 { font-size: 21px; letter-spacing: 1px; }
.brand p { font-size: 12px; opacity: 0.75; }
.api-key-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.api-key-row input {
  width: 260px; padding: 6px 10px; border-radius: 6px; border: none; font-size: 13px;
}

.screen { display: none; max-width: 1080px; margin: 0 auto; padding: 24px; }
.screen.active { display: block; }

.lead { margin-bottom: 14px; font-size: 15px; }
.toolbar { margin-bottom: 16px; }
.footnote { margin-top: 20px; font-size: 12px; color: #777; }

/* 法人向け案内 */
.biz-box {
  margin-top: 24px; background: var(--accent-soft); border-left: 5px solid var(--accent);
  border-radius: 10px; padding: 14px 18px;
}
.biz-box h3 { font-size: 15px; margin-bottom: 6px; }
.biz-box p { font-size: 13.5px; }

/* シナリオカード */
#scenario-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: 16px; }
@media (max-width: 520px) { #scenario-list { grid-template-columns: 1fr; } }
.scenario-card {
  display: flex; gap: 14px; background: #fff; border-radius: 14px; padding: 18px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}
.scenario-icon { font-size: 40px; }
.scenario-body h3 { font-size: 18px; }
.scenario-subtitle { font-size: 13px; color: #8a5a00; font-weight: bold; margin-bottom: 6px; }
.scenario-desc { font-size: 13.5px; color: #555; margin-bottom: 10px; }
.variant-row { display: flex; gap: 14px; font-size: 13px; margin-bottom: 8px; flex-wrap: wrap; }
.voice-note { font-size: 11.5px; color: #999; margin-bottom: 8px; }
.start-buttons { display: flex; gap: 8px; flex-wrap: wrap; }

.btn {
  border: none; border-radius: 8px; padding: 9px 16px; font-size: 14px; cursor: pointer;
  transition: filter 0.15s;
}
.btn:hover { filter: brightness(1.08); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-ghost { background: #e8e4dc; color: #444; }

/* セッション画面 */
.session-top { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.situation { font-size: 13px; color: #666; }
.session-meta { display: flex; gap: 14px; align-items: center; font-size: 13px; }
.mic-on { color: #c0392b; font-weight: bold; }
#session-timer { font-variant-numeric: tabular-nums; font-weight: bold; }
.status { color: #666; }

.session-grid { display: grid; grid-template-columns: 340px 1fr; gap: 16px; }
@media (max-width: 800px) { .session-grid { grid-template-columns: 1fr; } }

.panel { background: #fff; border-radius: 14px; padding: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.07); }
.panel h3 { font-size: 15px; margin-bottom: 12px; }

/* メーター */
.meter-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.meter-label { width: 110px; font-size: 12.5px; }
.meter-track { flex: 1; height: 14px; background: #eee; border-radius: 7px; overflow: hidden; }
.meter-fill { height: 100%; border-radius: 7px; transition: width 0.8s ease; }
.meter-good { background: linear-gradient(90deg, #f39c12, #27ae60); }
.meter-danger { background: linear-gradient(90deg, #f1c40f, #e74c3c); }
.meter-value { width: 30px; text-align: right; font-size: 12.5px; font-variant-numeric: tabular-nums; }

/* 心の声 */
.inner-voice {
  margin-top: 14px; background: #fdf6e3; border: 1px dashed #d8c48a; border-radius: 12px;
  padding: 10px 14px; min-height: 64px;
}
.inner-voice-label { font-size: 11px; color: #9a824a; margin-bottom: 4px; }
#inner-voice-text { font-size: 15px; font-style: italic; color: #6b5a2e; }
.pulse { animation: pulse 0.6s ease; }
@keyframes pulse { 0% { transform: scale(0.97); opacity: 0.5; } 100% { transform: scale(1); opacity: 1; } }

/* 話者カード(複数話者シナリオ用) */
#speakers { display: none; flex-direction: column; gap: 8px; margin-top: 14px; }
.speaker-card { border: 2px solid #eee; border-radius: 10px; padding: 8px 10px; transition: border-color 0.3s, background 0.3s; }
.speaker-card.speaking { border-color: #e74c3c; background: #fdf0ef; }
.speaker-name { font-size: 13.5px; font-weight: bold; }
.speaker-outlet { font-size: 11px; color: #888; margin-left: 6px; font-weight: normal; }
.speaker-style { font-size: 11.5px; color: #777; }

/* 会話ログ */
#transcript { height: 380px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px; }
.bubble { max-width: 78%; padding: 9px 13px; border-radius: 14px; font-size: 14px; }
.bubble-user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.bubble-ai { align-self: flex-start; background: #efece5; border-bottom-left-radius: 4px; }
#text-input-row { display: flex; gap: 8px; margin-top: 10px; }
#text-input { flex: 1; padding: 9px 12px; border: 1px solid #ccc; border-radius: 8px; font-size: 14px; }
#answer-controls { display: none; align-items: center; gap: 10px; margin-top: 10px; }
.answer-hint { font-size: 11.5px; color: #888; }

.session-actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }

/* レポート */
.report-header { display: flex; gap: 20px; align-items: center; background: #fff; border-radius: 14px; padding: 18px; margin-bottom: 18px; box-shadow: 0 2px 8px rgba(0,0,0,0.07); }
.report-score { font-size: 46px; font-weight: bold; color: var(--accent); white-space: nowrap; }
.report-score span { font-size: 18px; }
.report-delta-row { margin-bottom: 6px; }
.report-summary { font-size: 14.5px; }
#screen-report h3 { margin: 18px 0 8px; font-size: 16px; }
.report-inner, .report-advice { background: #fff; border-radius: 10px; padding: 12px 16px; font-size: 14px; }
.report-next {
  margin-top: 10px; background: var(--accent-soft); border-left: 5px solid var(--accent);
  border-radius: 8px; padding: 10px 14px; font-size: 14px; font-weight: bold;
}
.highlight { background: #fff; border-left: 5px solid #ccc; border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; }
.hl-good { border-left-color: #27ae60; }
.hl-bad { border-left-color: #e74c3c; }
.hl-quote { font-size: 14px; font-weight: bold; }
.hl-comment { font-size: 13px; color: #555; margin-top: 3px; }
.hl-alt { font-size: 13px; color: #1a6b3c; margin-top: 4px; background: #edf7f0; border-radius: 6px; padding: 5px 9px; }
.loading, .error { padding: 30px; text-align: center; font-size: 15px; }
.error { color: #c0392b; }

/* 前回比バッジ */
.delta { display: inline-block; font-size: 12.5px; font-weight: bold; border-radius: 999px; padding: 2px 10px; }
.delta-up { background: #eaf7ee; color: #1a7f42; }
.delta-down { background: #fdeeee; color: #c0392b; }
.delta-first { background: #f0ede5; color: #776; }

/* レーダーチャート */
.report-radar-wrap { background: #fff; border-radius: 14px; padding: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.07); display: flex; justify-content: center; }
.radar { width: 100%; max-width: 460px; height: auto; }
.radar-grid-poly { fill: none; stroke: #ddd; stroke-width: 1; }
.radar-grid { stroke: #ddd; stroke-width: 1; }
.radar-value { fill: var(--accent); fill-opacity: 0.35; stroke: var(--accent); stroke-width: 2; }
.radar-label { font-size: 11.5px; fill: #444; }
.radar-val { font-weight: bold; fill: var(--accent); }

/* 心の動きログ */
.ilog { display: flex; flex-direction: column; gap: 6px; }
.ilog-row { background: #fff; border-radius: 10px; padding: 8px 12px; }
.ilog-user { font-size: 13px; color: #333; }
.ilog-inner { font-size: 13px; font-style: italic; color: #8a6d1f; margin-top: 2px; }

/* 学習履歴 */
.hist-total { margin-bottom: 12px; font-size: 14px; }
.hist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 20px; }
.hist-card { background: #fff; border-radius: 12px; padding: 14px 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.07); }
.hist-card-title { font-size: 13.5px; font-weight: bold; margin-bottom: 6px; }
.hist-card-main { display: flex; align-items: baseline; gap: 6px; }
.hist-score { font-size: 30px; font-weight: bold; color: var(--accent); }
.hist-unit { font-size: 12px; color: #888; }
.hist-card-sub { font-size: 12px; color: #777; margin-top: 2px; }
.hist-card-next { font-size: 12px; color: #555; margin-top: 6px; background: var(--accent-soft); border-radius: 6px; padding: 4px 8px; }
.hist-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.07); }
.hist-table th, .hist-table td { text-align: left; font-size: 13px; padding: 8px 14px; border-bottom: 1px solid #f0ede5; }
.hist-table th { background: #faf8f4; font-size: 12px; color: #777; }
.hist-table .num { text-align: right; font-variant-numeric: tabular-nums; }
#screen-history h3 { margin: 10px 0 8px; font-size: 15px; }

/* 印刷(PDF保存)用: レポート画面だけを研修レポート風に出力する */
.print-header { display: none; }
@media print {
  body { background: #fff; }
  .app-header, .session-actions, .no-print, .toolbar { display: none !important; }
  .screen { display: none; padding: 0; max-width: none; }
  #screen-report.active { display: block; }
  .print-header {
    display: block; border-bottom: 2px solid var(--accent); margin-bottom: 14px; padding-bottom: 8px;
  }
  #print-title { font-size: 18px; font-weight: bold; color: var(--accent); }
  #print-meta { font-size: 12px; color: #555; margin-top: 2px; }
  .report-header, .report-radar-wrap, .panel, .highlight, .ilog-row, .report-inner, .report-advice { box-shadow: none; border: 1px solid #e5e1d8; }
  .highlight, .ilog-row { break-inside: avoid; }
}
