/* 透明度診断（メンバー向け）v0 — member.css
   デザイントークンは isu.css（椅子の重さ診断）と同一（keiei.css も同じ値）。
   このプロジェクトは3診断とも同じトークンセットを使う設計のため、独自の配色は作らない。
   書類メタファーは「耐荷重点検票」→「透明度検査票」に変更。
   ⚠ この診断は isu と色の向きが同じ（透明度は大きいほど悪い）。ok/warn の当て方は
     isu.css の値をそのままコピーしている（isu_v0_spec.md §2「色の意味が椅子と同じ向き」）。
   ⚠ .toast は isu.css に残っていたが isu.js では一度も使われていない死んだ部品
     （2026-09-08 keiei側のコピー機能削除の名残）。ここには持ち込まない。 */

:root {
  --bg: #eef0ea;
  --sheet: #f9faf5;
  --grid: #e0e6da;
  --ink: #2a332e;
  --sub: #636d66; /* WCAG AA: bg上4.68:1 */
  --accent: #c43724; /* WCAG AA: sheet上5.11:1・白文字5.36:1 */
  --accent-ink: #ffffff;
  --ok: #3e7d5a;
  --line: #c8d0c6;
  --box: #fdfdf9;
  --shadow: rgba(42, 51, 46, 0.12);
  --illust-filter: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141917;
    --sheet: #1d2420;
    --grid: #28332c;
    --ink: #e8ede8;
    --sub: #93a099;
    --accent: #ff6b52;
    --accent-ink: #141917;
    --ok: #5fae85;
    --line: #3a463f;
    --box: #232b26;
    --shadow: rgba(0, 0, 0, 0.4);
    --illust-filter: brightness(0.85) contrast(0.98);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  line-height: 1.7;
}

.serif {
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
}

.mono {
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

a { color: inherit; }

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 96px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 8px; top: -48px;
  background: var(--ink); color: var(--sheet);
  padding: 10px 16px; border-radius: 6px; font-size: 13px; z-index: 100;
  transition: top 0.2s;
}
.skip-link:focus { top: 8px; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- ヒーロー ---------- */

.hero { padding: 56px 16px 40px; text-align: center; }

.eyebrow {
  font-size: 12px; letter-spacing: 0.24em; color: var(--sub); text-transform: uppercase;
}

.hero h1 {
  font-size: 28px; line-height: 1.5; margin: 12px 0 8px;
  letter-spacing: 0.03em; text-wrap: balance;
}

.hero .lead {
  font-size: 15px; color: var(--sub); max-width: 34em; margin: 0 auto 28px;
}

.hero-illust {
  display: block;
  width: min(360px, 70%);
  height: auto;
  margin: 0 auto 32px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 6px 28px var(--shadow);
  filter: var(--illust-filter);
}

.hero-cta {
  display: inline-flex; align-items: center; gap: 8px;
}

.nb { display: inline-block; }

/* ---------- 共通ボタン ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1.5px solid var(--ink); background: var(--ink); color: var(--sheet);
  border-radius: 6px; padding: 12px 22px; font-size: 14px; font-weight: 600;
  cursor: pointer; min-height: 44px; font-family: inherit; text-decoration: none;
}
.btn:hover { opacity: 0.88; }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.accent { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.btn:disabled { cursor: not-allowed; opacity: 0.5; }

/* ---------- 設問セクション ---------- */

.survey { margin-bottom: 56px; }

.progress-bar {
  position: sticky; top: 0; z-index: 10; background: var(--bg);
  padding: 12px 0; display: flex; flex-direction: column; align-items: center; gap: 8px;
  border-bottom: 1.5px solid var(--line); margin-bottom: 32px;
}

.progress-lamps { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

.lamp {
  width: 14px; height: 14px; border-radius: 99px;
  border: 1.5px solid var(--line); background: var(--box);
  transition: background 0.25s, border-color 0.25s;
}
.lamp.lit { background: var(--accent); border-color: var(--accent); }

.progress-text { font-size: 12px; color: var(--sub); }

.q-block {
  background: var(--sheet); border: 1.5px solid var(--line); border-radius: 8px;
  padding: 20px; margin-bottom: 16px; scroll-margin-top: 88px;
}

.q-block legend { float: left; padding: 0; width: 100%; }

.q-num { display: block; font-size: 12px; color: var(--sub); letter-spacing: 0.1em; margin-bottom: 6px; }

.q-text { display: block; font-size: 16px; font-weight: 600; margin-bottom: 16px; line-height: 1.6; }

.options { display: flex; flex-direction: column; gap: 8px; clear: both; }

.option {
  display: flex; align-items: center; gap: 10px; min-height: 44px;
  padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 6px;
  background: var(--box); cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.option:hover { border-color: var(--sub); }

.option input[type="radio"] { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }

.option-label { font-size: 14px; }

.option:has(input:checked) { border-color: var(--accent); background: var(--box); }
.option:has(input:checked) .option-label { font-weight: 700; }

.submit-row {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  margin-top: 24px; scroll-margin-top: 88px;
}

.validation-msg { font-size: 13px; color: var(--accent); min-height: 1.4em; text-align: center; }

/* ---------- 結果：透明度検査票 ---------- */

#result { scroll-margin-top: 24px; }

.sheet {
  background: var(--sheet); border: 1.5px solid var(--line); border-radius: 6px;
  box-shadow: 0 6px 28px var(--shadow); overflow: hidden;
  background-image: repeating-linear-gradient(0deg, var(--grid) 0 1px, transparent 1px 24px),
    repeating-linear-gradient(90deg, var(--grid) 0 1px, transparent 1px 24px);
}

.sheet-head {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 16px;
  padding: 14px 20px; border-bottom: 1.5px solid var(--line); background: var(--sheet);
  font-size: 12px; color: var(--sub);
}
.sheet-head b { color: var(--ink); font-weight: 600; }

.sheet-title {
  text-align: center; padding: 22px 20px 4px; font-size: 21px;
  letter-spacing: 0.28em; font-weight: 700;
}

.sheet-sub { text-align: center; font-size: 12px; color: var(--sub); padding-bottom: 16px; }

/* ---------- 透明度メーター（1. 透明度＋メーター） ---------- */
/* ⚠ isu のゲージと違い「耐荷重超え」の概念が無い（スケールは常に0〜100%で閉じている）。
   しきい値マーク・振り切れ演出（.gauge-needle.pegged）は持ち込まない。 */

.pct-board {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 24px 8px;
}

.pct-gauge { width: 100%; max-width: 220px; }
.pct-gauge svg { width: 100%; }

.gauge-needle {
  transition: transform 1s cubic-bezier(0.34, 1.5, 0.44, 1);
  transform-origin: 100px 100px;
}

.readout {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 4px 20px 16px; text-align: center;
}

.readout .cap { font-size: 12px; color: var(--sub); }

.pctnum-row { display: flex; align-items: baseline; gap: 4px; }

.pctnum {
  font-size: 56px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1;
}
/* ⚠ 透明度は小さいほど良い（isu の積載量と同じ向き）。stage.ok（＝まだ見えているか）で色を決める。 */
.pctnum.ok { color: var(--ok); }
.pctnum.warn { color: var(--accent); }

.pctnum-unit { font-size: 22px; font-weight: 600; }

/* 判定スタンプ */

.verdict {
  padding: 6px 24px 24px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}

.stamp {
  display: inline-block; border: 3px solid var(--accent); color: var(--accent);
  padding: 8px 20px; font-size: 21px; font-weight: 700; letter-spacing: 0.12em;
  transform: rotate(-4deg); border-radius: 4px; opacity: 0;
}
.stamp.ok { border-color: var(--ok); color: var(--ok); }
.stamp.in { animation: stampin 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) forwards; }

@keyframes stampin {
  0% { opacity: 0; transform: rotate(-4deg) scale(2.2); }
  100% { opacity: 1; transform: rotate(-4deg) scale(1); }
}

.stamp .lab { display: block; font-size: 10px; letter-spacing: 0.4em; opacity: 0.8; }

/* 日本語の改行位置を文節の切れ目へ寄せる（isu.css 2026-10-01 対応と同じ理由）。 */
.stage-judge {
  font-size: 14px; color: var(--ink); max-width: 34em; margin-inline: auto;
  opacity: 0; transition: opacity 0.6s;
  text-wrap: balance; word-break: auto-phrase;
}
.stage-judge.in { opacity: 1; }

/* ---------- キャラカード（3〜8） ---------- */

.charcard {
  border: 1.5px solid var(--line); background: var(--box); border-radius: 8px;
  padding: 18px 20px 20px; max-width: 560px; width: 100%;
  opacity: 0; transform: translateY(10px); transition: opacity 0.5s, transform 0.5s;
  text-align: left;
}
.charcard.in { opacity: 1; transform: none; }

.charcard .charimg {
  display: block; width: 100%; height: auto; margin: 0 auto 10px;
  border: 1px solid var(--line); border-radius: 6px; filter: var(--illust-filter);
}

.charcard .charcaption {
  font-size: 12.5px; color: var(--sub); text-align: center; margin: 0 0 16px; line-height: 1.7;
  text-wrap: balance; word-break: auto-phrase;
}

.charcard .charreal {
  font-size: 17px; font-weight: 600; line-height: 1.7; letter-spacing: 0.01em;
  text-align: center; color: var(--ink); margin: 2px 0 14px;
  text-wrap: balance; word-break: auto-phrase;
}

.charcard .charjudge {
  font-size: 14px; line-height: 1.9; color: var(--ink);
  margin: 0 auto; max-width: 30em; text-align: center;
  text-wrap: balance; word-break: auto-phrase;
}

.charcard .chardesc {
  font-size: 12.5px; color: var(--sub); margin: 14px 0 0; word-break: auto-phrase;
  padding-top: 12px; border-top: 1.5px dashed var(--line);
}

.charcard .charname {
  font-size: 11.5px; color: var(--sub); letter-spacing: 0.08em;
  text-align: center; margin: 10px 0 0;
}

/* 全問0点（perfect）専用の賞讃文ブロック。charcard と同じ位置に排他表示される。 */
.perfect-block {
  max-width: 560px;
  width: 100%;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s, transform 0.5s;
}
.perfect-block.in {
  opacity: 1;
  transform: none;
}
.perfect-block .perfect-img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  filter: var(--illust-filter);
}
.perfect-block .perfect-note {
  border: 1.5px dashed var(--ok);
  background: var(--box);
  border-radius: 8px;
  padding: 18px 20px;
  width: 100%;
  margin: 0;
  font-size: 14px;
  color: var(--ink);
  text-align: center;
  line-height: 1.9;
  text-wrap: balance;
  word-break: auto-phrase;
}

/* CTA */

.cta-block {
  border-top: 1.5px solid var(--line); padding: 24px;
  display: flex; flex-direction: column; gap: 20px;
}

.cta-primary, .cta-secondary {
  display: flex; flex-direction: column; gap: 10px; align-items: center; text-align: center;
}

.cta-primary p, .cta-secondary p { font-size: 14px; font-weight: 600; margin: 0; }

.replay-row { text-align: center; margin-top: 24px; }

footer.site-footer { text-align: center; font-size: 12px; color: var(--sub); padding: 24px 16px 0; }

[hidden] { display: none !important; }

@media (max-width: 480px) {
  .hero h1 { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001s !important; transition-duration: 0.001s !important; }
}

/* ---------- 上司に送るボタン（三診断連鎖の起点・2026-10-02 追加） ---------- */
/* 設計書 §4 シェア設計。主たる導線は相談フォームなので、CTAより控えめにする。 */
.chain-row {
  margin: 28px auto 0; padding-top: 20px; max-width: 420px;
  border-top: 1.5px dashed var(--line); text-align: center;
}
.chain-row .chain-lead {
  font-size: 14px; color: var(--sub); margin: 0 0 10px;
  text-wrap: balance; word-break: auto-phrase;
}
.chain-row .chain-btn { font-size: 13px; padding: 10px 18px; }
