/* SIM評価入力：1カラムのスマホ用ウィザード（一覧 → 1問ずつ → 結果） */
:root {
  --bg: #F3F6F5; --surface: #FFFFFF; --fg: #1B2A28; --muted: #5A6967; --line: #D3DDDA;
  --accent: #1E6B60; --accent-fg: #FFFFFF; --accent-soft: #DCEEEA; --warn: #B0472A; --warn-soft: #F8E4DD; --ok-soft: #E1F0E6;
  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "BIZ UDPGothic", "Yu Gothic UI", "Yu Gothic", "Meiryo", "Noto Sans JP", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111816; --surface: #1A2321; --fg: #E4ECEA; --muted: #98A9A5; --line: #2D3A37;
    --accent: #5DBFAE; --accent-fg: #0E1A17; --accent-soft: #1D3833; --warn: #F0916F; --warn-soft: #3A221B; --ok-soft: #1E3326;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font-family: var(--font); font-size: 16px; line-height: 1.6;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); -webkit-text-size-adjust: 100%; }
#app { max-width: 560px; margin: 0 auto; padding-inline: 16px; padding-block: 8px 48px; display: flex; flex-direction: column; gap: 16px; }
h1 { font-size: 1.25rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 0; }
p { margin: 0; }
.muted { color: var(--muted); font-size: .85rem; }
.warn { color: var(--warn); }
.strong { color: var(--fg); }
.bar { display: flex; align-items: center; gap: 8px; position: sticky; top: env(safe-area-inset-top, 0px); background: var(--bg); padding-block: 8px; z-index: 2; }
.bar h1, .bar h2 { flex: 1; min-width: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 10px 14px; font-size: .95rem; min-height: 44px; }
.btn.primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); font-weight: 700; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); padding-inline: 6px; }
.btn.ghost.warn { color: var(--warn); }
.btn.left { align-self: flex-start; }
.btn.danger { color: var(--warn); border-color: var(--warn); }
.btn:focus-visible, .opt:focus-visible, .row:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .picks button:focus-visible, .seg button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.prose p { font-size: .92rem; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: transparent; border-radius: 9px; padding: 10px; font-weight: 700; color: var(--muted); display: flex; flex-direction: column; align-items: center; }
.seg button small { font-weight: 400; font-size: .75rem; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); }
.list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 0; border-top: 1px solid var(--line); background: transparent; text-align: left; width: 100%; }
.row:first-child { border-top: 0; }
.row .t { flex: 1; min-width: 0; }
.row .t small { display: block; color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip { min-width: 44px; text-align: center; border-radius: 999px; padding: 2px 10px; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.chip.empty { background: transparent; color: var(--muted); border: 1px dashed var(--line); font-weight: 400; font-size: .8rem; }
.chip.off { background: transparent; color: var(--muted); font-weight: 400; font-size: .8rem; }
.tag { font-size: .7rem; border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; margin-left: 6px; color: var(--muted); font-weight: 400; vertical-align: middle; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.grid2 > * { min-width: 0; }
input[type="date"] { min-width: 0; max-width: 100%; -webkit-appearance: none; appearance: none; min-height: 44px; }
.stat { display: flex; flex-direction: column; }
.stat b { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
label { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); }
input, select, textarea { font: inherit; font-size: 16px; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px; width: 100%; }
textarea { min-height: 76px; resize: vertical; }
textarea.tall { min-height: 110px; }
details summary { cursor: pointer; font-weight: 700; }
.q-label { font-size: 1.15rem; font-weight: 700; }
.guide { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; font-size: .9rem; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { text-align: left; border: 2px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.opt b { font-size: 1.02rem; }
.opt span { font-size: .8rem; color: var(--muted); }
.opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.dots { display: flex; gap: 6px; flex-wrap: wrap; }
.dots i { width: 22px; height: 6px; border-radius: 3px; background: var(--line); }
.dots i.on { background: var(--accent); }
.score { font-size: 3.4rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; color: var(--accent); }
.scorebox { display: flex; align-items: flex-end; gap: 14px; }
.picks { display: flex; flex-wrap: wrap; gap: 6px; }
.picks button { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; min-width: 44px; min-height: 40px; padding: 6px 10px; font-variant-numeric: tabular-nums; }
.picks button[aria-pressed="true"] { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.answers { margin: 0; padding-left: 1.1em; font-size: .85rem; color: var(--muted); }
.note { background: var(--warn-soft); color: var(--fg); border-radius: 10px; padding: 10px 12px; font-size: .88rem; display: flex; flex-direction: column; gap: 8px; }
.note.ok { background: var(--ok-soft); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions .btn { flex: 1 1 auto; }
.foot { font-size: .75rem; border-top: 1px solid var(--line); padding-top: 10px; }
.rules { display: flex; flex-direction: column; gap: 10px; }
.rule { border-left: 3px solid var(--line); padding-left: 10px; display: flex; flex-direction: column; gap: 2px; }
.rule p { font-size: .88rem; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: .9rem; max-width: calc(100% - 32px); z-index: 5; }
@media (prefers-reduced-motion: no-preference) { .opt, .btn, .row { transition: background .12s, border-color .12s; } }
