/* 椅子の重さ診断（マネージャー職）v0 — isu.css
   デザイントークンは keiei.css（計器診断）を踏襲。書類メタファーは
   「飛行前点検表」→「耐荷重点検票」に変更。
   ⚠ 積載量は「大きいほど悪い」。計器カバー率と向きが逆なので、
     ok/warn の色・メーターの当て方は keiei.css の値をそのままコピーしていない
     （.weight-num.ok / .weight-num.warn を参照）。 */

: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; }

/* ---------- つかみ3行 ---------- */

.catch {
  max-width: 480px; margin: 0 auto 56px; padding: 32px 24px;
  background: var(--sheet); border: 1.5px solid var(--line); border-radius: 8px;
  box-shadow: 0 6px 28px var(--shadow); text-align: center;
}

.catch p {
  font-size: 17px; margin: 0 0 6px;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  /* 2026-10-04 追加。320px で「要領のいい上司は、部下が潰れ／る。」と
     **単語の途中で割れていた**。結果画面（:317 以降）には最初から入っていたが、
     つかみ3行だけ漏れていた。理由は :311-313 のコメントに既に書かれている——
     `text-wrap: balance` は行の長さを揃えるだけで、文節の途中で割れるのは防げない。
     `word-break: auto-phrase` は未対応ブラウザでは無視されるだけなので安全に足せる。 */
  text-wrap: balance; word-break: auto-phrase;
}

.catch p:last-child { margin-bottom: 0; color: var(--sub); }

/* 2026-10-04 追加。3行目が狭い画面で2行になるため、**句点で折る**。
   span を inline-block にすると、ブラウザは span の途中より span の境界を優先して折る。
   これが無いと360pxで「つまり悪いのは人じゃない。その椅子の / 構造だ。」と折れ、
   **オチの「構造だ。」だけが次行に取り残される**。
   広い画面では1行のまま（inline-block は並びを変えない）。 */
.catch p span { 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. 積載量＋メーター） ---------- */

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

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

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

/* 耐荷重100kgを超えたときの「振り切れ」演出。針の先端が小刻みに揺れる。 */
.gauge-needle.pegged {
  animation: needlePegged 0.6s ease-in-out infinite alternate;
}
@keyframes needlePegged {
  0% { transform: rotate(88deg); }
  100% { transform: rotate(92deg); }
}

.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); }

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

.weightnum {
  font-size: 56px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1;
}
/* ⚠ 積載量は小さいほど良い。keiei.css の .covnum.ok/.warn を値の大小そのままコピーしない。
   ここでは STAGE_INFO[stage].ok（＝まだ座れる椅子か）で色を決めている（isu.js参照）。 */
.weightnum.ok { color: var(--ok); }
.weightnum.warn { color: var(--accent); }

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

.capacity-note { font-size: 12px; color: var(--sub); }

.over-note {
  font-size: 13px; font-weight: 600; color: var(--accent);
  border: 1.5px dashed var(--accent); border-radius: 6px;
  padding: 6px 14px; margin-top: 4px;
}

/* 判定スタンプ */

.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; }

/* 2026-10-01：日本語の改行位置を文節の切れ目へ寄せる。
   `text-wrap: balance` は行の「長さ」を揃えるだけで、文節の途中で割れるのは防げない
   （実画面で「直接聞きに行か／ないと分からない日は」と割れた）。
   `word-break: auto-phrase` は未対応ブラウザでは無視されるだけなので安全に足せる。 */
.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〜9） ---------- */

.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;
}

/* 2026-09-21：一言コピー（.charcopy）を非表示化したため、実体の1行がカード内の
   実質的な見出しになった。視覚的な階層を保つため、やや大きく・地色（--ink）へ引き上げた
   （文言・配置順は変更しない。isu_v0_spec.md §6の並びのまま）。 */
.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;
}

/* 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; }

.cta-hint { font-size: 11px; color: var(--sub); }

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

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

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(10px);
  background: var(--ink); color: var(--sheet); padding: 9px 18px; border-radius: 6px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: opacity 0.3s, transform 0.3s;
  max-width: 90%; text-align: center; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

[hidden] { display: none !important; }

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

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