/* ===== 生活習慣セルフチェック =====
   切替はクラスのみ。インラインstyle不使用。
   リフロー防止：コンテナをmin-heightで保持
   ================================== */

.plc-wrap {
  box-sizing: border-box;
  font-family: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', sans-serif;
  font-size: 13px;
  color: #222;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #d4e8c2;
  width: 100%;
  line-height: normal;
}
.plc-wrap div,
.plc-wrap p,
.plc-wrap span,
.plc-wrap button,
.plc-wrap svg {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── プログレス ── */
.plc-wrap .plc-progress-wrap {
  background: #fff;
  padding: 10px 14px 0;
  border-bottom: 1px solid #f0f0f0;
}
.plc-wrap .plc-dots {
  display: flex;
  gap: 3px;
  align-items: center;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.plc-wrap .plc-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #e0e0e0;
  flex-shrink: 0;
  transition: background .2s, transform .2s;
  display: block;
}
.plc-wrap .plc-dot.done    { background: #b2d9b2; }
.plc-wrap .plc-dot.current { background: #2e6b2e; transform: scale(1.4); }
.plc-wrap .plc-prog-bar {
  height: 3px; background: #eee;
  border-radius: 2px; overflow: hidden;
}
.plc-wrap .plc-prog-fill {
  height: 100%; background: #f5c000;
  border-radius: 2px; transition: width .4s ease;
}
.plc-wrap .plc-prog-txt {
  font-size: 10px; color: #888;
  text-align: right; margin-top: 3px;
  padding-bottom: 7px; display: block;
}

/* ──────────────────────────────────────
   ステップコンテナ
   min-height で高さを確保しつつ、
   ステップ切替はvisibility+opacityのみ
   高さに影響するプロパティは変更しない
   ────────────────────────────────────── */
.plc-wrap .plc-steps-container {
  background: #fff;
  position: relative;
  /* 全ステップの最大高さ程度を確保（質問4択の想定） */
  min-height: 200px;
}

/* 非アクティブ：見えないが高さは持つ（visibility） */
.plc-wrap .plc-step {
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.15s ease;
  padding: 12px 14px 14px;
  background: #fff;
  /* position:absolute で重ねて高さをコンテナから切り離す */
  position: absolute;
  top: 0; left: 0; right: 0;
}

/* アクティブ：表示 かつ relative でコンテナ高さを押し広げる */
.plc-wrap .plc-step.is-active {
  visibility: visible;
  opacity: 1;
  position: relative;
}

/* カテゴリタグ */
.plc-wrap .plc-cat-tag {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 9px; border-radius: 4px;
  font-size: 10px; font-weight: 700; margin-bottom: 9px;
  line-height: 1.4;
}
.plc-wrap .plc-cat-tag--sleep  { background: #e8f0ff; color: #2a4db5; }
.plc-wrap .plc-cat-tag--stress { background: #f5e8ff; color: #6a2a99; }

/* 質問文 */
.plc-wrap .plc-question-text {
  font-size: 12px; font-weight: 700; color: #1a4a1a;
  line-height: 1.6;
  border-left: 3px solid #f5c000;
  padding-left: 8px; margin-bottom: 11px;
  display: block;
}

/* 選択肢 */
.plc-wrap .plc-options {
  display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px;
}
.plc-wrap .plc-option {
  display: block; width: 100%;
  padding: 9px 12px;
  border-radius: 7px; border: 1.5px solid #d4e8c2;
  background: #fff; color: #333;
  font-size: 12px; text-align: left;
  cursor: pointer; font-family: inherit; line-height: 1.4;
  transition: border-color .12s, background .12s;
  position: relative; margin: 0;
}
.plc-wrap .plc-option:hover {
  border-color: #52b788; background: #f5fbf7;
}
.plc-wrap .plc-option.is-selected {
  border-color: #2e6b2e; background: #e4f4e8;
  color: #1a4a1a; font-weight: 700;
}
.plc-wrap .plc-option.is-selected::after {
  content: '✓';
  position: absolute; right: 11px; top: 50%;
  transform: translateY(-50%);
  color: #2e6b2e; font-size: 13px; font-weight: 900;
}

/* ナビ */
.plc-wrap .plc-nav {
  display: flex; gap: 6px; margin-top: 2px;
}
.plc-wrap .plc-btn-back {
  padding: 7px 12px; border-radius: 6px;
  border: 1.5px solid #ccc; background: #fff; color: #888;
  font-size: 11px; cursor: pointer; font-family: inherit;
  transition: all .15s; margin: 0; line-height: 1.4;
}
.plc-wrap .plc-btn-back:hover { border-color: #999; color: #555; }
.plc-wrap .plc-btn-next {
  flex: 1; padding: 7px 0; border-radius: 6px;
  border: none; background: #2e6b2e; color: #fff;
  font-size: 12px; font-weight: 700; cursor: pointer;
  font-family: inherit; transition: background .15s;
  margin: 0; line-height: 1.4;
}
.plc-wrap .plc-btn-next:hover    { background: #245824; }
.plc-wrap .plc-btn-next:disabled { background: #ccc; cursor: not-allowed; }

/* ── 結果エリア ── */
.plc-wrap .plc-result {
  display: none;
  padding: 12px 14px 14px;
  background: #fff;
}
.plc-wrap .plc-result.plc-visible {
  display: block;
}

/* メーター */
.plc-wrap .plc-meter-row {
  display: flex; align-items: center; gap: 12px; margin-bottom: 11px;
}
.plc-wrap .plc-meter-circle {
  position: relative; width: 72px; height: 72px; flex-shrink: 0;
}
.plc-wrap .plc-meter-circle svg { width: 72px; height: 72px; display: block; }
.plc-wrap .plc-meter-text {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.plc-wrap #plc-ring { transition: stroke-dashoffset 1s ease, stroke .4s; }
.plc-wrap .plc-meter-num  { font-size: 18px; font-weight: 700; color: #1a4a1a; line-height: 1; }
.plc-wrap .plc-meter-unit { font-size: 9px; color: #888; }
.plc-wrap .plc-level-pill {
  display: inline-block; padding: 3px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 700; color: #fff; margin-bottom: 4px;
}
.plc-wrap .plc-level-title { font-size: 12px; font-weight: 700; color: #1a4a1a; line-height: 1.4; }

/* カテゴリバー */
.plc-wrap .plc-category-bars { margin-bottom: 10px; }
.plc-wrap .plc-bar-row { display: flex; align-items: center; gap: 6px; margin-bottom: 5px; }
.plc-wrap .plc-bar-label { font-size: 10px; color: #555; width: 76px; flex-shrink: 0; }
.plc-wrap .plc-bar-track { flex: 1; height: 7px; background: #eee; border-radius: 4px; overflow: hidden; }
.plc-wrap .plc-bar { height: 100%; border-radius: 4px; width: 0; transition: width .9s ease; display: block; }
.plc-wrap .plc-bar--sleep  { background: #4361ee; }
.plc-wrap .plc-bar--stress { background: #8b2fc9; }
.plc-wrap .plc-bar-pct { font-size: 10px; color: #555; width: 28px; text-align: right; }

/* アドバイス */
.plc-wrap .plc-advice-box {
  background: #f6fbf1; border-left: 3px solid #2e6b2e;
  border-radius: 0 6px 6px 0; padding: 9px 11px; margin-bottom: 8px;
  transition: border-color .4s;
}
.plc-wrap .plc-advice-title { font-size: 12px; font-weight: 700; color: #1a4a1a; margin-bottom: 3px; display: block; }
.plc-wrap .plc-advice-body  { font-size: 11px; line-height: 1.65; color: #444; display: block; }
.plc-wrap .plc-pharmacist-box {
  background: #fffbea; border-left: 3px solid #f5c000;
  border-radius: 0 6px 6px 0; padding: 8px 11px; margin-bottom: 10px;
}
.plc-wrap .plc-pharmacist-label { font-size: 10px; font-weight: 700; color: #7a5c00; margin-bottom: 3px; display: block; }
.plc-wrap .plc-pharmacist-body  { font-size: 11px; line-height: 1.65; color: #5a4000; display: block; }

/* 再チェック */
.plc-wrap .plc-retry-btn {
  width: 100%; padding: 8px 0; border-radius: 6px;
  border: 1.5px solid #2e6b2e; background: #fff; color: #2e6b2e;
  font-size: 12px; font-weight: 700; cursor: pointer;
  font-family: inherit; transition: all .15s;
  margin: 0; display: block; line-height: 1.4;
}
.plc-wrap .plc-retry-btn:hover { background: #f0f8ee; }

/* 注記 */
.plc-wrap .plc-note {
  font-size: 10px; color: #bbb; text-align: center;
  padding: 5px 14px 8px; background: #fff;
  border-top: 1px solid #f0f0f0; display: block;
}
