/* 授業効果測定サイト survey_v001 ― 共通スタイル（スマートフォン優先） */
:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --ink: #1f2a2e;
  --muted: #5f6b70;
  --line: #dcd8cf;
  --accent: #1f6f6b;
  --accent-ink: #ffffff;
  --accent-soft: #e3f0ee;
  --warn: #b3261e;
  --warn-soft: #fbeaea;
  --right: #1e7a3c;
  --radius: 12px;
  font-size: 17px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  line-height: 1.7;
}
.top { background: var(--accent); color: var(--accent-ink); position: sticky; top: 0; z-index: 5; }
.top-inner { max-width: 720px; margin: 0 auto; padding: 10px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand { font-weight: 700; font-size: .95rem; }
.pidbox { font-size: .8rem; background: rgba(255,255,255,.18); padding: 2px 10px; border-radius: 999px; letter-spacing: .08em; white-space: nowrap; }
.wrap { max-width: 720px; margin: 0 auto; padding: 16px 16px 96px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 18px; margin-bottom: 16px; }
h1 { font-size: 1.3rem; margin: 0 0 12px; line-height: 1.4; }
h2 { font-size: 1.1rem; margin: 20px 0 8px; }
h2.block { border-left: 4px solid var(--accent); padding-left: 10px; margin-top: 28px; }
h3 { font-size: 1rem; margin: 16px 0 6px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); font-size: .9rem; }
.err { color: var(--warn); font-size: .92rem; min-height: 1em; margin: 8px 0; }
a { color: var(--accent); }

.btn {
  display: inline-block; appearance: none; border: 0; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700;
  padding: 12px 22px; min-height: 48px; cursor: pointer; width: 100%; margin-top: 6px;
}
.btn:disabled { opacity: .55; cursor: default; }
.btn.ghost { background: transparent; color: var(--accent); border: 1.5px solid var(--accent); }
.btn.small { width: auto; min-width: 0; min-height: 38px; padding: 6px 14px; font-size: .88rem; margin: 0; }
.btn.rec.on { background: var(--warn); border-color: var(--warn); color: #fff; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row .btn { flex: 1 1 140px; }

.consent { white-space: pre-wrap; background: #faf9f6; border: 1px solid var(--line); border-radius: 10px; padding: 14px; font-size: .93rem; margin-bottom: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; }
.check input { width: 22px; height: 22px; margin-top: 3px; flex: none; accent-color: var(--accent); }
.notes { padding-left: 1.2em; font-size: .93rem; }
.notes li { margin-bottom: 6px; }

.pidinput {
  font: inherit; font-size: 1.2rem; letter-spacing: .2em; text-transform: uppercase;
  padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; width: 100%; max-width: 220px; flex: 1 1 160px;
}
.bigpid { font-size: 2.4rem; font-weight: 800; letter-spacing: .25em; text-align: center; background: var(--accent-soft); color: var(--accent); border-radius: 12px; padding: 14px 8px; margin: 8px 0 16px; font-family: "SFMono-Regular", Menlo, Consolas, monospace; }
.field { display: block; margin: 12px 0; }
.field span { display: block; font-size: .9rem; color: var(--muted); }

.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; }
.choice span { display: inline-block; padding: 10px 16px; border: 1.5px solid var(--line); border-radius: 999px; min-width: 64px; text-align: center; cursor: pointer; }
.choice input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); }
.choice input:focus-visible + span { outline: 3px solid #8cc7c2; }

.scalehead { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); position: sticky; top: 46px; background: var(--card); padding: 6px 0; z-index: 2; border-bottom: 1px solid var(--line); }
.sq { padding: 12px 0; border-bottom: 1px solid #eeebe4; }
.sq.missing { outline: 2px solid var(--warn); outline-offset: 4px; border-radius: 6px; background: var(--warn-soft); }
.sqt { margin: 0 0 8px; font-weight: 600; }
.opt { font-size: .75rem; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; margin-left: 6px; font-weight: 400; }
.likert { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.likert label { position: relative; }
.likert input { position: absolute; opacity: 0; }
.likert span { display: block; text-align: center; padding: 9px 0; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; font-weight: 700; }
.likert input:checked + span { background: var(--accent); color: #fff; border-color: var(--accent); }
.likert input:focus-visible + span { outline: 3px solid #8cc7c2; }
textarea { width: 100%; font: inherit; font-size: 1rem; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; resize: vertical; min-height: 96px; }
textarea:focus, .pidinput:focus { outline: none; border-color: var(--accent); }

.testhead { display: flex; justify-content: space-between; font-weight: 700; color: var(--accent); }
.bar { height: 6px; background: #ebe8e0; border-radius: 99px; margin: 8px 0 16px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }
.stem { font-size: 1.05rem; font-weight: 600; }
.opts { display: grid; gap: 10px; margin: 8px 0; }
.opts .opt { all: unset; display: flex; gap: 12px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; position: relative; }
.opts .opt input { position: absolute; opacity: 0; }
.opts .opt .mark { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line); display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.opts .opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.opts .opt:has(input:checked) .mark { background: var(--accent); color: #fff; border-color: var(--accent); }

.ivq { padding: 10px 0 14px; border-bottom: 1px solid #eeebe4; }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.saved, .recst { font-size: .8rem; color: var(--muted); }
.probe { margin-top: 10px; padding: 10px 12px; background: var(--accent-soft); border-radius: 10px; }
.pq { font-weight: 600; margin-bottom: 6px; }

.qa .kw { display: inline-block; font-size: .8rem; background: var(--accent-soft); color: var(--accent); border-radius: 6px; padding: 0 8px; margin-bottom: 6px; }
.optlist li.right { color: var(--right); font-weight: 700; }
.expl { background: #faf9f6; border-radius: 8px; padding: 10px; font-size: .93rem; }

#tbtn { position: fixed; right: 16px; bottom: 16px; z-index: 10; border: 0; border-radius: 999px; background: #6b4fa8; color: #fff; font: inherit; font-weight: 700; padding: 10px 16px; box-shadow: 0 4px 12px rgba(0,0,0,.2); cursor: pointer; }
.testtag { position: fixed; left: 16px; bottom: 16px; z-index: 10; background: #6b4fa8; color: #fff; font-size: .75rem; padding: 2px 10px; border-radius: 6px; }

@media (min-width: 560px) {
  .btn { width: auto; min-width: 200px; }
  .card { padding: 24px 28px; }
}
