/* 参加者向け画面(ベージュ基調・スマホ最適化) */
:root {
  --bg: #dbd0c7;
  --panel: #f2eee8;
  --card: #ffffff;
  --text: #5b4f47;
  --muted: #948a80;
  --accent: #d9414e;
  --accent-dark: #c53844;
  --dark: #4a423c;
  --line: #e3ddd4;
  --blue: #6e9bc0;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--panel);
  display: flex;
  flex-direction: column;
}

.app-header {
  background: #fff;
  padding: 14px 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

.app-header .logo { height: 26px; display: block; }

.app-main { flex: 1; padding-bottom: 48px; }

.page-title {
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  padding: 22px 16px 4px;
  letter-spacing: .06em;
}

.section { padding: 16px; }

.card {
  background: var(--card);
  border-radius: 10px;
  padding: 20px 18px;
  margin: 12px 16px 30px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,.05);
}
/* おまけ的な内容のカード。白背景を外して地色に溶かし、本編のカードと差別化する。
   左右の padding は残して、上のカードと文字位置を揃える */
.card.card-plain {
  background: transparent;
  box-shadow: none;
  padding-top: 8px;
}

/* 診断ページ(設問)だけ設問エリアを白地にし、進捗バーの地色は反転させて薄い地色にする */
.main-questions { background: #fff; }
.main-questions .progress { background: var(--panel); }

/* 進捗バー */
.progress-wrap { padding: 14px 16px 0; }
.progress {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  position: relative;
  height: 26px;
  overflow: hidden;
}
.progress .bar {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--blue);
  border-radius: 5px 0 0 5px;
}
.progress .label {
  position: relative;
  display: block;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 26px;
}

/* 設問 */
.q-title {
  background: var(--dark);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border-radius: 6px;
  padding: 10px 14px;
  margin: 16px 16px 6px;
}
.q-item { padding: 14px 18px 4px; }
.q-item .q-text { font-size: 15px; font-weight: 700; margin-bottom: 8px; }

.rank-choices { display: flex; justify-content: space-between; align-items: center; padding: 0 4px 8px; }
.rank-btn {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: none;
  background: #efece6;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.08);
  color: #a99f95;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.rank-btn.selected { background: var(--accent); color: #fff; }

.scale-row { display: flex; justify-content: space-between; padding: 4px 0 10px; }
.scale-opt { flex: 1; text-align: center; cursor: pointer; }
.scale-opt input { display: none; }
.scale-opt .dot {
  display: block;
  width: 44px; height: 44px;
  margin: 0 auto 6px;
  border-radius: 50%;
  background: #efece6;
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.08);
}
.scale-opt input:checked + .dot { background: var(--accent); }
.scale-opt .scale-label { font-size: 10px; color: var(--text); line-height: 1.4; display: block; }

/* ボタン */
.btn {
  display: block;
  width: calc(100% - 32px);
  margin: 18px 16px 8px;
  padding: 14px;
  border: none;
  border-radius: 28px;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:active { background: var(--accent-dark); }
.btn-dark { background: var(--dark); color: #fff; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--muted); }

.back-link {
  display: block;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  background: #eceae4;
}

/* フォーム */
.input {
  width: 100%;
  padding: 13px 14px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
}
.input:focus { outline: 2px solid var(--blue); border-color: transparent; }
.field-label { font-size: 14px; font-weight: 700; margin-bottom: 6px; display: block; }

.error {
  background: #fbeaec;
  color: var(--accent-dark);
  border-radius: 8px;
  font-size: 13px;
  padding: 10px 14px;
  margin: 10px 16px 0;
}

.note { font-size: 13px; color: var(--muted); }

/* 手順ページ */
.intro-hero { text-align: center; padding: 8px 16px 0; }
.intro-hero-img { width: 100%; max-width: 340px; height: auto; margin: 0 auto; display: block; }
.intro-examples { padding: 12px 16px; display: flex; flex-direction: column; gap: 18px; }
.intro-example-img { width: 100%; height: auto; display: block; }
.intro-section-title {
  background: linear-gradient(180deg, #fbfaf8, #efece6);
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  padding: 12px;
  border-radius: 8px 8px 0 0;
  border-bottom: 1px solid var(--line);
}
.intro-example {
  background: #f7f5f1;
  border-radius: 8px;
  padding: 14px;
  margin-top: 12px;
}
.intro-example .ex-q {
  background: var(--dark);
  color: #fff;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 12px;
  margin-bottom: 10px;
}
.demo-dots { display: flex; gap: 12px; margin: 6px 0 10px; }
.demo-dot {
  width: 40px; height: 40px; border-radius: 50%;
  background: #ece8e2;
  color: #a99f95;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.demo-dot.on { background: var(--accent); color: #fff; }
.demo-label { font-size: 10px; color: var(--muted); text-align: center; width: 52px; line-height: 1.3; }
.demo-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }

/* 結果ページ */
.result-eyebrow {
  text-align: right;
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--muted);
  padding: 14px 20px 0;
}
.result-eyebrow strong { font-size: 13px; color: var(--text); }
.type-name { font-size: 30px; font-weight: 800; letter-spacing: .02em; }
.type-sub { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.element-bar { display: none; height: 22px; border-radius: 4px; overflow: hidden; margin: 10px 0 4px; }
.element-bar span { display: block; height: 100%; }
.element-bar-legend { display: flex; font-size: 10px; color: var(--muted); gap: 10px; flex-wrap: wrap; }
.type-desc { font-size: 13.5px; margin-top: 12px; }
.tags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 11px;
  padding: 2px 8px;
  color: var(--muted);
  background: #faf9f6;
}

.result-h2 { text-align: center; font-size: 16px; font-weight: 700; padding: 22px 16px 2px; }
.result-h2-main {
  font-size: 17px;
  letter-spacing: .04em;
  position: relative;
}
.result-h2-main::before { content: "\25CF"; color: var(--accent); font-size: 11px; margin-right: 8px; vertical-align: 2px; }
.chart-img { width: 100%; height: auto; display: block; }

.headline { font-size: 15px; font-weight: 700; line-height: 1.6; }

/* カード左上の見出し */
.card-heading {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: .02em;
  padding-left: 10px;
  border-left: 4px solid var(--accent);
  margin-bottom: 14px;
}

/* 帯グラフの下の「D 28.4% > A 24.7% > …」凡例 */
.order-legend {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px 2px;
  /* 4要素を1行に収めるため、カードの左右パディングに少しはみ出させる */
  margin: 10px -10px 2px;
}
.order-item {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  padding: 2px 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
.order-item strong { font-weight: 800; }
.order-sep { color: #b9b0a5; font-weight: 700; font-size: 11px; }

/* 構成比の並びの直下に置く「〇〇さんは A・B 要素に対する感度が強い人です」の一文。
   箱はガイドラインの赤枠(.guideline-box)を併用し、余白だけ上書きする */
.guideline-box.balance-headline { margin: 22px 0; }
.balance-headline .guideline-text { font-size: 14px; }

/* ガイドライン強調(太字大きめ＋ハイライト) */
.guideline-lead { font-size: 16px; font-weight: 700; line-height: 1.7; }
.gl-hl {
  background: linear-gradient(transparent 55%, #ffe08a 55%);
  font-weight: 700;
  padding: 0 1px;
}

/* 要素ごとのタブ(感覚・行動リスト) */
.elem-tab-btns { display: flex; gap: 6px; margin-bottom: 14px; }
/* スマートフォン(500px以下)では2カラム(上段A・B/下段C・D)にする。
   タブが約2倍幅になるぶん、重ねる構成比の文字も比率を保つよう大きくする */
@media (max-width: 500px) {
  .elem-tab-btns { display: grid; grid-template-columns: 1fr 1fr; }
}
/* タブは要素ごとの1枚絵(type_a〜type_d.svg)。ボタン自身の装飾は持たせない。
   選択時に出す上ボーダーでレイアウトが跳ねないよう、透明ボーダーを常に敷いておく */
.elem-tab-btn {
  flex: 1;
  border: none;
  border-top: 4px solid transparent;
  background: none;
  padding: 4px 0 0;
  cursor: pointer;
  font-family: inherit;
}
/* 選択中(パネルを開いている)タブは要素と同系色の上ボーダーで示す */
.elem-tab-btn.is-selected { border-top-color: var(--elem-color, var(--accent)); }
/* 感度が強くない要素のタブも、選択中はその要素のごく薄い地色を敷いて分かりやすくする。
   絵はグレーのままにして、強い要素(色付きの絵)との差は明確に残す */
.elem-tab-btn:not(.active).is-selected .elem-tab-figure {
  background: var(--elem-tint, transparent);
  background: color-mix(in srgb, var(--elem-tint, transparent) 55%, #fff);
}
.elem-tab-figure { position: relative; display: block; }
.elem-tab-img {
  display: block;
  width: 100%;
  height: auto;
}
/* タブのキャラクターに重ねる構成比。①の位置づけ図(.balance-pct)と同じ体裁の縮小版 */
.elem-tab-pct {
  position: absolute;
  left: 50%;
  /* キャラクターの胴体に重なる位置。「31.2%」のような小数付きでもタブ幅に収まる大きさにしている */
  top: 74%;
  transform: translate(-50%, -50%);
  font-size: 7.5px;
  font-weight: 800;
  line-height: 1.2;
  color: #40382f;
  -webkit-text-stroke: 2.5px #fff;
  paint-order: stroke fill;
  white-space: nowrap;
}
.elem-tab-pct-num { font-size: 18px; }
/* SP(2カラム表示)ではタブが大きくなるぶん構成比も大きくする。
   基底ルールと同詳細度のため、必ずこの位置(基底より後)に置くこと */
@media (max-width: 500px) {
  .elem-tab-pct { font-size: 15px; -webkit-text-stroke: 3.5px #fff; }
  .elem-tab-pct-num { font-size: 28px; }
}
/* 選択されていないタブは色を落として薄いグレーにする */
.elem-tab-btn:not(.active) .elem-tab-img { filter: grayscale(1) opacity(.45); }
.elem-tab-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}
.elem-panel.is-hidden { display: none; }

/* Tips_02: 9領域のタブ(3列)。地色はbladeで領域色を白と混ぜて指定する */
.domain-tab-btns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 14px;
}
.domain-tab-btn {
  border: none;
  border-top: 4px solid transparent;
  border-radius: 8px;
  padding: 8px 6px 0;
  cursor: pointer;
  font-family: inherit;
  overflow: hidden;
  background: var(--domain-bg, #f3ede4);
}
.domain-tab-btn.is-selected { border-top-color: var(--domain-color, var(--accent)); }
/* 伸びしろTOP3(active)以外は要素タブと同じ仕様でグレーにする */
.domain-tab-btn:not(.active) { background: #eceae4; }
.domain-tab-btn:not(.active) .domain-tab-img,
.domain-tab-btn:not(.active) .domain-tab-name { filter: grayscale(1) opacity(.5); }
/* グレーのタブも選択中はごく薄い領域色を敷く(絵はグレーのままにして、TOP3との差は残す) */
.domain-tab-btn:not(.active).is-selected {
  background: var(--domain-bg, #eceae4);
  background: color-mix(in srgb, var(--domain-bg, #eceae4) 55%, #fff);
}
.domain-tab-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.domain-tab-name {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}
.domain-tab-img { display: block; width: 100%; height: auto; }
/* パネルは要素タブと同じく背景なしで、チップに領域の薄い色を付ける。
   タップできないチップなので、Tips_01と違い枠線・影は付けない */
.domain-panel.is-hidden { display: none; }
.domain-panel .kw-chip { background: var(--domain-tint, #f3ede4); }

/* 「結果をメールで送る」は画面下に固定の全幅ボタンにする */
.mail-fixed-spacer { height: 72px; }
#mail-open-btn {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  width: 100%;
  margin: 0;
  border-radius: 0;
  padding: 16px 14px calc(16px + env(safe-area-inset-bottom));
}

/* 4つの感度の解説(見出しタップで開閉するアコーディオン) */
.sense-list { margin-top: 14px; }
.sense-row + .sense-row { border-top: 1px solid var(--line); }
/* 自分の強い要素の行は要素色(--sense-tint)の背景で目立たせる。
   区切り線は背景の角丸と重なって見えるため、行の上下とも消す */
.sense-row.sense-strong {
  background: var(--sense-tint, #faf3ee);
  border-radius: 10px;
  padding: 0 10px;
  margin: 4px -10px;
}
.sense-row.sense-strong,
.sense-row.sense-strong + .sense-row { border-top-color: transparent; }
.sense-head {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  cursor: pointer;
  /* 既定の三角マーカーを消す(list-style は Firefox 用) */
  list-style: none;
}
.sense-head::-webkit-details-marker { display: none; }
.sense-badge {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  display: flex; align-items: center; justify-content: center;
}
.sense-name { font-size: 20px; font-weight: 700; flex: 1; }
/* 構成比の数値だけ大きくする。「%」は12pxのまま(.balance-pct-num と同じ方式) */
.sense-pct-num { font-size: 1.5em; }
/* 開閉を示す▼。開いているときは180度回して▲にする */
.sense-toggle {
  flex-shrink: 0;
  width: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  line-height: 1;
  transition: transform .2s;
}
.sense-toggle::before { content: "\25BC"; }
.sense-row[open] .sense-toggle { transform: rotate(180deg); }
.sense-desc {
  font-size: 12.5px;
  color: #555;
  line-height: 1.6;
  padding: 0 0 12px 0px;
}

/* ガイドラインの強調枠 */
.guideline-box {
  background: #faf3ee;
  border: 1.5px solid var(--accent);
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 16px;
}
/* ガイドライン枠の上に置く見出し(カード見出しより一段小さい) */
.guideline-heading {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  margin-top: 18px;
  padding-left: 9px;
  border-left: 4px solid var(--accent);
}
.guideline-heading + .guideline-box { margin-top: 8px; }
/* 枠線なし版のガイドライン文。.guideline-box から border だけ除いた背景色のみのスタイル */
.guideline-plain {
  background: #faf3ee;
  border-radius: 10px;
  padding: 14px 16px;
  margin-top: 34px;
  margin-bottom: 40px;
}
.guideline-label {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  padding: 2px 10px;
  margin-bottom: 8px;
}
.guideline-text { font-size: 15px; font-weight: 700; line-height: 1.6; }
.guideline-note { font-size: 12px; color: #555; margin-top: 6px; line-height: 1.7; }

/* タイプ解説の場面別ブロック・しあわせの増やし方 */
.scene-block { margin-top: 14px; }
/* 見出しの上に置く挿絵。中央揃えで、カード幅を超えないようにする */
.scene-img {
  display: block;
  width: 100%;
  max-width: 196px;
  height: auto;
  margin: 1rem auto;
}
/* 横長で小さく見える挿絵だけ大きく表示する(lg=10%増、xl=20%増) */
.scene-img-lg { max-width: 216px; }
.scene-img-xl { max-width: 235px; }
.scene-title {
  font-size: 13px;
  font-weight: 700;
  border-left: 4px solid var(--accent);
  padding-left: 8px;
  margin-bottom: 6px;
}
/* タイプ解説の「仕事の場面では」「日常の場面では」はカード見出し(.card-heading)と同じ大きさにする */
.scene-block .scene-title { font-size: 16px; }
.scene-text { font-size: 13px; line-height: 1.8; }
.howto-block { margin-top: 14px; }
.kw-chip {
  display: inline-block;
  background: #f3ede4;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 700;
  padding: 9px 14px;
  color: var(--text);
  /* 長い話題(Tips_02の質問文など)が折り返したとき、2行目以降が中央寄せにならないようにする */
  text-align: left;
}
button.kw-badge {
  border: none;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
}
/* チップは地色(.card-plain の上)と同系色になるため、枠線を付けて押せることを分かるようにする。
   地色は要素タブの絵と同じ色味(--elem-tint / .elem-panel で指定)。
   button.kw-badge の border: none を打ち消すので、この宣言より後に置くこと */
button.kw-chip {
  background: var(--elem-tint, #fff);
  border: 1px solid #cfc4b5;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
button.kw-badge:active { transform: scale(.95); }
button.kw-badge:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 感覚キーワードのlightboxカード */
.kw-card {
  position: relative;
  background: #fff;
  border-radius: 14px;
  padding: 28px 22px 24px;
  width: min(100%, 360px);
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
}
.kw-card-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px; height: 34px;
  border: none;
  background: #f3ede4;
  border-radius: 50%;
  font-size: 14px;
  color: var(--muted);
  cursor: pointer;
}
.kw-card-title {
  display: inline-block;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  border-radius: 6px;
  padding: 4px 22px;
  letter-spacing: .1em;
  /* ボックス自体はカードの text-align:center で中央に置かれる。
     折り返す長いタイトル(Tips_02の質問文など)の2行目以降が中央寄せにならないよう、文字は左寄せにする */
  text-align: left;
}
/* 例のカード(複数ある場合は左右の矢印で切り替える) */
.kw-card-ex { width: 100%; max-width: 400px; padding: 28px 14px 18px; }
.ex-slider {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
}
.kw-card-example {
  font-size: 15px;
  line-height: 1.9;
  text-align: left;
  background: #f9f7f3;
  border-radius: 10px;
  padding: 14px 16px;
  /* 例文の長短でカードの高さが跳ねないように3行分を確保する */
  min-height: calc(1.9em * 3 + 28px);
}
/* 例文末尾の「（20代女性・若手社員）」は改行して右寄せ・小さめに */
.ex-attr {
  display: block;
  text-align: right;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 4px;
}
.ex-attr:empty { display: none; }
.ex-nav {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--muted);
  border-radius: 50%;
  background: #fff;
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.ex-nav:active { background: #f3ede4; }
.ex-nav[hidden] { display: none; }
.ex-steps { display: flex; justify-content: center; gap: 2px; margin-top: 10px; }
.ex-steps[hidden] { display: none; }
.ex-step {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
}
.ex-step::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
/* 現在位置は色だけでなく大きさでも区別する(下の「n / m」表記も併用) */
.ex-step.is-current::before {
  width: 11px;
  height: 11px;
  background: var(--accent);
}
.ex-count { font-size: 14px; color: var(--text); margin-top: 2px; letter-spacing: .08em; }
.ex-count[hidden] { display: none; }
.ex-nav:focus-visible,
.ex-step:focus-visible,
.kw-card-close:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* 行動リストは感覚リストと同じ .kw-chip を使う(専用スタイルは持たせない) */

.top3-box {
  background: #f3ede4;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.top3-label { font-size: 12px; font-weight: 800; margin-right: 4px; }

/* 領域ランキング */
.rank-list { display: flex; flex-direction: column; gap: 6px; }
.rank-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f6f3f0;
  border-radius: 10px;
  overflow: hidden;
  /* 左端の順位ブロックを行の高さいっぱいに密着させるため、左の padding は 0 */
  padding: 0 10px 0 0;
  min-height: 42px;
  font-size: 12px;
}
/* 順位ブロック以外(領域タブ・関心度/達成度・差分)。
   関心度・達成度は4〜20なので2桁×2桁になり得る。
   入りきらないときは「差分」だけを折り返し、はみ出さないようにする */
.rank-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  padding: 6px 0;
}
/* 上位3件は順位ブロックを赤・行背景を淡いピンクにして強調する */
.rank-row.rank-hot { background: #fdefec; }
.rank-row.rank-hot .rank-no { background: #f25c5c; }
.rank-no {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  flex-shrink: 0;
  background: #8f8f8f;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
}
.rank-domain {
  /* 「+」をラベルと縦中央で揃えるため flex にする(ベースライン揃えだと下寄りに見える) */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #fff;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  flex-shrink: 0;
  min-width: 54px;
}
.rank-vals { color: var(--muted); flex: 1; white-space: nowrap; }
.rank-gap { font-weight: 700; flex-shrink: 0; margin-left: auto; }

/* ランキングの説明文。.guideline-note と同じ大きさに揃える。rank-list の上に置く */
.rank-desc {
  font-size: 11px;
  font-weight: normal;
  color: #555;
  margin-bottom: 10px;
}

/* rank-list 直下の領域タブの操作説明。文中に見本のタブ(押せる)を挟む */
.rank-tap-note {
  font-size: 11px;
  font-weight: normal;
  color: #555;
  margin-top: 8px;
}
.rank-tap-note .rank-domain { margin-right: 3px; }

/* 領域バッジ(クリックでlightbox) */
button.domain-badge {
  border: none;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(0,0,0,.15);
}
button.domain-badge:active { transform: scale(.96); }

/* 領域説明のlightbox */
.lightbox { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 14px; }
.lightbox[hidden] { display: none; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(40, 33, 28, .55); }
/* body に zoom が掛かるため vw / vh は使わない(vw × zoom で画面からはみ出す)。
   親の .lightbox は inset: 0 で画面いっぱいなので、% で指定すれば zoom に追従する。
   文字サイズ「大」＋小さい端末では中身が入りきらないため、はみ出す分はここでスクロールさせる */
.lightbox-body {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: 100%;
  overflow-y: auto;
  animation: lightbox-in .18s ease-out;
}
.lightbox-body img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 86vh;
  object-fit: contain;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
  cursor: pointer;
}
.lightbox-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: transparent;
  cursor: pointer;
  z-index: 2;
}
@keyframes lightbox-in {
  from { opacity: 0; transform: scale(.94); }
  to { opacity: 1; transform: scale(1); }
}
/* PC幅でだけ効かせる改行。スマホでは改行位置が崩れるので外して自然に折り返させる */
@media (max-width: 480px) {
  .br-pc { display: none; }
  /* 感覚・行動リストのチップはスマホでは一回り小さくする */
  .kw-chip {
    font-size: 12px;
    padding: 7px 10px;
  }
  /* ランキング行は、順位ブロックはそのままに、
     右側を「領域タブ」→改行→「関心度〜/差分」の2段組にする */
  .rank-main {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 8px;
    justify-items: start;
  }
  .rank-main .rank-domain { grid-column: 1 / -1; }
  .rank-main .rank-gap { justify-self: end; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox-body { animation: none; }
  button.kw-badge:active, .ex-nav:active { transform: none; }
}

.domain-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 4px 16px 8px;
}
.domain-cell { border-radius: 6px; padding: 8px 9px; color: #fff; font-size: 11px; }
.domain-cell .d-name { font-weight: 700; font-size: 12px; margin-bottom: 3px; }
.domain-cell .d-row { display: flex; justify-content: space-between; }

.level-block { border-top: 1px solid var(--line); padding: 14px 2px; }
.level-block .lv-title { font-size: 13px; font-weight: 700; }
.level-block .lv-note { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.lv-count {
  float: right;
  width: 30px; height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  text-align: center;
  line-height: 28px;
  font-weight: 700;
  font-size: 14px;
  background: #fff;
}
.lv-domains { display: flex; flex-wrap: wrap; gap: 6px; }
.lv-domain { color: #fff; border-radius: 4px; font-size: 12px; font-weight: 700; padding: 3px 14px; }

.result-date { text-align: center; font-size: 12px; color: var(--muted); padding-top: 18px; }

.app-footer {
  text-align: center;
  padding: 26px 16px 30px;
  color: var(--muted);
  font-size: 10px;
}
.app-footer .logo { height: 30px; opacity: .75; margin-bottom: 6px; }

/* 完了ページ */
.complete-hero { text-align: center; padding: 34px 16px 10px; }
.complete-hero h1 { font-size: 22px; letter-spacing: .05em; }
.complete-hero .chars { font-size: 44px; margin: 14px 0 4px; }
.complete-hero-img { width: 100%; max-width: 340px; height: auto; margin: 14px auto 4px; display: block; }

/* カード内の区切り線 */
.card-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 16px -18px;
}

/* ===== 4要素の順番とバランス(本番デザイン) ===== */
.balance-title {
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  margin: 14px 0 6px;
}
.balance-order {
  display: flex;
  justify-content: center;
  text-align: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.balance-order-el {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}
.balance-order-sep {
  color: #b9b0a5;
  font-size: 16px;
  font-weight: 700;
}
.balance-figure { position: relative; }

/* 位置づけ図のキャラクターに重ねる構成比。
   白フチを付けて、どの要素色の上でも読めるようにする(指定座標がラベルの中心) */
.balance-pct {
  position: absolute;
  /* 1.26em = 数値の文字サイズ(1.8em)の0.7文字分だけ下げる */
  transform: translate(-50%, calc(-50% + 1.26em));
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  color: #40382f;
  -webkit-text-stroke: 3.5px #fff;
  paint-order: stroke fill;
  white-space: nowrap;
}
/* 数値だけ1.8倍。「%」は .balance-pct のサイズのまま */
.balance-pct-num { font-size: 1.8em; }

/* 画面には出さず、スクリーンリーダーにだけ読ませる */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ===== 一括送信のローディングオーバーレイ ===== */
.sending-overlay[hidden] { display: none; }
.sending-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(60, 52, 45, .55);
  display: flex;
  align-items: center;
  justify-content: center;
}
.sending-box {
  background: #fff;
  border-radius: 14px;
  padding: 28px 32px;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
}
.sending-text { font-size: 14px; font-weight: 700; line-height: 1.8; }
.spinner {
  width: 40px; height: 40px;
  margin: 0 auto 14px;
  border: 4px solid #eee7dd;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: wbc-spin .8s linear infinite;
}
@keyframes wbc-spin { to { transform: rotate(360deg); } }

/* ===== 結果メール送信ポップアップ ===== */
/* 幅に vw を使うと、文字サイズ切替の zoom と掛け算になって画面からはみ出す
   (既定が「中」= zoom 1.15 なので常に発生する)。親の .lightbox-body 基準で伸縮させる */
.mail-card { width: 100%; max-width: 400px; }
.mail-card-title { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.mail-card .input { width: 100%; }

/* 4要素の解説の見出し下に置く「得るしあわせに対する感度」のサブタイトル */
.sense-sub {
  display: block;
  font-size: 15px;
  margin-top: -5px;
}

/* 結果メール送信のインラインカード(結果ページ先頭)。下部fixedボタン版と選択検討中(2026-08-27) */
.mail-inline-title { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.mail-inline-form { display: flex; gap: 8px; align-items: stretch; }
.mail-inline-form .input { flex: 1; min-width: 0; }
.mail-inline-send {
  flex-shrink: 0;
  border: none;
  border-radius: 26px;
  padding: 0 24px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.mail-inline-send:active { background: var(--accent-dark); }
.mail-inline-send:disabled { opacity: .6; }

/* ===== 文字サイズ切替(ヘッダー右上・Aaアイコン) ===== */
.fontsize-switch {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
}
.fontsize-toggle {
  width: 40px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  line-height: 1;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fontsize-toggle svg { width: 24px; height: 24px; display: block; }
.fontsize-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0,0,0,.14);
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  z-index: 30;
}
.fontsize-menu[hidden] { display: none; }
.fontsize-menu-title { font-size: 10px; color: var(--muted); margin-right: 2px; }
.fontsize-menu button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.fontsize-menu button.active {
  background: var(--dark);
  border-color: var(--dark);
  color: #fff;
  font-weight: 700;
}

/* 文字サイズ: 中 / 大(小=標準) */
html.font-m body { zoom: 1.15; }
html.font-l body { zoom: 1.38; }
