/* 1カラムのスマホ画面。方向1「大きな問診カードの束」。白と墨に青1色、赤はまちがいの知らせだけ */
:root {
  --bg: #fafbfd;
  --surface: #ffffff;
  --paper: #fbfaf5;
  --ink: #15191f;
  --sub: #4f5866;
  --faint: #8a929e;
  --line: #e4e7ec;
  --accent: #4a78a6;
  --accent-soft: #eef3f8;
  --chip: #f1f3f6;
  --on-accent: #ffffff;
  --error: #c62f2f;
  --error-soft: #fdeeee;
  --font-body: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #111418; --surface: #1a1f26; --paper: #22261f; --ink: #eceff3; --sub: #b0b8c4; --faint: #7f8894;
    --line: #2d343e; --accent: #7aa7f5; --accent-soft: #1b2a44; --chip: #232a33; --on-accent: #0c1424;
    --error: #f08a8a; --error-soft: #3a1d1d; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #111418; --surface: #1a1f26; --paper: #22261f; --ink: #eceff3; --sub: #b0b8c4; --faint: #7f8894;
  --line: #2d343e; --accent: #7aa7f5; --accent-soft: #1b2a44; --chip: #232a33; --on-accent: #0c1424;
  --error: #f08a8a; --error-soft: #3a1d1d; color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 18px; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  padding-inline: 16px; padding-block: 0 48px; margin: 0;
}
.app { max-width: 460px; margin: 0 auto; }
.demo-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font-size: 13px; color: var(--sub); padding-block: 12px;
}
.demo-bar b { color: var(--accent); font-weight: 700; }
.demo-bar button { flex: none; white-space: nowrap; font: inherit; color: var(--accent); background: none; border: 0; padding: 4px 0; cursor: pointer; text-decoration: underline; }
h1, h2 { word-break: auto-phrase; font-weight: 800; letter-spacing: 0.02em; line-height: 1.35; text-wrap: balance; margin: 0; }
h1 { font-size: 32px; }
h2 { font-size: 20px; }
p { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
section.stack { gap: 24px; padding-top: 28px; }
.lead { color: var(--ink); font-size: 18px; }
.note { color: var(--faint); font-size: 13px; }

/* ボタン。1画面でいちばん目立つのは、先へ進む1つだけ */
.btn {
  display: block; width: 100%; min-height: 68px; border-radius: 10px; border: 1px solid var(--accent);
  background: var(--accent); color: var(--on-accent); font: inherit; font-size: 22px; font-weight: 800; cursor: pointer; padding: 12px 16px;
}
.btn.ghost { background: var(--chip); color: var(--ink); border-color: var(--line); font-size: 20px; font-weight: 800; min-height: 60px; border-width: 2px; }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn:focus-visible, .choice:focus-visible, .opt:focus-visible, .change:focus-visible, .small-btn:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* 紙の案内（見本と係の人の画面） */
.paper {
  background: var(--paper); border: 1px solid var(--line); border-radius: 2px; padding: 22px 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06); font-size: 14px; display: flex; flex-direction: column; gap: 12px;
}
.paper .org { color: var(--sub); font-size: 12px; }
.paper .ttl { font-size: 17px; font-weight: 700; }
.paper dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; border-top: 1px dashed var(--line); padding-top: 12px; }
.paper dt { color: var(--sub); }
.paper dd { margin: 0; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* 入力欄。ラベルは欄の真上、欄の中には何も書かない */
label.f { display: flex; flex-direction: column; gap: 8px; font-size: 18px; font-weight: 800; }
input[type=text], input[type=password], textarea {
  font: inherit; font-size: 20px; font-weight: 500; padding: 14px 16px; border: 2px solid var(--faint); border-radius: 10px;
  background: var(--surface); color: var(--ink); width: 100%; min-height: 64px;
}
textarea { min-height: 120px; font-size: 17px; }
.error { color: var(--error); font-size: 15px; font-weight: 700; }
p.error.box { background: var(--error-soft); border-radius: 8px; padding: 12px 14px; }

/* 答える画面: 上に「いま何問目、あと何問」 */
.pos {
  position: sticky; top: 0; z-index: 2; background: var(--bg);
  margin-inline: -16px; padding: 14px 16px 10px; display: flex; flex-direction: column; gap: 8px;
}
.pos-row { display: flex; align-items: baseline; gap: 14px; font-variant-numeric: tabular-nums; }
.pos-n { font-size: 46px; font-weight: 800; line-height: 1; letter-spacing: 0.01em; }
.pos-n small { font-size: 28px; color: var(--sub); font-weight: 700; }
.pos-left { font-size: 28px; font-weight: 800; line-height: 1; padding-left: 14px; border-left: 2px solid var(--line); }
.progress { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: color-mix(in srgb, var(--accent) 60%, #fff); transition: width .2s; }
@media (prefers-reduced-motion: reduce) { .progress > i { transition: none; } }
.who { font-size: 15px; color: var(--sub); }
.banner { font-size: 20px; font-weight: 700; color: var(--ink); word-break: auto-phrase; }

/* 問いのカード。1問ずつ、見出しの大きさで */
.q { scroll-margin-top: 130px; scroll-margin-bottom: 170px; display: flex; flex-direction: column; gap: 14px; padding-block: 28px 8px; }
.q-no { font-size: 1em; font-weight: 800; color: color-mix(in srgb, var(--accent) 65%, #fff); font-variant-numeric: tabular-nums; }
.q-text { font-size: 27px; font-weight: 800; line-height: 1.4; text-wrap: pretty; }
.q-text .unit-h { font-size: 18px; font-weight: 700; color: var(--sub); }
.q-opt { font-size: 14px; color: var(--sub); font-weight: 500; }
.q-hint { font-size: 16px; color: var(--sub); line-height: 1.7; }
.q-hint-line { display: block; }
.q-hint-line + .q-hint-line { margin-top: 6px; }
.q.is-missing::before { content: "まだ答えていません"; color: var(--error); font-size: 15px; font-weight: 700; }

/* 選択肢の札。画面幅いっぱい、丸い印つき */
.choices, .opts { display: flex; flex-direction: column; gap: 14px; }
.choice, .opt {
  font: inherit; text-align: left; width: 100%; min-height: 68px; padding: 18px 16px; border-radius: 10px;
  border: 2px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer;
  display: grid; grid-template-columns: 30px 1fr auto; column-gap: 14px; align-items: start;
}
.mark { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--faint); margin-top: 2px; position: relative; }
.many .mark { border-radius: 6px; }
.c-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.c-label { font-size: 21px; font-weight: 800; line-height: 1.4; }
.c-note { font-size: 15px; color: var(--sub); line-height: 1.6; font-weight: 400; }
.choice[aria-pressed="true"], .opt.is-sel { border-color: var(--accent); background: var(--accent-soft); }
.choice[aria-pressed="true"] .mark, .opt.is-sel .mark { border-color: var(--accent); }
.choice[aria-pressed="true"] .mark::after, .opt.is-sel .mark::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--accent); }
.many .choice[aria-pressed="true"] .mark::after, .many .opt.is-sel .mark::after { border-radius: 3px; }
/* 前の答えが決まっている問い: 選んでいない札は、変えるまで押しても答えは変わらない */
.opt:not(.is-sel) { color: var(--sub); background: transparent; }
.opt:not(.is-sel) .c-label { font-weight: 700; }
.tag {
  display: inline-block; align-self: flex-start; font-size: 14px; font-weight: 700; color: var(--sub);
  background: var(--chip); border: 1px solid var(--line); border-radius: 4px; padding: 0 8px; line-height: 1.7;
}
.change {
  flex: none; font: inherit; font-size: 20px; font-weight: 800; min-height: 60px; padding: 0 22px; border-radius: 10px;
  border: 2px solid var(--line); background: var(--chip); color: var(--ink); cursor: pointer; align-self: start;
}
.q-prev { font-size: 16px; color: var(--sub); }

/* 数の問い */
.num-show { display: flex; align-items: center; gap: 14px; padding: 18px 16px; border-radius: 10px; border: 2px solid var(--accent); background: var(--accent-soft); }
.num-show .val { font-size: 36px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.num-show .val small { font-size: 18px; color: var(--sub); margin-left: 4px; }
.num-show .c-body { flex: 1; }
.num-show.is-empty { border-color: var(--line); background: var(--surface); }
.num-row { display: flex; align-items: center; gap: 10px; }
.num-row input { max-width: 7em; font-size: 36px; font-weight: 800; font-variant-numeric: tabular-nums; }
.num-row .unit { color: var(--sub); font-size: 18px; font-weight: 700; }
.small-btn { font: inherit; font-size: 18px; font-weight: 800; min-height: 60px; padding: 0 22px; border-radius: 10px; border: 2px solid var(--accent); background: var(--surface); color: var(--accent); cursor: pointer; }
.num-row .small-btn { margin-left: auto; }
.text-show { display: flex; gap: 14px; align-items: flex-start; justify-content: space-between; }
.text-show p { font-size: 17px; white-space: pre-wrap; overflow-wrap: anywhere; }
.empty { color: var(--faint); font-weight: 400; }

.sticky {
  position: sticky; bottom: 0; background: var(--bg); margin-inline: -16px; padding-inline: 16px;
  padding-block: 14px calc(12px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 8px;
  border-top: 1px solid var(--line);
}
.count { text-align: center; font-size: 16px; color: var(--sub); font-variant-numeric: tabular-nums; }

/* 確かめる */
.check { display: flex; gap: 14px; align-items: center; font-size: 18px; font-weight: 800; padding: 18px 16px; min-height: 64px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; }
.check input { width: 30px; height: 30px; flex: none; margin: 0; accent-color: var(--accent); }
.lead-sub { font-size: 16px; color: var(--sub); margin-top: 10px; }
/* 一覧: 14問の答えを並べ、どの問いにも「直す」。行は余白で分ける */
.sums { display: flex; flex-direction: column; gap: 22px; margin-top: 24px; }
.sum { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; align-items: start; }
.sum-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sum-q { font-size: 16px; color: var(--sub); line-height: 1.5; }
.sum-a { font-size: 26px; font-weight: 800; line-height: 1.4; overflow-wrap: anywhere; }
.sum-a.error { font-size: 18px; }
.lead b { color: var(--sub); font-size: 36px; line-height: 1; font-weight: 800; padding-inline: 2px; }
details { font-size: 18px; }
details summary { cursor: pointer; color: var(--sub); font-weight: 800; min-height: 52px; display: flex; align-items: center; }
details ul { margin: 4px 0 0; padding-left: 1.2em; color: var(--sub); display: flex; flex-direction: column; gap: 6px; }

/* 送った */
.done-mark { font-size: 40px; font-weight: 800; line-height: 1.3; }
.done-name { font-size: 26px; font-weight: 700; }

/* アンケート・係の人の画面 */
.step { font-size: 13px; color: var(--sub); font-variant-numeric: tabular-nums; }
.bars { display: flex; flex-direction: column; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 9.5em 1fr 2.5em; gap: 10px; align-items: center; font-size: 14px; }
.bar { height: 14px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.bar-row .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--sub); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.mode-demo { display: none; }
html[data-kit-mode="demo"] .mode-demo { display: block; }
.letters { display: flex; flex-direction: column; gap: 12px; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th, table.list td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { color: var(--sub); font-weight: 500; }
.wide { max-width: 960px; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-variant-numeric: tabular-nums; }
@media print {
  body { background: #fff; padding: 0; }
  .no-print { display: none !important; }
  .paper { box-shadow: none; break-inside: avoid; margin-bottom: 24px; }
}
/* 選んでいる札の「変える」は右上に置いて、札の説明の幅を削らない */
.opt { position: relative; }
.opt .change { position: absolute; top: 10px; right: 10px; }
.opt.is-sel .c-label { padding-right: 108px; min-height: 34px; }
/* 1問ずつ: 下の帯は画面の下に固定。前へ戻るのは控えめな文字のボタン */
.form-screen { padding-bottom: 190px; }
.form-screen .q { padding-block: 4px 8px; }
.q-text:focus { outline: none; }
.step-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; background: var(--bg); border-top: 1px solid var(--line); }
.step-in { max-width: 460px; margin: 0 auto; padding: 14px 16px calc(8px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 6px; }
.back { font: inherit; font-size: 18px; font-weight: 700; color: var(--accent); background: none; border: 0; min-height: 52px; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
.back:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
/* 一覧で「変えた」問いの札は、うすい色の面に（色が強すぎるという依頼者の言葉。2026-10-06 デザイナー案 kumi5 を写した） */
.sum.is-changed .tag { background: var(--chip); color: var(--ink); font-size: 16px; }

/* 入る画面: 紙の案内と同じ出し手・題・期限を先に見せて、どの問診かを一目で分かるようにする */
.intro { display: flex; flex-direction: column; gap: 10px; padding-bottom: 20px; border-bottom: 2px solid var(--ink); }
.intro-org { font-size: 16px; font-weight: 700; color: var(--sub); }
.intro h1 { font-size: 36px; line-height: 1.3; }
.intro-facts { display: flex; flex-wrap: wrap; gap: 4px 0; }
.intro-facts span { font-size: 17px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

/* めくる: 次の問いは右から、戻ると左から、少しだけ動いて入る */
@keyframes in-fwd { from { opacity: 0; transform: translateX(28px); } to { opacity: 1; transform: none; } }
@keyframes in-bwd { from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }
#q-one.in-fwd { animation: in-fwd .22s ease-out; }
#q-one.in-bwd { animation: in-bwd .22s ease-out; }
@media (prefers-reduced-motion: reduce) { #q-one.in-fwd, #q-one.in-bwd { animation: none; } }

/* 選択肢が下の帯に隠れているときの知らせ。押すとそこまで動く */
.more { font: inherit; font-size: 18px; font-weight: 800; color: var(--ink); background: var(--surface); border: 2px dashed var(--faint); border-radius: 10px; min-height: 56px; cursor: pointer; }
.more:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* 送った: 大きな丸と印で、終わったことを文字を読む前に伝える */
.done-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding-top: 24px; }
.done-check { width: 88px; height: 88px; border-radius: 50%; background: var(--accent-soft); position: relative; animation: done-pop .35s ease-out; }
.done-check::after { content: ""; position: absolute; left: 31px; top: 17px; width: 22px; height: 42px; border: solid color-mix(in srgb, var(--accent) 65%, var(--sub)); border-width: 0 8px 8px 0; transform: rotate(45deg); }
@keyframes done-pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .done-check { animation: none; } }
.done-facts { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; padding: 18px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; font-variant-numeric: tabular-nums; }
.done-facts dt { color: var(--sub); font-size: 16px; }
.done-facts dd { margin: 0; font-size: 18px; font-weight: 800; }
.done-note { border: 2px dashed var(--line); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.done-note p { margin: 0; }
.done-close { font-size: 18px; font-weight: 700; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* 読み上げだけの区切り */
.sr + span { margin-left: 12px; padding-left: 12px; border-left: 2px solid var(--line); }
.sr[hidden] + span { margin-left: 0; padding-left: 0; border-left: 0; }
#done-title:focus { outline: none; }
.q-prev-top { font-size: 17px; font-weight: 700; color: var(--ink); padding: 8px 12px; border-left: 4px solid var(--accent); background: var(--surface); }
details summary::before { content: "\25B8"; margin-right: 8px; }
details[open] summary::before { content: "\25BE"; }
