/* 回答ページ・管理画面 共通スタイル */
:root {
  --bg: #f4f5f7;
  --card: #fff;
  --ink: #1f2430;
  --sub: #667085;
  --line: #dfe3ea;
  --main: #2f6fde;
  --main-soft: #eaf1fd;
  --warn: #c62828;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", Meiryo, sans-serif;
  font-size: 16px; line-height: 1.7;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 16px 14px 60px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px 18px; margin-bottom: 16px; }
.center { text-align: center; padding: 48px 18px; }
h1 { font-size: 1.35rem; line-height: 1.45; margin: 0 0 14px; }
h2 { font-size: 1.15rem; margin: 0 0 16px; }
.small { font-size: .88rem; color: var(--sub); }
.intro { margin: 0 0 12px; }
.step { margin: 0 0 2px; color: var(--main); font-weight: 700; font-size: .85rem; }

.progress { position: sticky; top: 0; z-index: 5; height: 6px; background: var(--line); border-radius: 3px; margin-bottom: 14px; overflow: hidden; }
.progress div { height: 100%; background: var(--main); transition: width .3s; }

/* 設問 */
.q { border: 0; padding: 0; margin: 0 0 28px; min-width: 0; }
.q legend { font-weight: 700; padding: 0; margin-bottom: 10px; }
.qno { display: inline-block; background: var(--main); color: #fff; font-size: .78rem; border-radius: 6px; padding: 1px 8px; margin-right: 8px; vertical-align: 2px; }
.hint { font-weight: 400; color: var(--sub); font-size: .88rem; white-space: nowrap; }
.note { margin: -4px 0 10px; color: var(--sub); font-size: .88rem; }
.opt { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 12px 12px; margin-bottom: 8px; cursor: pointer; background: #fff; }
.opt input { flex: none; width: 20px; height: 20px; margin: 3px 0 0; accent-color: var(--main); }
.opt:has(input:checked) { border-color: var(--main); background: var(--main-soft); }
.opt.off { opacity: .45; cursor: not-allowed; }
.other, textarea, .field {
  width: 100%; font: inherit; color: inherit; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; background: #fff;
}
.other { margin-bottom: 8px; }
textarea { resize: vertical; }
.err { color: var(--warn); font-size: .9rem; font-weight: 700; margin: 6px 0 0; }

.nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; }
.nav:has(> :only-child) { justify-content: center; }
.btn {
  font: inherit; font-weight: 700; border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 10px; padding: 11px 22px; cursor: pointer; text-decoration: none; display: inline-block;
}
.btn.primary { background: var(--main); border-color: var(--main); color: #fff; }
.btn.danger { color: var(--warn); border-color: #f0c4c4; }
.btn.sm { padding: 5px 12px; font-size: .85rem; font-weight: 400; }
.btn:disabled { opacity: .5; cursor: default; }

/* 動画 */
.video { margin: 0 0 18px; }
.video figcaption { font-weight: 700; margin-bottom: 6px; }
.video video { display: block; width: 100%; max-height: 75vh; background: #000; border-radius: 10px; }
.video-empty { border: 2px dashed var(--line); border-radius: 10px; padding: 40px 10px; text-align: center; color: var(--sub); margin-bottom: 18px; }
.watched { margin-top: 6px; font-weight: 700; }

/* ---------- 管理画面 ---------- */
.admin .wrap { max-width: 1040px; }
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-bottom: 14px; }
.top h1 { margin: 0; font-size: 1.15rem; flex: 1 1 auto; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tabs a { text-decoration: none; color: var(--ink); padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: .92rem; }
.tabs a.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.msg { background: #e8f5e9; border: 1px solid #b7dfba; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }
.msg.bad { background: #fdecea; border-color: #f0c4c4; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.tile b { display: block; font-size: 1.6rem; line-height: 1.2; }
.tile span { color: var(--sub); font-size: .82rem; }

.filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.filters label { font-size: .82rem; color: var(--sub); display: block; }
select, .filters .field { font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; max-width: 100%; }

.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 16px; }
.grid2 .card { margin: 0; }
.qtitle { font-weight: 700; margin: 0 0 4px; font-size: .95rem; }
.qmeta { color: var(--sub); font-size: .8rem; margin: 0 0 10px; }
.bar-row { margin-bottom: 9px; font-size: .86rem; }
.bar-row .lab { display: flex; justify-content: space-between; gap: 10px; }
.bar-row .lab b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar { height: 10px; background: #eef0f4; border-radius: 5px; overflow: hidden; margin-top: 2px; }
.bar i { display: block; height: 100%; background: var(--main); border-radius: 5px; }

.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: .86rem; }
th, td { border: 1px solid var(--line); padding: 7px 9px; text-align: right; font-variant-numeric: tabular-nums; }
th { background: #f7f8fa; font-weight: 700; }
th:first-child, td:first-child { text-align: left; }
td small { color: var(--sub); display: block; }
.texts { margin: 0; padding: 0; list-style: none; }
.texts li { border-top: 1px solid var(--line); padding: 9px 0; font-size: .9rem; }
.texts li small { color: var(--sub); display: block; }
details.resp { border-top: 1px solid var(--line); padding: 9px 0; font-size: .9rem; }
details.resp summary { cursor: pointer; }
details.resp dl { margin: 10px 0 6px; }
details.resp dt { color: var(--sub); font-size: .8rem; }
details.resp dd { margin: 0 0 8px; }
.vrow { display: grid; grid-template-columns: 180px 1fr; gap: 14px; border-top: 1px solid var(--line); padding: 14px 0; }
.vrow video { width: 100%; background: #000; border-radius: 8px; }
.vrow .f { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
@media (max-width: 600px) { .vrow { grid-template-columns: 1fr; } }
progress { width: 100%; height: 14px; }
code { background: #f0f1f4; padding: 1px 6px; border-radius: 5px; font-size: .88em; }
