/* 紹介者専用ページ（web/referrers/*.json → build.py が作る <slug>.html）だけが読む。LP 本体（clinic-portal.html）は読まない
   2026-11-04 v3: 寸法・色・文字の大きさは proposals/watanabe-2026-11/review-2026-11-04/design-spec-ref-v3.md が正本
   ①（2026-11-04 1画面目の札はやめた。梅村さん「一番上に推薦は、わけわからん」。推薦区画はフォームの直前＝build.py）
   ②推薦区画は枠を持たない grid の器。枠は主役の引用（オレンジの上線）と脇の引用（黄色の左線）の2つだけ。経歴は写真の下
   ③フォームの上の1行・ご紹介者欄の補足 */


/* ② 推薦区画（design-spec-ref-v3 §1） */
.ref-rec { padding: var(--sec-y) 0; background: #FFF5E8; }
.ref-rec .sec-ja { font-size: 20px; line-height: 1.5; font-weight: 900; }
.ref-nw { white-space: nowrap; }
.ref-rec-lead { margin-top: 16px; font-size: 16px; font-weight: 500; line-height: 1.8; color: #3A3A4A; }
/* スマホ: 上から 主役の引用 → 脇の引用 → [写真｜肩書き・名前] → 年表 → 実績。年表が入って写真の横の列（238px）では
   1行が8字ほどになったので、年表と実績は横いっぱいに出す（並びは前と同じ。.ref-pf は display: contents）。
   3段目の 1fr は、写真の高さ（120px）と肩書き・名前の高さの差を吸う */
.ref-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); grid-template-areas: "photo titles" "photo name" "photo ." "talk talk" "msg msg" "hist hist" "career career"; grid-template-rows: auto auto 1fr auto auto auto auto; gap: 0 16px; margin: 20px 0 0; padding: 0; background: none; }

/* 器の中の文: build.py が文節の切れ目にだけ改行の候補（ゼロ幅スペース）を入れ、ここで keep-all にして語の途中で折らない。
   LP 全体の phrase_breaks（短いかぎかっこを inline-block の塊にする等）は通さない。text-wrap: pretty で最後の行が1〜2字だけ残るのを防ぐ */
.ref-card p, .ref-card li, .ref-card figcaption { word-break: keep-all; overflow-wrap: anywhere; line-break: strict; text-wrap: pretty; }

/* 写真 */
.ref-pf-photo { grid-area: photo; margin: 0; }
/* 2026-11-04 梅村さん「なんで名前3箇所もあるねん」: 署名をやめ、スマホは写真と名前を引用の上に置いて、誰の言葉かをそこで示す */
.ref-card > .ref-msg { margin-top: 16px; }
.ref-pf-photo img { display: block; width: 96px; height: 120px; object-fit: cover; object-position: 50% 22%; border-radius: 12px; }

/* ブロック3: 主役の引用（オレンジの上線・大きな引用符・右下に署名） */
.ref-msg { grid-area: msg; position: relative; margin: 0; padding: 20px 18px; border: 1px solid #F0E2C9; border-top: 4px solid #FF9900; border-radius: 16px; background: #fff; box-shadow: 0 20px 48px -32px rgba(26, 26, 46, .20); text-align: left; }
.ref-msg-mark { position: absolute; top: 6px; right: 14px; font: 800 64px/1 Montserrat, "Noto Sans JP", sans-serif; color: #FFE08A; pointer-events: none; }
.ref-msg-k { position: relative; margin: 0 0 6px; font-size: 14px; font-weight: 800; line-height: 1.5; letter-spacing: .08em; color: #B35900; }
.ref-card .ref-msg-catch { position: relative; margin: 0 0 14px; font-size: 20px; font-weight: 900; line-height: 1.5; color: #1A1A2E; font-feature-settings: "palt"; text-wrap: balance; }
.ref-msg-quote { margin: 0; padding: 0; border: 0; }
.ref-msg-quote p { margin: 0; font-size: 16px; font-weight: 500; line-height: 1.8; color: #3A3A4A; }
.ref-msg-quote p + p { margin-top: .5em; }
/* 内製化の一文（2026-11-04「内製化というところも強調して欲しい」）: 太字・紺・下半分に黄色のマーカー */
.lp .ref-msg-quote p.ref-msg-em, .ref-msg-quote p.ref-msg-em { margin-top: .9em; margin-bottom: .3em; font-size: 18px; font-weight: 800; line-height: 1.7; color: #1A1A2E; }
.ref-msg-em mark { background: linear-gradient(transparent 58%, #FFE08A 58%); color: inherit; padding: 0 2px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
@media (min-width: 768px) { .lp .ref-msg-quote p.ref-msg-em, .ref-msg-quote p.ref-msg-em { font-size: 20px; } }  /* vi-lp.css の .lp .ref-msg-quote p（16px）に負けないよう .lp と p をつける */
.ref-msg-list { list-style: none; margin: 10px 0; padding: 12px 16px; display: grid; gap: 6px; border-radius: 12px; background: #FFF5E8; }
.ref-msg-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; font-weight: 700; line-height: 1.6; color: #1A1A2E; }
.ref-check { flex: none; width: 20px; height: 20px; margin-top: 2px; }
.ref-check circle { fill: #FF9900; }
.ref-check path { stroke: #1A1A2E; stroke-width: 2.6; }
.ref-msg-src { margin: 14px 0 0; display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.ref-msg-src b { font-size: 16px; font-weight: 800; line-height: 1.6; color: #1A1A2E; }
.ref-msg-src span { font-size: 14px; font-weight: 500; line-height: 1.7; color: #6B6B78; }
.ref-msg-src img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; }

/* ブロック4: 脇の引用（黄色の左線・影なし） */
.ref-talk { grid-area: talk; margin: 16px 0 0; padding: 14px 16px; border: 1px solid #F0E2C9; border-left: 4px solid #FFE08A; border-radius: 16px; background: #fff; }
.ref-talk-k { margin: 0 0 6px; font-size: 14px; font-weight: 700; line-height: 1.5; color: #6B6B78; }
.ref-talk-quote { margin: 0; }
.ref-talk-quote p { margin: 0; font-size: 15px; font-weight: 500; line-height: 1.75; color: #3A3A4A; }
.ref-talk-quote p + p { margin-top: 4px; }
/* 2026-11-04 梅村さん「内製化だって言ってたでしょ？」: 内製化の言葉を推薦文より上に置き、1文目を見出しの大きさにする */
.ref-talk-quote .ref-talk-catch { margin-bottom: 8px; font-size: 20px; font-weight: 900; line-height: 1.5; color: #1A1A2E; }
.ref-talk .ref-msg-src { margin-top: 8px; }
.ref-talk .ref-msg-src b { font-size: 14px; font-weight: 700; color: #3A3A4A; }
.ref-talk .ref-msg-src img { width: 24px; height: 24px; }

/* ブロック5: 経歴（枠に入れず写真の下。数字は文の中で太くするだけ） */
.ref-pf { display: contents; }
.ref-pf-titles { grid-area: titles; margin: 16px 0 0; display: flex; flex-direction: column; gap: 2px; }
.ref-pf-titles span { font-size: 14px; font-weight: 700; line-height: 1.5; letter-spacing: 0; color: #6B6B78; font-feature-settings: "palt"; }
.ref-pf-name { grid-area: name; margin: 6px 0 0; font-size: 20px; font-weight: 900; letter-spacing: .06em; line-height: 1.35; color: #1A1A2E; white-space: nowrap; }
.ref-pf-history { grid-area: hist; list-style: none; margin: 12px 0 0; padding: 0; }
.ref-pf-history li { display: flex; align-items: baseline; padding: 6px 0; }
.ref-pf-history li + li { border-top: 1px solid #F0E2C9; }
.ref-pf-year { flex: none; width: 4.5em; font-size: 14px; font-weight: 800; line-height: 1.7; color: #B35900; }
.ref-pf-history li > span + span { min-width: 0; font-size: 15px; font-weight: 500; line-height: 1.7; color: #3A3A4A; }
.ref-pf-career { grid-area: career; list-style: none; margin: 12px 0 0; padding: 0; }
.ref-pf-career li { padding: 6px 0; font-size: 16px; font-weight: 500; line-height: 1.75; color: #3A3A4A; }
.ref-pf-career li + li { border-top: 1px solid #F0E2C9; }
.ref-pf-career b { font-size: 1.125em; font-weight: 900; color: #B35900; }

/* 中くらいの幅（768〜1023px） */
@media (min-width: 768px) {
  .ref-rec { background: none; }
  .ref-rec .sec-ja { font-size: 28px; line-height: 1.35; }
  .ref-rec-lead { line-height: 1.75; }
  /* 経歴に年表（copy-ref-v3 §5）が入って左の列が右より長くなり、写真を 280×300 に縮めても区画が 1.4画面（1120px）を超えた（1531px）。
     指示どおり「下に横いっぱいの段・左に年表／右に実績」にすると 1457px で、写真の下が約450px 空いた。
     そこで、肩書き・名前・実績は写真の下（空いていた所）に置き、年表だけを下の横いっぱいの段（2列・上から年の順）にした。
     .ref-pf は display: contents にして、中身をこの grid に直接並べる（HTML の順＝読み上げの順は 写真→引用→脇→肩書き→名前→年表→実績 のまま）。
     4段目を 1fr にすると、主役の引用の余りと実績の長さの差はそこで吸収され、写真・肩書き・名前の間は空かない */
  .ref-card { grid-template-columns: 220px minmax(0, 1fr); grid-template-areas: "photo msg" "titles msg" "name msg" "career msg" "hist hist"; grid-template-rows: auto auto auto 1fr auto; gap: 0 28px; align-items: start; margin-top: 24px; }
  .ref-pf-photo { margin-top: 0; }
  .ref-card > .ref-msg { margin-top: 0; }
  .ref-pf-photo img { width: 220px; height: 275px; border-radius: 16px; }
  .ref-msg { padding: 24px 32px; border-radius: 20px; }
  .ref-msg-mark { top: 10px; right: 24px; font-size: 96px; }
  .ref-card .ref-msg-catch { font-size: 22px; line-height: 1.45; }
  .ref-msg-quote p { line-height: 1.75; }
  .ref-msg-list li { font-size: 16px; }
  .ref-check { width: 22px; height: 22px; }
  .ref-msg-src img { display: none; }
  .ref-talk { margin-top: 0; padding: 18px 24px; }
  .ref-talk-quote .ref-talk-catch { font-size: 22px; }
  .ref-talk-quote p { line-height: 1.7; }
  .ref-pf-career { margin-top: 8px; }
  .ref-pf-history { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: repeat(var(--hist-rows, 3), auto); grid-auto-flow: column; column-gap: 40px; margin-top: 24px; padding-top: 8px; border-top: 1px solid #F0E2C9; }
  .ref-pf-history li + li { border-top: 0; }
  .ref-pf-history li { border-bottom: 1px solid #F0E2C9; }
  .ref-pf-titles span { white-space: normal; }
  .ref-pf-name { font-size: 22px; }
}
/* PC（1024px〜） */
@media (min-width: 1024px) {
  .ref-card { grid-template-columns: 280px minmax(0, 1fr); column-gap: 40px; }
  .ref-pf-photo img { width: 280px; height: 300px; }
  /* 1280×800 で区画を 1.3画面（1040px）以内にするための詰め。design-spec-ref-v3 §1-2 の1→4 を全部当てて 1093→1048px。
     まだ 8px 超えたので、枠の間を仕様の見込みどおり 16px に（20 → 16）、杏色の箱の上下の外の余白を 10→8、
     主役の枠の署名の上を 14→12 にした（実測 1038px） */
  .ref-rec .sec-en { display: none; }
  .ref-msg { padding-top: 20px; padding-bottom: 20px; }
  .ref-msg-list { margin: 8px 0; padding: 10px 16px; gap: 4px; }
  .ref-msg-quote p + p { margin-top: .4em; }
  .ref-msg > .ref-msg-src { margin-top: 12px; }
}

/* ③ お申し込みまわり */
.ref-field-hint { font-size: 14px; color: #6B6B78; }
/* PC の申し込み区画はグラデ一色になった（style.css .lp .apply・2026-11-04）ので、PC の上書きは消した。
   スマホは上から決まった高さだけグラデを塗るので、1行の札（2行で 96px）のぶんだけ下の @media で伸ばす */
@media (max-width: 767px) {
  .lp .apply { background: linear-gradient(#FFF5E8, #FFF5E8) 0 100% / 100% calc(100% - 556px) no-repeat, var(--grad); }
}
@media (min-width: 768px) {
  /* フォームの左の列の1行の札: 左寄せで、列の幅に収める */
}
