/* 旧 Vuetify 版の配色をそのまま踏襲しつつ、スマホでの片手操作に寄せている。
   起床直後の被験者が寝ぼけたまま触るので、タップ目標は最低 44px を守る。 */
:root {
  --accent: rgb(128, 160, 97);
  --header: linear-gradient(-58deg, #a2cdaf, #adcd8f);
  --page: linear-gradient(-58deg, #aecfd7, #cee1bc);
  --band-a: rgb(240, 240, 240);
  --band-b: linear-gradient(90deg, rgb(230, 230, 230), rgb(211, 229, 198) 100%);
  --btn: #f0f0f0;
  --ink: #1c1c1c;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  background: #dfe7e0;
}

.shell { max-width: 1000px; margin: 0 auto; background: #fff; min-height: 100vh; }

header.bar {
  background: var(--header);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}
header.bar h1 { font-size: 17px; margin: 0; font-weight: 600; }
header.bar .who { font-size: 12px; opacity: .95; }
header.bar button {
  background: rgba(255, 255, 255, .22);
  border: 0; color: #fff; border-radius: 6px;
  padding: 8px 12px; font-size: 13px; cursor: pointer; min-height: 36px;
}

main { background: var(--page); padding: 16px; min-height: calc(100vh - 60px); }

.card { background: rgba(255, 255, 255, .55); border-radius: 10px; padding: 16px; }

/* ---- タブ ---- */
.tabs { display: flex; border-bottom: 2px solid rgba(255, 255, 255, .6); margin-bottom: 12px; }
.tabs button {
  flex: 1; background: none; border: 0; padding: 12px 4px;
  font-size: 14px; color: #4c6340; cursor: pointer; border-bottom: 3px solid transparent;
}
.tabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }
.tabs button[data-done="1"]::after { content: " ✓"; color: var(--accent); }

/* ---- 設問 ---- */
.note { font-weight: 700; margin: 20px 0 8px; }
.legend { background: #dadada; padding: 10px 12px; border-radius: 6px; font-size: 14px; white-space: pre-line; margin: 8px 0; }
.hint { font-size: 13px; color: #444; margin-top: -4px; }

.q { padding: 12px 14px; border-radius: 6px; margin: 6px 0; }
.q.band-a { background: var(--band-a); }
.q.band-b { background: var(--band-b); }
.q > .label { display: block; margin-bottom: 8px; }
.q.missing { outline: 2px solid #d05252; outline-offset: 1px; }

/* 縦並びの選択肢 (SSS) */
.opts-v { display: flex; flex-direction: column; gap: 2px; }
.opts-v label { display: flex; gap: 10px; align-items: flex-start; padding: 10px 6px; border-radius: 4px; cursor: pointer; min-height: 44px; }
.opts-v label:has(input:checked) { background: rgba(128, 160, 97, .22); }

/* 横並びの数値選択肢 (JESS / PSS) */
.opts-h { display: flex; gap: 6px; flex-wrap: wrap; }
.opts-h label {
  flex: 1 1 0; min-width: 56px; min-height: 46px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; background: #fff; border: 1px solid #c6cbc0; border-radius: 6px;
  font-size: 13px; cursor: pointer; padding: 4px 2px; text-align: center;
}
.opts-h label:has(input:checked) { background: var(--accent); color: #fff; border-color: var(--accent); }
.opts-h input, .opts-v input { accent-color: var(--accent); width: 20px; height: 20px; flex: none; }
.opts-h input { display: none; }

/* 両極尺度 (OSA) と SD 尺度 (温冷感) */
.bipolar .anchors { display: flex; justify-content: space-between; font-size: 13px; gap: 8px; margin-bottom: 6px; }
.bipolar .anchors span { flex: 1 1 0; }
.bipolar .anchors span:last-child { text-align: right; }
.sd-labels { display: flex; gap: 4px; margin-top: 4px; }
.sd-labels span { flex: 1 1 0; text-align: center; font-size: 11px; color: #333; }

select, input[type="time"], input[type="number"], input[type="text"] {
  font-size: 16px; padding: 10px; border: 1px solid #b9beb2; border-radius: 6px;
  background: #f0f0f0; width: 100%; min-height: 44px; font-family: inherit;
}
.inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.inline input { width: 90px; }
.inline .suffix { font-size: 14px; }

.btn {
  display: block; width: 100%; min-height: 48px; border: 1px solid #c9cec2;
  border-radius: 6px; background: var(--btn); font-size: 15px; font-family: inherit;
  cursor: pointer; padding: 12px; margin: 8px 0; white-space: pre-line;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 700; }
.btn.danger { background: #ff7f7f; border-color: #ff7f7f; }
.menu .btn { max-width: 460px; margin: 10px auto; }
.menu .btn.done { background: #dfe9d4; }

/* ---- 課題 (PVT / 3-back) ---- */
.task { text-align: center; padding: 8px 0 24px; }
.reaction {
  width: 174px; height: 174px; border-radius: 50%; border: 0;
  font-size: 17px; white-space: pre-line; cursor: pointer; margin: 24px auto;
  display: block; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); touch-action: manipulation;
  user-select: none; font-family: inherit;
}
.rt { font-size: 15px; min-height: 24px; }
.bar-track { height: 6px; background: #e0e0e0; border-radius: 3px; overflow: hidden; margin: 24px auto 8px; max-width: 92%; }
.bar-fill { height: 100%; background: var(--accent); transition: width .25s; }

.nb-question { font-size: 30px; font-weight: 700; margin: 20px 0; min-height: 46px; }
.nb-pad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; max-width: 420px; margin: 12px auto; }
.nb-pad button {
  min-height: 56px; font-size: 20px; border: 1px solid #c9cec2; border-radius: 6px;
  background: #fff; cursor: pointer; font-family: inherit;
}
.nb-pad button[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.nb-status { font-size: 14px; min-height: 22px; }

/* ---- ダイアログ / トースト ---- */
dialog {
  border: 0; border-radius: 10px; padding: 24px; font-size: 16px; max-width: 440px;
  width: calc(100% - 48px); text-align: center;
}
dialog::backdrop { background: rgba(0, 0, 0, .45); }
dialog .btn { max-width: 200px; margin: 16px auto 0; }

.pending { background: #fff3cd; border: 1px solid #e0c97f; border-radius: 6px; padding: 10px 12px; font-size: 14px; margin-bottom: 12px; }

/* ---- ログイン ---- */
.login { max-width: 380px; margin: 40px auto; }
.login label { display: block; margin-bottom: 8px; font-weight: 700; }
.err { color: #b00020; font-size: 14px; min-height: 20px; margin-top: 8px; }

@media (max-width: 480px) {
  body { font-size: 15px; }
  .q { padding: 10px; }
  .opts-h label { min-width: 44px; font-size: 12px; }
  .bipolar .anchors { font-size: 12px; }
}
