/* ===== 参加者画面（スマホ縦持ち前提） ===== */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  background: #f4f6f9;
  color: #12263A;
  line-height: 1.7;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}
.wrap { max-width: 560px; margin: 0 auto; padding: 16px 16px 48px; }

.head {
  padding: 14px 0 10px;
  border-bottom: 2px solid #e3e8ef;
  margin-bottom: 18px;
}
.head .ttl { font-size: 15px; font-weight: 700; color: #1B3B6F; letter-spacing: .02em; }
.head .sub { font-size: 12px; color: #7a8699; margin-top: 2px; }

.card {
  background: #fff;
  border-radius: 14px;
  padding: 20px 18px;
  box-shadow: 0 2px 10px rgba(18,38,58,.07);
}

/* ===== 設問タブ（複数同時受付） ===== */
.tabs { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.tabs.empty { display: none; }
.tab {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 12px 13px;
  border: 2px solid #dde3ec; border-radius: 12px;
  background: #fff; color: #33415c;
  font-family: inherit; font-size: 14px; font-weight: 700; line-height: 1.45;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.tab:active { transform: scale(.995); }
.tab.active { border-color: #1B3B6F; background: #1B3B6F; color: #fff; }
.tab.closed { opacity: .72; }
.tab.closed.active { opacity: 1; }
.tab-n {
  flex: 0 0 auto; font-size: 12px; font-weight: 800;
  padding: 2px 8px; border-radius: 6px;
  background: #eef3fb; color: #1B3B6F;
}
.tab.active .tab-n { background: rgba(255,255,255,.22); color: #fff; }
.tab-q {
  flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 回答状況バッジ */
.badge {
  flex: 0 0 auto; display: inline-block;
  font-size: 11px; font-weight: 800; letter-spacing: .02em;
  padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}
.badge.todo { background: #fff3e0; color: #d2691e; border: 1px solid #f0c48a; }
.badge.done { background: #17a673; color: #fff; border: 1px solid #17a673; }
.badge.closed { background: #e8ebf0; color: #5b6779; border: 1px solid #cfd6e0; }
.tab.active .badge.todo { background: #ffb74d; color: #4a2b00; border-color: #ffb74d; }
.tab.active .badge.closed { background: rgba(255,255,255,.2); color: #fff; border-color: rgba(255,255,255,.34); }

.q-head { margin-bottom: 8px; }
.closed-note {
  background: #f2f5f9; color: #55637a;
  font-size: 13px; font-weight: 700; line-height: 1.6;
  padding: 12px 13px; border-radius: 10px; margin-bottom: 16px;
}

.q {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.55;
  margin: 0 0 6px;
}
.q-note { font-size: 13px; color: #6b7789; margin: 0 0 18px; }

/* 入力欄 */
.field { margin-bottom: 14px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #55637a;
  margin-bottom: 6px;
}
.field input[type="text"] {
  width: 100%;
  font-size: 17px;
  padding: 14px 12px;
  border: 2px solid #d7deea;
  border-radius: 10px;
  background: #fff;
  font-family: inherit;
}
.field input[type="text"]:focus { outline: none; border-color: #1B3B6F; }
.counter { font-size: 12px; color: #94a1b5; text-align: right; margin-top: 4px; }
.counter.over { color: #d93025; font-weight: 700; }
.remain { font-size: 12px; color: #6b7789; font-weight: 700; margin-top: 2px; }

/* 入力欄＋送信ボタンを横並び（連投しやすく） */
.inline { display: flex; gap: 8px; align-items: stretch; }
.inline input[type="text"] { flex: 1 1 auto; min-width: 0; }
.btn.small {
  flex: 0 0 auto; width: auto; margin-top: 0;
  padding: 0 20px; font-size: 16px; border-radius: 10px;
}

/* 自分の投稿語一覧 */
.mine-wrap {
  margin-top: 20px; padding-top: 16px;
  border-top: 2px solid #eef2f7;
}
.mine-ttl { font-size: 13px; font-weight: 800; color: #55637a; margin-bottom: 10px; }
.mine-none { font-size: 13px; color: #94a1b5; margin: 0; }
.mine-hint { font-size: 12px; color: #94a1b5; margin: 10px 0 0; line-height: 1.6; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-w {
  display: inline-flex; align-items: center; gap: 6px;
  background: #eef3fb; color: #1B3B6F;
  font-size: 15px; font-weight: 700;
  padding: 8px 8px 8px 13px; border-radius: 999px;
  border: 1px solid #d3ddee;
  max-width: 100%; word-break: break-all;
}
.chip-x {
  flex: 0 0 auto;
  width: 24px; height: 24px; padding: 0;
  border: none; border-radius: 50%;
  background: #c3cede; color: #fff;
  font-family: inherit; font-size: 15px; font-weight: 700; line-height: 1;
  cursor: pointer;
}
.chip-x:active { background: #9aa8bd; }

/* 選択肢 */
.opts { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.opt {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 15px 14px;
  border: 2px solid #d7deea;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  line-height: 1.5;
  transition: border-color .12s, background .12s;
}
.opt.selected { border-color: #1B3B6F; background: #eef3fb; }
.opt.disabled { opacity: .45; }
.opts.readonly .opt { cursor: default; }
.opt.locked { cursor: default; }
.opt.locked:not(.selected) { opacity: .55; }
.opt .box {
  flex: 0 0 auto;
  width: 24px; height: 24px;
  border: 2px solid #b6c1d4;
  border-radius: 6px;
  background: #fff;
  margin-top: 1px;
  position: relative;
}
.opt.selected .box { border-color: #1B3B6F; background: #1B3B6F; }
.opt.selected .box::after {
  content: "";
  position: absolute; left: 6px; top: 2px;
  width: 6px; height: 12px;
  border: solid #fff; border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}
.opt input { display: none; }

/* ボタン */
.btn {
  display: block;
  width: 100%;
  padding: 17px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  background: #1B3B6F;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  margin-top: 18px;
}
.btn:disabled { background: #a9b4c6; cursor: default; }
.btn.ghost {
  background: #fff; color: #1B3B6F; border: 2px solid #1B3B6F;
  padding: 13px; font-size: 15px;
}

.msg {
  margin-top: 14px;
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  display: none;
}
.msg.err { display: block; background: #fdecea; color: #b3261e; }
.msg.info { display: block; background: #eaf2fd; color: #1B3B6F; }
.msg.ok { display: block; background: #e7f7f0; color: #0f7a54; }

/* 完了 / 待機 */
.center { text-align: center; padding: 40px 20px; }
.center .mark {
  width: 76px; height: 76px; margin: 0 auto 22px;
  border-radius: 50%;
  background: #1B3B6F;
  position: relative;
}
.center .mark::after {
  content: "";
  position: absolute; left: 27px; top: 18px;
  width: 16px; height: 32px;
  border: solid #fff; border-width: 0 5px 5px 0;
  transform: rotate(45deg);
}
.center h2 { font-size: 22px; margin: 0 0 10px; line-height: 1.5; }
.center p { font-size: 14px; color: #6b7789; margin: 0; }

.dots { display: inline-flex; gap: 6px; margin-bottom: 18px; }
.dots i {
  width: 10px; height: 10px; border-radius: 50%; background: #b6c1d4;
  animation: blink 1.2s infinite;
}
.dots i:nth-child(2) { animation-delay: .2s; }
.dots i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,100% { opacity: .3 } 50% { opacity: 1 } }

.foot { text-align: center; font-size: 11px; color: #a3adbf; margin-top: 26px; }
