/* BizCats 3Dアセスメント 受検画面の共通スタイル
 * 色: BizCats ロゴの紺（#003388）と青（#0066FF）だけを使い、背景はわずかに青みのある白にする。
 *     古いスマホのブラウザでも同じ色になるよう、色の値は16進数で書く。
 * 文字: 本文は読みやすさ重視の BIZ UDPゴシック、見出しは丸ゴシックの Zen Maru Gothic。
 * 選択肢: 5つとも同じ色にし、目盛りの位置だけで違いを示す（色で良し悪しに見せない）。
 */
:root {
    --paper: #f9fbfe;
    --surface: #ffffff;
    --band: #eef4ff;
    --ink: #172135;
    --ink-2: #4a5364;
    --line: #d2d8e1;
    --navy: #003388;
    --navy-deep: #00236a;
    --blue: #0066ff;
    --blue-soft: #a9c8ff;
    --on-navy: #ffffff;
    --ok: #0c6944;
    --ok-wash: #dbf6e7;
    --warn: #9f3501;
    --warn-wash: #ffeede;
    --scrim: rgba(23, 33, 53, 0.5);
    --font-display: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "BIZ UDPGothic", sans-serif;
    --font-body: "BIZ UDPGothic", "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
    --font-mono: ui-monospace, Menlo, Consolas, monospace;
    --radius: 14px;
    --radius-sm: 10px;
    --shell: 40rem;
}

* { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; }
body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.8;
    line-break: strict;
    -webkit-text-size-adjust: 100%;
}
h1, h2 {
    margin: 0;
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.5;
    text-wrap: balance;
    word-break: auto-phrase;
    overflow-wrap: anywhere;
}
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h1[tabindex="-1"]:focus { outline: none; }
/* 短い文言は文節で折り返す（「測定」「PC推奨」などが途中で切れないように）。長い本文には使わない */
.test-name, .test-meta, .who-bar span, .choice-label, .facts dd, .note, .lead, .group-label {
    word-break: auto-phrase;
}
p { margin: 0; }
a { color: var(--blue); }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.sr-only {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ページの骨組み：スマホ幅で1列、PCでは中央の1列 */
.shell {
    max-width: var(--shell);
    margin: 0 auto;
    padding: 12px 16px 48px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.screen { display: flex; flex-direction: column; gap: 18px; }

/* 上部の帯 */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 44px;
    font-size: 14px;
    color: var(--ink-2);
}
.topbar .title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    font-weight: 700;
    color: var(--ink);
}
.topbar .count { font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.topbar .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-btn {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 4px;
    border: 0;
    background: none;
    color: var(--navy);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.masthead { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.brand { font-family: var(--font-display); font-weight: 700; color: var(--ink-2); }
.brand b { color: var(--navy); }

.langs { display: flex; flex-wrap: wrap; gap: 6px; }
.lang-btn {
    min-height: 36px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
}
.lang-btn[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--on-navy); }

/* ボタン */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}
.btn-primary { background: var(--navy); color: var(--on-navy); }
.btn-primary:hover { background: var(--navy-deep); }
.btn-primary:disabled { background: var(--line); color: var(--ink-2); cursor: not-allowed; }
.btn-outline { background: var(--surface); color: var(--navy); border: 1px solid var(--line); }
.btn-ghost { background: none; color: var(--navy); }
.btn-wide { width: 100%; }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.actions { display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 560px) { .actions { flex-direction: row; } }

.lead { color: var(--ink-2); }
/* 受検用リンクが使えなかったときなどの案内 */
.notice { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--warn-wash); color: var(--warn); font-size: 14px; font-weight: 700; line-height: 1.7; word-break: auto-phrase; }
.note { font-size: 13px; line-height: 1.7; color: var(--ink-2); }
.note[hidden] { display: none; }

/* 進み具合（区切りごと） */
.seg { display: grid; grid-template-columns: repeat(var(--segs), minmax(0, 1fr)); gap: 3px; }
.seg i { height: 6px; border-radius: 3px; background: var(--line); }
.seg i.full { background: var(--blue); }
.seg i.part { background: linear-gradient(90deg, var(--blue) var(--p), var(--line) var(--p)); }

/* 検査の説明 */
.intro-head { display: flex; align-items: center; gap: 14px; }
.intro-head > div { min-width: 0; }
/* 「キャリアインタレスト測定」が途中で折り返さない大きさに抑える */
.intro-head h1 { font-size: clamp(1.25rem, 5.4vw, 1.75rem); }
.kicker { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.how { display: flex; flex-direction: column; gap: 10px; padding: 16px; border-radius: var(--radius); background: var(--band); }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.facts div { min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.facts dt { font-size: 12px; color: var(--ink-2); }
.facts dd { margin: 0; font-size: 14px; font-weight: 700; line-height: 1.5; }
@media (max-width: 420px) {
    .facts div { padding: 8px 10px; }
    .facts dd { font-size: 13px; }
}

/* 猫（案内役） */
.cat { width: 48px; height: 48px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); object-fit: cover; }
.cat-lg { width: 64px; height: 64px; }
.buddy { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--radius); background: var(--band); font-size: 14px; line-height: 1.6; }

/* 問題と選択肢 */
.group-label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.q { font-size: clamp(1.25rem, 1.1rem + 0.9vw, 1.6rem); line-height: 1.55; }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 54px;
    padding: 6px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 16px;
    line-height: 1.45;
    text-align: left;
    cursor: pointer;
}
.choice:hover { border-color: var(--blue-soft); background: var(--band); }
.choice[aria-pressed="true"] { padding: 5px 13px; border: 2px solid var(--navy); background: var(--band); font-weight: 700; }
.scale { display: flex; align-items: flex-end; gap: 3px; height: 18px; }
.scale i { width: 6px; height: 8px; border-radius: 2px; background: var(--line); }
.scale i.on { height: 18px; background: var(--navy); }
.key { padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; font-family: var(--font-mono); font-size: 12px; line-height: 1.6; color: var(--ink-2); }
.key-hint { display: none; font-size: 13px; color: var(--ink-2); }
@media (hover: hover) and (pointer: fine) { .key-hint { display: block; } }
@media (hover: none) { .key { display: none; } }

/* 記述問題 */
.scenario { padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--band); }
.scenario summary { min-height: 32px; font-weight: 700; color: var(--navy); cursor: pointer; }
.scenario p { margin-top: 8px; }
.answer {
    width: 100%;
    min-height: 14em;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    line-height: 1.8;
    resize: vertical;
}
.answer:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.text-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
/* スマホでは、シナリオを少し詰めて入力欄までの距離を縮め、「次へ」は押しやすい横幅いっぱいにする */
@media (max-width: 480px) {
    .scenario { padding: 10px 14px; font-size: 15px; line-height: 1.75; }
    .text-foot { flex-direction: column; align-items: stretch; }
    .text-foot .btn { width: 100%; }
}
.error { font-size: 14px; font-weight: 700; color: var(--warn); }
.error[hidden] { display: none; }

/* 完了 */
.dots { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--ok); }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--ok); }
.dots span { margin-left: 4px; }

/* ポータル */
.who-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0 12px;
    padding: 6px 6px 6px 16px;
    border-radius: var(--radius);
    background: var(--band);
    font-size: 14px;
}
.panel { display: flex; flex-direction: column; gap: 16px; padding: 18px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 700; }
.field input {
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 16px;
}
.field input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.tests { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: test; }
.test {
    counter-increment: test;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}
.test::before {
    content: counter(test);
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--band);
    color: var(--navy);
    font-weight: 700;
}
.test.is-next { padding: 13px; border: 2px solid var(--navy); background: var(--band); }
.test.is-next::before { background: var(--navy); color: var(--on-navy); }
.test.is-done::before { background: var(--ok-wash); color: var(--ok); }
.test-body { min-width: 0; }
.test-name { font-weight: 700; }
.test-meta { font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.meter { height: 6px; margin-top: 6px; overflow: hidden; border-radius: 999px; background: var(--line); }
.meter i { display: block; width: var(--p); height: 100%; background: var(--blue); }
.chip { padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; color: var(--ink-2); }
.chip.ok { border-color: transparent; background: var(--ok-wash); color: var(--ok); }
/* 狭い画面では、検査名を1行に収めるためにボタンを名前の下へ回す */
@media (max-width: 420px) {
    .test { grid-template-columns: 32px minmax(0, 1fr); align-items: start; }
    .test::before { margin-top: 2px; }
    .test > .btn, .test > .chip { grid-column: 2; justify-self: start; }
}

/* 確認ダイアログ（ポータル） */
.modal { position: fixed; inset: 0; z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--scrim); }
.modal[hidden] { display: none; }
.modal-box { width: 100%; max-width: 420px; padding: 22px 20px 18px; display: flex; flex-direction: column; gap: 12px; border-radius: var(--radius); background: var(--paper); }

.foot { font-size: 12px; text-align: center; color: var(--ink-2); }

@media (min-width: 640px) {
    .shell { padding-top: 24px; }
    h1 { font-size: 1.75rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}
