/* ===== WordPressテーマとの競合を防ぐためすべて #yd-root でスコープ ===== */
#yd-root *, #yd-root *::before, #yd-root *::after {
  box-sizing: border-box; margin: 0; padding: 0;
}
#yd-root {
  font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', sans-serif;
  color: #333;
  max-width: 580px;
  margin: 0 auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0,0,0,.10);
  overflow: hidden;
}

/* ヘッダー */
#yd-root .yd-header {
  background: linear-gradient(135deg, #1a6fc4 0%, #0d4f91 100%);
  color: #fff;
  padding: 20px 24px 16px;
}
#yd-root .yd-header h2 {
  font-size: 17px;
  font-weight: bold;
  margin-bottom: 4px;
  line-height: 1.4;
}
#yd-root .yd-header p {
  font-size: 13px;
  opacity: .85;
}

/* プログレスバー */
#yd-root .yd-progress {
  padding: 16px 24px 0;
}
#yd-root .yd-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 12px;
}
#yd-root .yd-back-btn {
  font-size: 12px;
  color: #1a6fc4;
  background: none;
  border: none;
  cursor: pointer;
  font-weight: bold;
  padding: 0;
  transition: color .18s;
}
#yd-root .yd-back-btn:hover {
  color: #155aa0;
}
#yd-root .yd-progress-label {
  font-size: 12px;
  color: #888;
  text-align: right;
  flex: 1;
}
#yd-root .yd-bar-bg {
  height: 6px;
  background: #e8ecf0;
  border-radius: 99px;
  overflow: hidden;
}
#yd-root .yd-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #1a6fc4, #42a0f5);
  border-radius: 99px;
  transition: width .4s ease;
  width: 25%;
}

/* フォーム */
#yd-root .yd-form {
  display: flex;
  flex-direction: column;
}

/* 質問 */
#yd-root .yd-q-area {
  padding: 22px 24px 6px;
}
#yd-root .yd-q-num {
  font-size: 12px;
  color: #1a6fc4;
  font-weight: bold;
  margin-bottom: 6px;
  letter-spacing: .05em;
}
#yd-root .yd-q-text {
  font-size: 17px;
  font-weight: bold;
  line-height: 1.5;
}

/* 選択肢 */
#yd-root .yd-choices {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 16px 24px 24px;
}
#yd-root .yd-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border: 2px solid #dde3ea;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  text-align: left;
  transition: all .18s;
  line-height: 1.4;
  width: 100%;
}
#yd-root .yd-choice:hover {
  border-color: #1a6fc4;
  background: #f0f6ff;
}
#yd-root .yd-choice input {
  cursor: pointer;
  accent-color: #1a6fc4;
}
#yd-root .yd-choice span {
  color: #333;
}

/* 次へボタン */
#yd-root .yd-next-wrap {
  padding: 12px 24px 24px;
}
#yd-root .yd-submit-btn {
  width: 100%;
  padding: 13px;
  background: #1a6fc4;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition: background .18s;
}
#yd-root .yd-submit-btn:hover { background: #155aa0; }
#yd-root .yd-submit-btn:disabled {
  background: #b0c4d8;
  cursor: not-allowed;
}

/* 結果 */
#yd-root .yd-result {
  padding: 24px;
  display: none;
}
#yd-root .yd-result-title {
  font-size: 16px;
  font-weight: bold;
  color: #1a6fc4;
  margin-bottom: 4px;
}
#yd-root .yd-result-sub {
  font-size: 13px;
  color: #666;
  margin-bottom: 18px;
  line-height: 1.6;
}

/* パーセンテージ表示 */
#yd-root .yd-percentage-container {
  text-align: center;
  margin-bottom: 24px;
  padding: 24px;
  background: #f5f7fa;
  border-radius: 10px;
}
#yd-root .yd-percentage {
  font-size: 56px;
  font-weight: bold;
  line-height: 1;
  margin-bottom: 12px;
}
#yd-root .yd-percentage.risk-low {
  color: #27ae60;
}
#yd-root .yd-percentage.risk-medium {
  color: #f39c12;
}
#yd-root .yd-percentage.risk-high {
  color: #e74c3c;
}
#yd-root .yd-percentage.risk-critical {
  color: #c0392b;
}

/* チェックリスト */
#yd-root .yd-checklist {
  margin-bottom: 24px;
}
#yd-root .yd-checklist h4,
#yd-root .yd-advice h4,
#yd-root .yd-offices h4 {
  font-size: 12px;
  font-weight: bold;
  color: #1a6fc4;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
#yd-root .yd-checklist ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
#yd-root .yd-checklist li {
  padding: 8px 0;
  font-size: 13px;
  color: #555;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
}
#yd-root .yd-checklist li:before {
  content: "✓";
  color: #1a6fc4;
  font-weight: bold;
  flex-shrink: 0;
}

/* アドバイス */
#yd-root .yd-advice {
  margin-bottom: 24px;
  padding: 16px;
  background: #fffbf0;
  border-left: 4px solid #f0a500;
  border-radius: 6px;
}
#yd-root .yd-advice p {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
  color: #555;
}

/* 事務所カード */
#yd-root .yd-offices {
  margin-bottom: 24px;
}
#yd-root .yd-office-list {
  display: flex !important;
  gap: 20px !important;
  flex-wrap: wrap !important;
}
#yd-root .yd-office-card {
  border: 1px solid #dde3ea !important;
  border-radius: 10px !important;
  padding: 16px !important;
  position: relative !important;
  width: calc(50% - 10px) !important;
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 calc(50% - 10px) !important;
  min-width: 200px !important;
}
#yd-root .yd-office-desc {
  flex-grow: 1 !important;
  margin: 0 0 12px 0 !important;
}
#yd-root .yd-office-card:first-of-type {
  border-color: #f0a500;
  background: #fffbf0;
}
#yd-root .yd-badge {
  position: absolute;
  top: -1px;
  left: 16px;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 10px;
  border-radius: 0 0 6px 6px;
  color: #fff;
}
#yd-root .yd-office-card:first-of-type .yd-badge { background: #f0a500; }
#yd-root .yd-office-card:not(:first-of-type) .yd-badge { background: #8d9baa; }
#yd-root .yd-office-card h5 {
  font-size: 14px;
  font-weight: bold;
  margin: 16px 0 8px;
  color: #333;
}
#yd-root .yd-office-desc {
  font-size: 12px;
  color: #666;
  margin: 0 0 12px 0;
  line-height: 1.5;
}
#yd-root .yd-consult-btn {
  display: block;
  text-align: center;
  background: #1a6fc4;
  color: #fff;
  text-decoration: none;
  padding: 11px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  border: none;
  width: 100%;
  transition: background .18s;
}
#yd-root .yd-consult-btn:hover { background: #155aa0; }

/* リスタートボタン */
#yd-root .yd-restart-btn {
  display: block;
  text-align: center;
  background: none;
  border: 1px solid #ccc;
  color: #666;
  padding: 10px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  width: 100%;
  margin-top: 6px;
  transition: all .18s;
}
#yd-root .yd-restart-btn:hover { background: #f4f6f9; }

/* スマートフォン対応 */
@media (max-width: 600px) {
  #yd-root {
    border-radius: 0;
    box-shadow: none;
  }
  #yd-root .yd-office-list {
    flex-direction: column !important;
  }
  #yd-root .yd-office-card {
    width: 100% !important;
    flex: 1 1 100% !important;
    min-width: 100% !important;
  }
}
