/* ============================================================
   SG塾 総合型選抜 合格診断ツール

   先方支給の単一HTMLから抽出。配色・数値は変更禁止のため原則そのまま。
   LP埋め込みにあたり以下だけを変更している:
     - グローバルリセット `*` を .sg-app 配下にスコープ
     - 埋め込み時の中央寄せ・上下余白を .sg-embed で持たせた
     - エリア補足・注記の .sg-note を追加
   色は !important 固定（LP側CSSに上書きされないための支給元の意図）。
   ============================================================ */

.sg-app, .sg-app *, .sg-embed { box-sizing: border-box; margin: 0; padding: 0; }

/* 埋め込み用ラッパ（ツールは最大380px固定のため中央寄せはLP側で持つ） */
.sg-embed { display: block; padding: 32px 16px; }

.sg-app {
  font-family: 'Noto Sans JP', sans-serif;
  max-width: 380px;
  margin: 0 auto;
  background: #F4F6F8 !important;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #CBD5E1;
}

/* ヘッダー */
.sg-hd {
  background: #0B2C4D !important;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sg-hd .sg-lg { font-size: 14px; font-weight: 900; color: #FFFFFF !important; letter-spacing: .03em; }
.sg-hd .sg-lg small { display: block; font-size: 9px; color: #93C5FD !important; font-weight: 500; margin-top: 1px; }

/* 進捗バー */
.sg-prog { background: #0B2C4D !important; padding: 0 16px 11px; }
.sg-prog-l { display: flex; justify-content: space-between; margin-bottom: 5px; }
.sg-prog-l span { font-size: 10px; color: #93C5FD !important; font-weight: 700; }
.sg-prog-bar { height: 6px; background: rgba(255,255,255,.2); border-radius: 4px; overflow: hidden; }
.sg-prog-fill { height: 6px; background: #F0A03C !important; border-radius: 4px; width: 0; transition: .3s; }

/* 画面共通 */
.sg-scr { display: none; }
.sg-scr.on { display: block; }
/* min-height は描画前の領域確保。JSが中身を入れた瞬間にページ高さが変わると、
   CTAのアンカースクロールが途中で止まり、レイアウトシフトも起きるため */
.sg-stage { overflow-y: auto; max-height: 680px; min-height: 520px; }

/* FV */
.sg-fv-wrap { background: #0B2C4D !important; padding: 16px; }
.sg-fv { background: #0B2C4D !important; padding: 22px 18px; border-radius: 12px; text-align: center; }
.sg-fv-eye { display: inline-block; background: #F0A03C !important; color: #3A2400 !important; font-size: 11px; font-weight: 900; padding: 4px 14px; border-radius: 4px; margin-bottom: 14px; }
.sg-fv-h { font-size: 23px; font-weight: 900; color: #FFFFFF !important; line-height: 1.45; margin-bottom: 8px; }
.sg-fv-h .mk { color: #F0A03C !important; }
.sg-fv-sub { font-size: 12px; color: #CBD5E1 !important; margin-bottom: 16px; font-weight: 500; }
.sg-fv-pts { background: rgba(255,255,255,.07); border-radius: 10px; padding: 12px 14px; margin-bottom: 16px; text-align: left; }
.sg-fv-pt { display: flex; gap: 8px; align-items: center; padding: 4px 0; font-size: 12px; color: #FFFFFF !important; font-weight: 700; }
.sg-fv-pt i { color: #F0A03C !important; font-size: 16px; flex-shrink: 0; }
.sg-fv-stat { display: flex; gap: 8px; margin-bottom: 16px; }
.sg-fv-st { flex: 1; background: rgba(255,255,255,.09); border-radius: 8px; padding: 7px 4px; text-align: center; }
.sg-fv-st b { display: block; font-size: 14px; color: #FFFFFF !important; font-weight: 900; }
.sg-fv-st span { font-size: 9px; color: #93C5FD !important; }
.sg-fv-note { font-size: 10px; color: #93C5FD !important; margin-top: 12px; }

/* 設問画面 */
.sg-q-wrap { background: #F4F6F8 !important; padding: 16px; }
.sg-q-card { background: #0B2C4D !important; border-radius: 12px; padding: 15px 16px; margin-bottom: 14px; position: relative; }
.sg-q-card::after { content: ""; position: absolute; bottom: -9px; left: 26px; border: 10px solid transparent; border-top-color: #0B2C4D; border-bottom: none; }
.sg-q-tag { display: inline-block; background: #F0A03C !important; color: #3A2400 !important; font-size: 10px; font-weight: 900; border-radius: 4px; padding: 2px 9px; margin-bottom: 7px; }
.sg-q-txt { font-size: 17px; font-weight: 900; color: #FFFFFF !important; line-height: 1.5; }

/* 選択肢ボタン ※ LP側CSSで上書きしないこと */
.sg-opts { display: flex; flex-direction: column; gap: 9px; margin-top: 18px; }
.sg-opt {
  background: #FFFFFF !important;
  border: 2px solid #64748B !important;
  border-radius: 9px;
  padding: 13px 15px;
  font-size: 14px;
  font-weight: 700;
  color: #0B2C4D !important;
  cursor: pointer;
  font-family: 'Noto Sans JP', sans-serif;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: .12s;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.sg-opt:hover { border-color: #0B2C4D !important; background: #EEF3FA !important; }
.sg-opt.sel { border-color: #F0A03C !important; background: #FFF7EC !important; box-shadow: 0 0 0 2px #F0A03C; }
/* 右端の三角。文字やアイコンフォントに頼らずボーダーで描く（環境差で絵文字化しないため） */
.sg-opt .ch {
  color: #475569 !important;
  flex-shrink: 0;
  margin-left: 8px;
  width: 0; height: 0;
  border-left: 9px solid currentColor;
  border-top: 5.5px solid transparent;
  border-bottom: 5.5px solid transparent;
}
.sg-opt.sel .ch { color: #F0A03C !important; }

/* フィードバック */
.sg-fb { font-size: 12px; color: #6B3F00 !important; background: #FBE6CB !important; border: 1px solid #F0A03C; border-radius: 8px; padding: 10px 12px; margin-top: 12px; line-height: 1.6; display: none; }
.sg-fb.on { display: block; }

/* 次へボタン */
.sg-btn-n {
  width: 100%; background: #CBD5E1 !important; color: #64748B !important;
  border: none; border-radius: 9px; padding: 14px; font-size: 15px; font-weight: 900;
  font-family: 'Noto Sans JP', sans-serif; cursor: default; margin-top: 14px;
  pointer-events: none; display: flex; align-items: center; justify-content: center; gap: 6px; transition: .15s;
}
.sg-btn-n.on { pointer-events: auto; background: #F0A03C !important; color: #3A2400 !important; cursor: pointer; }

/* 戻るボタン */
.sg-btn-b {
  width: 100%; background: transparent !important; color: #64748B !important;
  border: none; border-radius: 9px; padding: 10px; font-size: 12px; font-weight: 700;
  font-family: 'Noto Sans JP', sans-serif; cursor: pointer; margin-top: 6px;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.sg-btn-b:hover { color: #0B2C4D !important; }

/* 開始ボタン */
.sg-btn-p {
  width: 100%; background: #F0A03C !important; color: #3A2400 !important;
  border: none; border-radius: 9px; padding: 16px; font-size: 16px; font-weight: 900;
  font-family: 'Noto Sans JP', sans-serif; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px;
}

/* 入力欄 */
.sg-txt-in {
  width: 100%; border: 2px solid #64748B; border-radius: 9px; padding: 13px 14px;
  font-size: 15px; font-family: 'Noto Sans JP', sans-serif; margin-bottom: 10px;
  color: #0B2C4D !important; background: #FFFFFF !important;
}
.sg-txt-in::placeholder { color: #94A3B8; }
.sg-txt-in:focus { outline: none; border-color: #0B2C4D; }
/* datalist 付き input に Chrome が出す▼を消す。
   自由入力できる欄なのにプルダウンに見えてしまうため（候補は入力を始めれば出る） */
.sg-txt-in::-webkit-calendar-picker-indicator { display: none !important; }
.sg-sel-in {
  width: 100%; border: 2px solid #64748B; border-radius: 9px; padding: 13px 14px;
  font-size: 15px; font-family: 'Noto Sans JP', sans-serif;
  background: #FFFFFF !important; color: #0B2C4D !important;
}

/* 補足・注記 */
.sg-note { font-size: 11px; color: #64748B !important; line-height: 1.6; margin-top: 8px; }
.sg-note-warn { color: #92400E !important; background: #FEF3C7 !important; border-radius: 6px; padding: 8px 10px; }

/* ローディング */
.sg-load { text-align: center; padding: 70px 20px; background: #F4F6F8 !important; }
.sg-ring { width: 52px; height: 52px; border: 6px solid #CBD5E1; border-top-color: #F0A03C; border-radius: 50%; margin: 0 auto; animation: sgSpin 1s linear infinite; }
@keyframes sgSpin { to { transform: rotate(360deg); } }
.sg-load-t { font-size: 13px; color: #0B2C4D !important; margin-top: 16px; font-weight: 900; }

/* 結果ヒーロー */
.sg-res-wrap { background: #F4F6F8 !important; padding: 16px; }
.sg-hero { background: #0B2C4D !important; padding: 24px 18px 22px; text-align: center; border-radius: 12px; margin-bottom: 14px; }
.sg-hero-eye { display: inline-block; background: #F0A03C !important; color: #3A2400 !important; font-size: 11px; font-weight: 900; padding: 4px 16px; border-radius: 4px; margin-bottom: 16px; }
.sg-rank-box { background: #FFFFFF !important; border-radius: 12px; padding: 16px 14px; margin-bottom: 14px; }
.sg-rank-row { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 8px; }
.sg-rank-letter { font-family: 'Bebas Neue', sans-serif; font-size: 80px; line-height: .8; color: #0B2C4D !important; }
.sg-rank-meta .rl { font-size: 11px; color: #64748B !important; font-weight: 700; margin-bottom: 2px; }
.sg-rank-meta .rj { font-size: 15px; color: #0B2C4D !important; font-weight: 900; }
.sg-pct-wrap { border-top: 1px dashed #CBD5E1; padding-top: 10px; }
.sg-pct-label { font-size: 11px; color: #64748B !important; font-weight: 700; margin-bottom: 4px; }
.sg-pct-num { font-size: 34px; font-weight: 900; color: #D97706 !important; line-height: 1; }
.sg-pct-num small { font-size: 16px; }
.sg-pct-bar-bg { height: 8px; background: #E2E8F0 !important; border-radius: 5px; margin-top: 8px; overflow: hidden; }
.sg-pct-bar-fill { height: 8px; background: #F0A03C !important; border-radius: 5px; }
.sg-hero-h { font-size: 16px; font-weight: 900; color: #FFFFFF !important; line-height: 1.5; margin-bottom: 8px; }
.sg-hero-h .mk { color: #F0A03C !important; }
.sg-hero-p { font-size: 12px; color: #CBD5E1 !important; line-height: 1.85; text-align: left; }

/* セクション */
.sg-sec { background: #FFFFFF !important; border-radius: 12px; border: 1px solid #E2E8F0; padding: 15px; margin-bottom: 14px; }
.sg-sec-ttl { font-size: 13px; font-weight: 900; color: #0B2C4D !important; margin-bottom: 13px; border-left: 4px solid #F0A03C; padding-left: 9px; }

/* 4指標 */
.sg-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sg-metric { background: #F1F5F9 !important; border-radius: 9px; padding: 10px 12px; }
.sg-metric-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.sg-metric-label { font-size: 12px; color: #1E293B !important; font-weight: 700; }
.sg-metric-tag { font-size: 10px; font-weight: 900; padding: 2px 8px; border-radius: 4px; }
.sg-tag-strong { background: #0B2C4D !important; color: #FFFFFF !important; }
.sg-tag-mid { background: #BFDBFE !important; color: #1E3A5F !important; }
.sg-tag-grow { background: #FDE68A !important; color: #92400E !important; }
.sg-metric-bar-bg { height: 7px; background: #CBD5E1 !important; border-radius: 4px; overflow: hidden; }
.sg-metric-bar-fill { height: 7px; border-radius: 4px; }

/* 大学カード */
.sg-univ-card { border: 1px solid #E2E8F0; border-radius: 9px; padding: 12px; margin-bottom: 9px; background: #FFFFFF !important; }
.sg-univ-card.first { border: 2px solid #0B2C4D !important; background: #F0F6FF !important; }
.sg-univ-top { display: flex; justify-content: space-between; align-items: flex-start; }
.sg-univ-name { font-size: 14px; font-weight: 900; color: #0B2C4D !important; }
.sg-univ-sub { font-size: 10px; color: #64748B !important; margin-top: 2px; font-weight: 500; }
.sg-badge-rate { font-size: 11px; font-weight: 900; border-radius: 4px; padding: 3px 9px; white-space: nowrap; flex-shrink: 0; margin-left: 8px; }
.sg-badge-low { background: #D1FAE5 !important; color: #065F46 !important; }
.sg-badge-mid { background: #FEF3C7 !important; color: #92400E !important; }
.sg-badge-hi  { background: #FEE2E2 !important; color: #991B1B !important; }
.sg-jisseki { font-size: 11px; font-weight: 900; color: #FFFFFF !important; background: #D97706 !important; border-radius: 5px; padding: 6px 10px; margin-top: 9px; display: flex; align-items: center; gap: 6px; }

/* 対策 */
.sg-tactic { display: flex; gap: 11px; padding: 10px 0; border-bottom: 1px solid #F1F5F9; align-items: flex-start; }
.sg-tactic:last-child { border-bottom: none; padding-bottom: 0; }
.sg-tactic:first-child { padding-top: 0; }
.sg-tactic-n { background: #0B2C4D !important; color: #FFFFFF !important; width: 24px; height: 24px; border-radius: 6px; font-size: 12px; font-weight: 900; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.sg-tactic-t { font-size: 12px; color: #1E293B !important; line-height: 1.65; }
.sg-tactic-t b { font-weight: 900; color: #0B2C4D !important; }
.sg-tactic.highlight { background: #FFF7EC !important; border: 1px solid #F0A03C; border-radius: 9px; padding: 10px; margin-top: 4px; }
.sg-tactic.highlight .sg-tactic-n { background: #F0A03C !important; color: #3A2400 !important; }

/* 専門家カード */
.sg-expert-head  { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.sg-expert-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid #F0A03C; flex-shrink: 0; display: block; }
.sg-expert-name  { font-size: 14px; font-weight: 900; color: #0B2C4D !important; }
.sg-expert-title { font-size: 11px; color: #64748B !important; margin-top: 2px; line-height: 1.5; }
.sg-expert-badges { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0; }
.sg-expert-badge { font-size: 10px; background: #F1F5F9 !important; color: #0B2C4D !important; border: 1px solid #CBD5E1; border-radius: 4px; padding: 3px 9px; font-weight: 700; }
.sg-expert-desc { font-size: 11px; color: #1E293B !important; line-height: 1.8; }

/* 予約 */
.sg-cal { background: #FFFFFF !important; border: 2px solid #0B2C4D; border-radius: 12px; padding: 16px; margin-bottom: 8px; }
.sg-cal-banner { text-align: center; margin-bottom: 11px; }
.sg-cal-banner span { display: inline-block; background: #DC2626 !important; color: #FFFFFF !important; font-size: 11px; font-weight: 900; padding: 4px 16px; border-radius: 4px; }
.sg-cal-ttl { font-size: 16px; font-weight: 900; color: #0B2C4D !important; text-align: center; margin-bottom: 4px; }
.sg-cal-sub { font-size: 11px; color: #64748B !important; text-align: center; margin-bottom: 13px; }
/* 予約システムの埋め込み枠（iframe型のツールを選定した場合に使う） */
.sg-cal-embed { width: 100%; min-height: 520px; border: 0; display: block; }

/* CTAボタン */
.sg-btn-cta {
  width: 100%; background: #F0A03C !important; color: #3A2400 !important;
  border: none; border-radius: 9px; padding: 16px; font-size: 16px; font-weight: 900;
  font-family: 'Noto Sans JP', sans-serif; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none !important;
}
.sg-foot-note { font-size: 10px; color: #94A3B8 !important; text-align: center; padding: 5px 0 8px; }
.sg-reset { font-size: 10px; color: #94A3B8 !important; text-align: center; text-decoration: underline; padding-bottom: 10px; cursor: pointer; }
