/* Echo or Learn 公開側 */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #FFFFFF;
  color: #1A1A1A;
  font-family: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 15px;
  line-height: 1.7;
}

a { color: #1F4E8C; }
a:hover { color: #15365F; }

button {
  font: inherit;
  cursor: pointer;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ----- ヘッダー ----- */
.site-header {
  border-bottom: 1px solid #E3E1DC;
}

.site-header .container {
  padding-top: 18px;
}

.site-header .brand-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px 16px;
}

.brand-logo {
  background: none;
  border: 0;
  padding: 0;
  font-family: "Shippori Mincho", "Yu Mincho", serif;
  font-size: 28px;
  font-weight: 700;
  color: #1A1A1A;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.brand-sub {
  color: #5B5B57;
  font-size: 14px;
}

.badge-prototype {
  border: 1px solid #1A1A1A;
  border-radius: 4px;
  font-size: 12px;
  padding: 0 8px;
  line-height: 22px;
  display: inline-block;
}

.header-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-login {
  min-height: 40px;
  padding: 4px 14px;
  border: 1px solid #C9C6BF;
  border-radius: 6px;
  background: #FFFFFF;
  color: #1A1A1A;
  font-size: 14px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  padding: 6px 0 0;
}

.site-nav a {
  min-height: 44px;
  padding: 0;
  color: #1A1A1A;
  font-size: 15px;
  font-weight: 400;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  display: inline-flex;
  align-items: center;
}

.site-nav a.is-current {
  font-weight: 700;
  border-bottom-color: #1A1A1A;
}

/* ----- メイン ----- */
main {
  padding: 32px 0 64px;
}

main .container {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* ----- ヒーロー ----- */
.hero {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 28px;
  border-bottom: 1px solid #E3E1DC;
}

.hero h1 {
  margin: 0;
  font-family: "Shippori Mincho", "Yu Mincho", serif;
  font-size: 34px;
  line-height: 1.45;
  font-weight: 700;
}

.hero-lead {
  margin: 0;
  max-width: 720px;
  color: #3F3F3B;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  font-size: 14px;
}

.btn-primary {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 6px;
  border: 1px solid #1A1A1A;
  background: #1A1A1A;
  color: #FFFFFF;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.legend {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  color: #5B5B57;
}

.legend-text + .pill {
  margin-left: 8px;
}

/* ----- 判定バッジ (pill) ----- */
.pill {
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  display: inline-block;
  line-height: 1.6;
}

.pill-learn { background: #E4F2EA; color: #1B6640; border: 1px solid #9CCBB0; }
.pill-echo  { background: #FBEBDD; color: #9A4310; border: 1px solid #E6B48F; }
.pill-na    { background: #EFEFEF; color: #55595E; border: 1px solid #CFCFCF; white-space: nowrap; }

.badge-mismatch {
  padding: 1px 8px;
  border-radius: 4px;
  background: #1F2F4D;
  color: #FFFFFF;
  font-weight: 700;
  font-size: 12px;
  display: inline-block;
}

.badge-trial {
  font-size: 12px;
  border: 1px solid #8A877F;
  color: #4A4843;
  border-radius: 4px;
  padding: 0 8px;
  line-height: 22px;
  display: inline-block;
}

/* ----- 議論の一覧 ----- */
.debate-list-section {
  padding-top: 24px;
}

.list-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.list-header h2 {
  margin: 0 16px 0 0;
  font-size: 20px;
}

.chip {
  min-height: 40px;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 14px;
  border: 1px solid #C9C6BF;
  background: #FFFFFF;
  color: #1A1A1A;
}

.chip[aria-pressed="true"] {
  background: #1A1A1A;
  color: #FFFFFF;
  border-color: #1A1A1A;
}

.list-count {
  margin-left: auto;
  color: #5B5B57;
  font-size: 14px;
}

.empty-msg {
  color: #5B5B57;
  padding: 24px 0;
}

.debate-card {
  display: block;
  width: 100%;
  text-align: left;
  background: #FFFFFF;
  border: 0;
  border-bottom: 1px solid #E3E1DC;
  padding: 20px 0;
  color: #1A1A1A;
  text-decoration: none;
  cursor: pointer;
}

.debate-card:hover .debate-title {
  text-decoration: underline;
}

.debate-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 13px;
}

.debate-kind {
  color: #5B5B57;
}

.debate-date {
  color: #5B5B57;
}

.debate-title {
  display: block;
  margin-top: 8px;
  font-family: "Shippori Mincho", "Yu Mincho", serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.5;
}

.debate-conclusion {
  display: block;
  margin-top: 4px;
  color: #3F3F3B;
  font-size: 14px;
}

.debate-tally {
  display: block;
  margin-top: 4px;
  color: #5B5B57;
  font-size: 13px;
}

/* ----- フッター ----- */
.site-footer {
  border-top: 1px solid #E3E1DC;
}

.site-footer .container {
  padding-top: 20px;
  padding-bottom: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 13px;
  color: #5B5B57;
}

.site-footer a {
  color: #1F4E8C;
  text-decoration: underline;
  font-size: 13px;
}

/* ===== 議論ページ ===== */

.debate-article {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.breadcrumb {
  font-size: 14px;
  color: #5B5B57;
}

.breadcrumb a {
  color: #1F4E8C;
  text-decoration: underline;
}

.debate-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.debate-header h1 {
  margin: 0;
  font-family: "Shippori Mincho", "Yu Mincho", serif;
  font-size: 32px;
  line-height: 1.45;
  font-weight: 700;
}

.debate-sub {
  color: #5B5B57;
  font-size: 14px;
}

/* 判定ボックス */
.verdict-box {
  border: 1px solid #D9D6CF;
  border-radius: 8px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.verdict-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.verdict-pill {
  padding: 4px 16px;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 700;
  display: inline-block;
}

.verdict-pill-learn { background: #E4F2EA; color: #1B6640; border: 1px solid #9CCBB0; }
.verdict-pill-echo  { background: #FBEBDD; color: #9A4310; border: 1px solid #E6B48F; }
.verdict-pill-na    { background: #EFEFEF; color: #55595E; border: 1px solid #CFCFCF; }

.verdict-row-label {
  font-weight: 700;
}

.method-link {
  margin-left: auto;
  color: #1F4E8C;
  text-decoration: underline;
  font-size: 14px;
}

.verdict-dl {
  margin: 0;
  display: grid;
  grid-template-columns: 8em minmax(0, 1fr);
  gap: 8px 16px;
  font-size: 15px;
}

.verdict-dl dt {
  color: #5B5B57;
  margin: 0;
}

.verdict-dl dd {
  margin: 0;
}

.verdict-dl dd.is-answer {
  font-weight: 700;
}

.open-note {
  margin: 0;
  color: #3F3F3B;
}

.mismatch-note {
  margin: 0;
  padding: 10px 14px;
  border-radius: 6px;
  background: #E8EDF5;
  color: #1F2F4D;
  font-size: 14px;
}

/* 参加した AI */
.participants-section h2,
.utterances-section h2,
.your-vote-section h2,
.corrections-section h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.participants-wrap {
  overflow-x: auto;
}

.participants-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 520px;
  font-size: 14px;
}

.participants-table thead tr {
  text-align: left;
  color: #5B5B57;
}

.participants-table th {
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid #D9D6CF;
  font-weight: 500;
}

.participants-table th + th {
  padding-left: 12px;
}

.participants-table td {
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid #EEECE7;
}

.participants-table td + td {
  padding-left: 12px;
}

.participants-table td.col-name {
  font-weight: 700;
}

.participants-table td.col-model {
  color: #5B5B57;
}

/* 狭い幅 (640px 以下) では参加者 1 人ずつを縦積みカードにして
   モデル名まで横スクロールなしで読めるようにする */
@media (max-width: 640px) {
  .participants-wrap {
    overflow-x: visible;
  }
  .participants-table {
    min-width: 0;
    width: 100%;
  }
  .participants-table thead {
    display: none;
  }
  .participants-table,
  .participants-table tbody,
  .participants-table tr,
  .participants-table td {
    display: block;
    width: 100%;
  }
  .participants-table tr {
    border: 1px solid #D9D6CF;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 10px;
  }
  .participants-table td {
    padding: 2px 0;
    border-bottom: none;
  }
  .participants-table td + td {
    padding-left: 0;
  }
  .participants-table td.col-name {
    font-size: 16px;
    margin-bottom: 4px;
  }
  .participants-table td[data-label]::before {
    content: attr(data-label) ": ";
    color: #5B5B57;
    margin-right: 4px;
  }
}

/* 議論の全文 */
.utterances-section h2 {
  margin-bottom: 6px;
}

.utterance {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  padding: 16px 12px;
  border-bottom: 1px solid #EEECE7;
  background: #FFFFFF;
}

.utterance.is-interrupter {
  background: #F6F3EC;
}

.utterance-who-col {
  flex: 0 0 140px;
  font-size: 14px;
}

.utterance-who {
  font-weight: 700;
}

.utterance-no {
  color: #5B5B57;
  font-size: 12px;
}

.utterance-text {
  flex: 999 1 320px;
  margin: 0;
  font-family: "Shippori Mincho", "Yu Mincho", serif;
  font-size: 17px;
  line-height: 1.95;
}

/* あなたの判定（ログイン前） */
.your-vote-section {
  border: 1px solid #D9D6CF;
  border-radius: 8px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.your-vote-section .hint {
  margin: 4px 0 0;
  color: #5B5B57;
  font-size: 14px;
}

.login-prompt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 6px;
  background: #F3F1EC;
}

.login-prompt-text {
  flex: 1 1 280px;
  font-size: 14px;
}

.vote-bars {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.vote-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vote-label {
  flex: 0 0 6em;
}

.vote-track {
  flex: 1 1 auto;
  height: 10px;
  background: #EEECE7;
  border-radius: 5px;
  overflow: hidden;
}

.vote-fill {
  display: block;
  height: 10px;
}

.vote-count {
  flex: 0 0 3em;
  text-align: right;
}

/* 訂正記録 */
.no-corrections {
  margin: 0;
  color: #5B5B57;
  font-size: 14px;
}

.correction-row {
  padding: 12px 0;
  border-bottom: 1px solid #EEECE7;
  font-size: 14px;
}

.correction-head {
  margin: 0;
}

.correction-date {
  color: #5B5B57;
}

.correction-reason {
  margin: 4px 0 0;
  color: #3F3F3B;
}

/* 見つからないとき */
.not-found {
  padding: 32px 0;
  color: #3F3F3B;
}

.not-found a {
  color: #1F4E8C;
  text-decoration: underline;
}

/* ===== 静的ページ共通 (method / corrections / ask / about) ===== */

.static-article {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 760px;
}

.static-article h1 {
  margin: 0;
  font-family: "Shippori Mincho", "Yu Mincho", serif;
  font-size: 32px;
  line-height: 1.45;
  font-weight: 700;
}

.static-article h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.static-article section {
  margin: 0;
}

.static-article p {
  margin: 0;
}

.static-article ol {
  margin: 0;
  padding-left: 1.4em;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.beige-note {
  padding: 12px 16px;
  border-radius: 6px;
  background: #F3F1EC;
  font-size: 14px;
}

/* method: 三つの判定 dl */
.verdicts-dl {
  margin: 0;
  display: grid;
  grid-template-columns: 7em minmax(0, 1fr);
  gap: 10px 16px;
}

.verdicts-dl dt {
  margin: 0;
}

.verdicts-dl dd {
  margin: 0;
}

/* 共通テーブル wrap */
.table-wrap {
  overflow-x: auto;
}

.base-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}

.base-table thead tr {
  text-align: left;
  color: #5B5B57;
}

.base-table th {
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid #D9D6CF;
  font-weight: 500;
}

.base-table th + th { padding-left: 12px; }

.base-table td {
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid #EEECE7;
}

.base-table td + td { padding-left: 12px; }

/* calibration table */
.calibration-table { min-width: 480px; }

/* corrections table */
.corrections-table { min-width: 720px; }

.corrections-table tr { vertical-align: top; }

.corrections-table td.col-date {
  white-space: nowrap;
}

.corrections-table td.col-change {
  white-space: nowrap;
}

.corrections-table a {
  color: #1F4E8C;
  text-decoration: underline;
}

/* about: dl grid */
.about-dl {
  margin: 0;
  display: grid;
  grid-template-columns: 9em minmax(0, 1fr);
  gap: 12px 20px;
}

.about-dl dt {
  margin: 0;
  font-weight: 700;
}

.about-dl dd {
  margin: 0;
}

/* about: 削除依頼フォーム枠 */
.boxed-section {
  border: 1px solid #D9D6CF;
  border-radius: 8px;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.boxed-section h2 {
  margin: 0;
  font-size: 18px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-row label {
  font-weight: 700;
}

.form-row input,
.form-row select {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #A8A59E;
  border-radius: 6px;
  background: #FFFFFF;
  color: #1A1A1A;
}

.form-row textarea {
  padding: 10px 12px;
  border: 1px solid #A8A59E;
  border-radius: 6px;
  color: #1A1A1A;
  font-family: inherit;
}

.btn-submit {
  min-height: 44px;
  padding: 0 22px;
  border-radius: 6px;
  border: 1px solid #1A1A1A;
  background: #1A1A1A;
  color: #FFFFFF;
}

.pending-msg {
  margin: 0;
  padding: 10px 14px;
  border-radius: 6px;
  background: #F3F1EC;
  color: #3F3F3B;
  font-size: 14px;
}

/* API 読み込み失敗時 */
.load-error {
  margin: 12px 0;
  padding: 12px 16px;
  border-radius: 6px;
  background: #FAE6E6;
  color: #8A1F1F;
  border: 1px solid #E6B4B4;
  font-size: 14px;
}

/* ----- スマホ幅 ----- */
@media (max-width: 640px) {
  .container {
    padding: 0 16px;
  }

  .hero h1 {
    font-size: 26px;
  }

  .site-nav {
    gap: 2px 14px;
  }

  .site-nav a {
    font-size: 14px;
    min-height: 40px;
  }

  .brand-logo {
    font-size: 24px;
  }

  .list-header h2 {
    font-size: 18px;
  }

  .debate-title {
    font-size: 19px;
  }

  .header-actions {
    margin-left: 0;
  }

  main {
    padding: 24px 0 48px;
  }

  .debate-header h1 {
    font-size: 24px;
  }

  .verdict-box {
    padding: 16px;
  }

  .verdict-dl {
    grid-template-columns: 6em minmax(0, 1fr);
    gap: 6px 12px;
  }

  .verdict-pill {
    font-size: 16px;
    padding: 3px 12px;
  }

  .utterance {
    padding: 14px 0;
    gap: 2px 0;
  }

  .utterance-who-col {
    flex: 0 0 100%;
  }

  .utterance-text {
    font-size: 16px;
    line-height: 1.9;
  }

  .your-vote-section {
    padding: 16px;
  }

  .vote-label {
    flex: 0 0 5em;
  }

  .static-article h1 { font-size: 24px; }

  /* 項目名を上、説明を下に重ねる */
  .about-dl {
    display: block;
  }
  .about-dl dt {
    margin-top: 14px;
  }
  .about-dl dt:first-child {
    margin-top: 0;
  }
  .about-dl dd {
    margin: 2px 0 0;
  }

  .verdicts-dl { grid-template-columns: 6em minmax(0, 1fr); gap: 8px 12px; }
  .boxed-section { padding: 16px; }
}
