/* 解説ページの「このページの説明はどうでしたか？」（js/expl-feedback.js。2026-10-13）
   授業ページのカード末尾の反応（/css/lesson-brief.css の .card-feedback）と同じ形。色だけ解説の藍に合わせる。
   赤い字は使わない（送れなかったときの一言は橙） */
.expl-fb {
  margin: 1.6em 0 0.4em;
  padding: 1em 1.15em;
  border: 1px solid rgba(100, 116, 139, 0.22);
  border-radius: 14px;
  background: #f8fafc;
  clear: both;
}
.expl-fb [hidden] { display: none !important; }
.expl-fb__title {
  font-weight: 800;
  font-size: 0.98rem;
  color: #334155;
  margin-bottom: 0.7em;
}
.expl-fb__btns { display: flex; flex-wrap: wrap; gap: 8px; }
.expl-fb__btn {
  flex: 1 1 auto;
  min-width: 7.2em;
  min-height: 46px;
  border: 1px solid rgba(100, 116, 139, 0.3);
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 0.45em 0.9em;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.18s, border-color 0.18s, color 0.18s;
}
.expl-fb__btn:hover { border-color: #6366f1; }
.expl-fb__btn.on { background: #4f46e5; border-color: #4f46e5; color: #fff; }
.expl-fb__btn:focus-visible, .expl-fb__ask:focus-visible, .expl-fb__send:focus-visible,
.expl-fb__toggle:focus-visible, .expl-fb__mini:focus-visible { outline: 2px solid #6366f1; outline-offset: 2px; }
.expl-fb__ask {
  margin-top: 0.7em;
  border: 0;
  background: none;
  color: #4338ca;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.45em 0;
  min-height: 44px;
}
.expl-fb__form { margin-top: 0.4em; }
.expl-fb__form textarea {
  display: block;
  width: 100%;
  min-height: 5.2em;
  padding: 0.6em 0.75em;
  border: 1px solid rgba(100, 116, 139, 0.35);
  border-radius: 10px;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.6;
  resize: vertical;
  box-sizing: border-box;
  background: #fff;
}
.expl-fb__note { margin: 0.45em 0 0; font-size: 0.82rem; color: #64748b; line-height: 1.6; }
.expl-fb__send {
  margin-top: 0.55em;
  min-height: 44px;
  padding: 0.45em 1.5em;
  border: 0;
  border-radius: 999px;
  background: #4f46e5;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.expl-fb__send:disabled { opacity: 0.6; cursor: default; }
.expl-fb__msg { margin-top: 0.5em; min-height: 1.2em; font-size: 0.88rem; font-weight: 700; color: #4338ca; }
.expl-fb__msg.err { color: #c2410c; }
.expl-fb__msg:empty { margin: 0; min-height: 0; }

/* ---- 教員の画面：はじめはボタン 1 つだけ ---- */
.expl-fb--t:not(.is-open) { border-color: transparent; background: none; padding: 0.2em 0; }
.expl-fb__toggle {
  min-height: 40px;
  padding: 0.35em 1em;
  border: 1px solid rgba(100, 116, 139, 0.32);
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}
.expl-fb__toggle:hover { border-color: #6366f1; color: #334155; }
.expl-fb--t.is-open .expl-fb__toggle { background: #eef2ff; border-color: #c7d2fe; color: #3730a3; }
.expl-fb__tbody { margin-top: 0.8em; }
.expl-fb__loading { color: #64748b; font-size: 0.9rem; }
.expl-fb__sum { font-size: 0.95rem; font-weight: 700; color: #334155; }
.expl-fb__sum b { font-size: 1.35rem; font-weight: 800; }
.expl-fb__warn {
  display: inline-block;
  margin-top: 0.4em;
  padding: 0.15em 0.7em;
  border-radius: 999px;
  background: #ffedd5;
  color: #9a3412;
  font-size: 0.85rem;
  font-weight: 800;
}
.expl-fb__bar {
  display: flex;
  height: 12px;
  margin: 0.7em 0 0.55em;
  border-radius: 999px;
  overflow: hidden;
  background: #e2e8f0;
}
.expl-fb__seg { flex: 0 1 0px; min-width: 0; }
.expl-fb__seg--4 { background: #16a34a; }
.expl-fb__seg--3 { background: #86efac; }
.expl-fb__seg--2 { background: #fbbf24; }
.expl-fb__seg--1 { background: #ea580c; }
.expl-fb__cells { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 0.5em; }
.expl-fb__cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 0.4em 0.3em;
  border: 1px solid #e2e8f0;
  border-top: 4px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  font-size: 0.8rem;
  color: #475569;
  text-align: center;
}
.expl-fb__cell--4 { border-top-color: #16a34a; }
.expl-fb__cell--3 { border-top-color: #86efac; }
.expl-fb__cell--2 { border-top-color: #fbbf24; }
.expl-fb__cell--1 { border-top-color: #ea580c; }
.expl-fb__cell-e { font-size: 1.15rem; line-height: 1.2; }
.expl-fb__cell-n { font-weight: 700; white-space: nowrap; }
.expl-fb__cell-c b { font-size: 1.05rem; color: #0f172a; }
.expl-fb__nhead { margin-top: 0.9em; font-size: 0.9rem; font-weight: 800; color: #334155; }
.expl-fb .expl-fb__notes { list-style: none; margin: 0.4em 0 0 !important; padding: 0 !important; display: grid; gap: 6px; }
.expl-fb .expl-fb__notes > li { list-style: none; margin: 0 !important; }
.expl-fb .expl-fb__notes > li::before, .expl-fb .expl-fb__notes > li::marker { content: none; }
.expl-fb__note-i { padding: 0.55em 0.75em; border: 1px solid #e2e8f0; border-radius: 10px; background: #fff; }
.expl-fb__note-i.is-seen { background: #f8fafc; opacity: 0.78; }
.expl-fb__note-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 0.78rem; color: #64748b; }
.expl-fb__chip { padding: 0 0.6em; border-radius: 999px; font-weight: 700; }
.expl-fb__chip--public { background: #e0e7ff; color: #3730a3; }
.expl-fb__chip--school { background: #dcfce7; color: #166534; }
.expl-fb__note-seen { color: #15803d; font-weight: 700; }
.expl-fb__note-t { margin-top: 0.3em; font-size: 0.92rem; line-height: 1.65; color: #1e293b; white-space: pre-wrap; overflow-wrap: anywhere; }
.expl-fb__note-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 0.4em; }
.expl-fb__mini {
  min-height: 34px;
  padding: 0.2em 0.8em;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.expl-fb__mini:hover { border-color: #6366f1; }
.expl-fb__mini--del:hover { border-color: #ea580c; color: #9a3412; }
.expl-fb__tfoot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 0.8em; font-size: 0.85rem; }
.expl-fb__all { color: #4338ca; font-weight: 700; }

/* 指で使う端末では，小さいボタンの当たりを広げる */
@media (pointer: coarse) {
  .expl-fb__mini { min-height: 40px; }
  .expl-fb__toggle { min-height: 44px; }
}
/* 狭い画面：理解度のボタンは 2 列に（1 行 4 つは押しにくい） */
@media (max-width: 560px) {
  .expl-fb { padding: 0.9em 0.9em; }
  .expl-fb__btn { flex: 1 1 44%; min-width: 0; }
  .expl-fb__cells { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 収録モード（解説動画）・印刷では出さない */
body.rec-mode .expl-fb { display: none !important; }
@media print { .expl-fb { display: none !important; } }
