/* 現場トレーナー（試作版）
 * 読みやすさを優先。色だけで意味を伝えず、必ず記号や文字を添える。アニメーションは使わない。 */

:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #f0ede5;
  --ink: #1f2328;
  --ink-2: #4a4f57;
  --muted: #5e6670;
  --line: #d4cfc3;
  --primary: #1d4f91;
  --primary-ink: #ffffff;
  --primary-soft: #e3ecf8;
  --focus: #f0a400;
  --ok: #1e6b34;     --ok-bg: #e6f3ea;
  --mid: #8a5a00;    --mid-bg: #fdf1d8;
  --ng: #8c2f39;     --ng-bg: #f9e8ea;
  --warn: #8a4b00;   --warn-bg: #fff3dc;
  --info-bg: #e9f0fa;
  --f-quality: #1d5fa8; --f-cost: #7a5a00; --f-schedule: #6b3fa0; --f-safety: #b3261e; --f-environment: #2e6b2f;
  --radius: 10px;
  --font: "BIZ UDPGothic", "BIZ UDPゴシック", "Yu Gothic UI", "Meiryo", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
}

html { font-size: 17px; }
html[data-font="large"] { font-size: 19.5px; }
html[data-font="xlarge"] { font-size: 22px; }
body.presentation { font-size: 1.18rem; }
body.presentation .site-header { position: static; }
[tabindex="-1"], h1, h2 { scroll-margin-top: 6.5rem; }

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font);
  line-height: 1.75; letter-spacing: .02em; -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

a { color: var(--primary); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
h1 { font-size: 1.7rem; line-height: 1.4; margin: .4rem 0 .8rem; }
h2 { font-size: 1.3rem; line-height: 1.45; margin: 1.8rem 0 .7rem; }
h3 { font-size: 1.08rem; margin: 1.2rem 0 .5rem; }
h4 { font-size: 1rem; margin: 1rem 0 .4rem; }
p { margin: .5rem 0; }
ul, ol { padding-left: 1.4em; }
.small { font-size: .88rem; }
.muted { color: var(--muted); }
.mono { font-family: Consolas, "BIZ UDGothic", monospace; font-weight: 700; }
.lead { font-size: 1.05rem; color: var(--ink-2); max-width: 60em; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1:focus, h2:focus { outline: none; }
h1:focus-visible, h2:focus-visible { outline: 3px solid var(--focus); }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--primary); color: #fff; padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }

/* ---------- ヘッダー ---------- */
.site-header {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.2rem;
  background: var(--surface); border-bottom: 3px solid var(--primary); padding: .6rem 1.2rem;
  position: sticky; top: 0; z-index: 20;
}
.brand-link { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); }
.brand-mark { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 8px; background: var(--primary); color: #fff; font-weight: 700; font-size: 1.15rem; }
.brand-text { font-weight: 700; font-size: 1.1rem; line-height: 1.2; }
.brand-text small { display: block; font-weight: 400; font-size: .75rem; color: var(--muted); }
.site-nav ul { display: flex; flex-wrap: wrap; gap: .2rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { display: block; padding: .45rem .75rem; border-radius: 8px; text-decoration: none; color: var(--ink); font-weight: 600; }
.site-nav a:hover { background: var(--surface-2); }
.site-nav a[aria-current="page"] { background: var(--primary); color: #fff; }
body[data-role="learner"] .trainer-only { display: none; }
.settings { display: flex; flex-wrap: wrap; gap: .5rem 1rem; margin-left: auto; }
.setting { display: flex; align-items: center; gap: .25rem; }
.setting-label { font-size: .82rem; color: var(--muted); margin-right: .2rem; line-height: 1.2; }
.setting-label small { display: block; font-size: .7rem; }
.chip { font: inherit; font-size: .85rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: .25rem .7rem; cursor: pointer; min-height: 2rem; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip[aria-pressed="true"]::before { content: "✓ "; }

.global-warn { background: var(--warn-bg); border-bottom: 2px solid var(--warn); padding: .4rem 1.2rem; color: var(--warn); font-weight: 700; }
.main { max-width: 1280px; margin: 0 auto; padding: 1rem 1.2rem 3rem; }
.main:focus { outline: none; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: .8rem 1.2rem; font-size: .88rem; color: var(--ink-2); }
.site-footer p { max-width: 1280px; margin: .2rem auto; }

/* ---------- 共通部品 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
  font: inherit; font-weight: 700; font-size: .98rem; line-height: 1.3;
  min-height: 2.75rem; padding: .5rem 1.05rem; margin: .2rem .3rem .2rem 0;
  border: 2px solid var(--primary); border-radius: 8px; background: var(--surface); color: var(--primary);
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--primary-soft); }
.btn.primary { background: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { background: #163e73; }
.btn.subtle { border-color: var(--line); color: var(--ink-2); font-weight: 600; }
.btn.danger { border-color: var(--ng); color: var(--ng); }
.btn.small { min-height: 2.2rem; padding: .25rem .7rem; font-size: .88rem; }
.btn.is-on, .btn[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.is-on::before, .btn[aria-pressed="true"]::before { content: "✓"; }
.btn-row { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.file-btn { position: relative; }
.linklike { font: inherit; background: none; border: none; color: var(--primary); text-decoration: underline; cursor: pointer; padding: .15rem 0; text-align: left; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1rem 0; }
.card h2:first-child { margin-top: .2rem; }
.notice { border-radius: var(--radius); padding: .65rem 1rem; margin: .8rem 0; border-left: 6px solid; }
.notice-info { background: var(--info-bg); border-color: var(--primary); }
.notice-caution { background: var(--warn-bg); border-color: #c98a1b; }
.notice-warn { background: #fde9d9; border-color: var(--warn); }
.bullets li { margin: .25rem 0; }

.tags { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin: .4rem 0; }
.tag, .badge { display: inline-flex; align-items: center; gap: .25rem; border-radius: 6px; padding: .1rem .55rem; font-size: .85rem; font-weight: 700; border: 1.5px solid currentColor; background: var(--surface); line-height: 1.6; }
.tag-mark { display: inline-grid; place-items: center; width: 1.25rem; height: 1.25rem; border-radius: 4px; color: #fff; font-size: .75rem; }
.field-quality { color: var(--f-quality); } .field-quality .tag-mark { background: var(--f-quality); }
.field-cost { color: var(--f-cost); } .field-cost .tag-mark { background: var(--f-cost); }
.field-schedule { color: var(--f-schedule); } .field-schedule .tag-mark { background: var(--f-schedule); }
.field-safety { color: var(--f-safety); } .field-safety .tag-mark { background: var(--f-safety); }
.field-environment { color: var(--f-environment); } .field-environment .tag-mark { background: var(--f-environment); }
.tag.diff { color: var(--ink-2); }
.tag.format { color: var(--primary); }
.tag.version { color: var(--muted); font-weight: 400; border-style: dashed; }
.badge.unreviewed { color: #7a4300; background: var(--warn-bg); }
.badge.reviewed { color: var(--ok); background: var(--ok-bg); }

.status { display: inline-flex; align-items: center; gap: .3rem; font-weight: 700; padding: .05rem .5rem; border-radius: 6px; border: 1.5px solid; font-size: .9rem; }
.status-icon { display: inline-grid; place-items: center; min-width: 1.3em; font-weight: 700; }
.status-unanswered { color: var(--muted); border-color: var(--line); }
.status-answered { color: var(--ok); background: var(--ok-bg); }
.status-review { color: var(--mid); background: var(--mid-bg); }
.outcome { display: inline-flex; gap: .2rem; font-weight: 700; padding: 0 .45rem; border-radius: 6px; border: 1.5px solid; font-size: .9rem; white-space: nowrap; }
.outcome-correct { color: var(--ok); background: var(--ok-bg); }
.outcome-partial { color: var(--mid); background: var(--mid-bg); }
.outcome-incorrect { color: var(--ng); background: var(--ng-bg); }
.outcome-neutral, .outcome-none { color: var(--muted); border-color: var(--line); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: .5rem 0; }
.kv dt { font-weight: 700; color: var(--ink-2); }
.kv dd { margin: 0; }
.kv dd ul { margin: 0; }

.table-wrap { overflow-x: auto; margin: .6rem 0 1.2rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.data { border-collapse: collapse; width: 100%; font-size: .9rem; }
table.data caption { text-align: left; font-weight: 700; padding: .5rem .8rem; background: var(--surface-2); }
table.data th, table.data td { border-bottom: 1px solid var(--line); padding: .45rem .6rem; text-align: left; vertical-align: top; }
table.data thead th { background: #ebe7dd; white-space: nowrap; position: sticky; top: 0; }
table.data tbody tr:nth-child(even) { background: #faf9f6; }
table.data.compact td { font-size: .85rem; }
table.data.wide td { white-space: nowrap; }
table.data.wide td:nth-child(3) { white-space: normal; min-width: 12em; }

details > summary { cursor: pointer; font-weight: 700; padding: .3rem 0; }
.defs { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .4rem 1rem; margin: 1rem 0; }

.form-msg { color: var(--ng); font-weight: 700; min-height: 1.2em; }
.form-msg.is-ok { color: var(--ok, #1f6f3f); }
.profile-fields p { display: grid; grid-template-columns: 7em minmax(0, 22rem); gap: .2rem .8rem; align-items: center; margin: .6rem 0; }
.profile-fields label { font-weight: 700; }
.profile-fields .small { grid-column: 2; }
.profile-fields input, .profile-fields select, .pass-form input { font: inherit; padding: .45rem .6rem; border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface); min-height: 2.6rem; width: 100%; box-sizing: border-box; }
.pass-form input { width: auto; max-width: 16rem; }
.sync-status { font-weight: 700; }
.server-url { font-family: var(--mono, monospace); background: var(--info-bg); padding: .1rem .4rem; border-radius: 4px; word-break: break-all; }
@media (max-width: 600px) { .profile-fields p { grid-template-columns: 1fr; } .profile-fields .small { grid-column: 1; } }
.check { display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; }
.check input { width: 1.2rem; height: 1.2rem; }
.check.big { font-size: 1.05rem; font-weight: 700; }
.seg { display: flex; flex-wrap: wrap; gap: .3rem; margin: .3rem 0; }
.seg label { display: inline-flex; align-items: center; gap: .35rem; border: 1.5px solid var(--line); border-radius: 8px; padding: .35rem .8rem; background: var(--surface); cursor: pointer; min-height: 2.6rem; }
.seg label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); font-weight: 700; }

/* ---------- ホーム ---------- */
.resume-card { background: var(--primary-soft); border: 2px solid var(--primary); border-radius: var(--radius); padding: .8rem 1.2rem; margin: 1rem 0; }
.resume-card h2 { margin-top: .2rem; }
.flow { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem; counter-reset: flow; }
.flow li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .8rem; counter-increment: flow; }
.flow li::before { content: counter(flow); display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; margin-right: .4rem; }
.flow strong { font-size: 1.02rem; }
.flow span { display: block; font-size: .88rem; color: var(--ink-2); }
.menu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .8rem; }
.menu-card { display: flex; flex-direction: column; gap: .3rem; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 1rem; text-decoration: none; color: var(--ink); min-height: 9rem; }
.menu-card:hover { border-color: var(--primary); }
.menu-title { font-weight: 700; font-size: 1.12rem; color: var(--primary); }
.menu-desc { font-size: .92rem; color: var(--ink-2); flex: 1; }
.menu-stat { font-weight: 700; font-size: .92rem; }

.status-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; }
.board-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem 1rem; border-top: 5px solid var(--line); }
.board-col h3 { margin: .2rem 0 .4rem; display: flex; align-items: center; gap: .3rem; }
.board-answered { border-top-color: var(--ok); }
.board-review { border-top-color: #c98a1b; }
.board-col ul { margin: 0; padding-left: 1.1em; font-size: .92rem; }
.board-col li { margin: .2rem 0; }

/* ---------- 探索 ---------- */
.map-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .9rem; margin: .6rem 0; }
.explore-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 1rem; align-items: start; }
.map-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .4rem; }
.map-box.zoomed { overflow: auto; max-height: 80vh; }
.map-box.zoomed .sitemap { width: 1500px; max-width: none; }
.explore-panel { background: var(--surface); border: 2px solid var(--primary); border-radius: var(--radius); padding: .6rem 1rem 1rem; position: sticky; top: 5.5rem; max-height: calc(100vh - 6.5rem); overflow: auto; }
.explore-panel h2 { margin-top: .3rem; }
.explore-panel .btn { width: 100%; margin: .3rem 0; }
.glance { font-size: 1.02rem; }
.obs { background: var(--surface-2); border-radius: 8px; padding: .4rem .8rem; }
.obs h3 { margin-top: .4rem; }
.steps-small { padding-left: 1.3em; font-size: .95rem; }
.legend { color: var(--ink-2); display: flex; flex-wrap: wrap; gap: .2rem .5rem; align-items: center; }
.lg { display: inline-grid; place-items: center; width: 1.3rem; height: 1.3rem; font-weight: 700; font-size: .8rem; }
.lg-answered { background: var(--ok); color: #fff; border-radius: 50%; }
.lg-review { background: #c98a1b; color: #fff; transform: rotate(45deg); border-radius: 2px; }
.lg-review { font-size: 0; position: relative; }
.lg-review::after { content: "!"; font-size: .8rem; transform: rotate(-45deg); }
.lg-hint { color: #1d5fa8; border: 2px dashed #1d5fa8; border-radius: 50%; font-size: 0; }
.lg-walk { background: #d7ecd0; border: 2px solid #3f8f3a; border-radius: 3px; }
.spot-list { margin: 1rem 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .4rem 1rem; }
.area-list { list-style: none; padding: 0; columns: 3 260px; }
.area-list > li { break-inside: avoid; margin-bottom: .6rem; }
.area-name { font-weight: 700; }
.area-list ul { padding-left: 1.1em; margin: .1rem 0; }

/* ---------- 地図（SVG） ---------- */
.sitemap { display: block; width: 100%; height: auto; font-family: var(--font); }
.m-outside { fill: #d6d3cb; }
.m-road { fill: #7f8388; }
.m-road-center { stroke: #f4f4f4; stroke-width: 3; stroke-dasharray: 22 14; }
.m-ground { fill: #ece5d3; }
.m-zone { fill: #f4efe2; stroke: #b5a888; stroke-width: 2; stroke-dasharray: 8 5; }
.m-zone-yard { fill: #e6dcc1; }
.m-zone-lift { fill: #e9e4d6; }
.m-zone-waste { fill: #e2e8d6; }
.m-zone-assembly { fill: #efe9d6; }
.m-zone-rest { fill: #e9e5dc; }
.m-site-road { fill: #c4c2bc; }
.m-walk { fill: #d7ecd0; stroke: #3f8f3a; stroke-width: 3; }
.m-scaffold { fill: url(#pat-hatch); stroke: #8a7f6a; stroke-width: 2; }
.m-building { fill: #cfd3d8; stroke: #5f666e; stroke-width: 3; }
.m-floor { fill: #e4e6e9; stroke: #8f969d; stroke-width: 2; }
.m-rebar-grid { fill: url(#pat-rebar); }
.m-column { fill: #6f767e; }
.m-office { fill: #f7f3e8; stroke: #6f6a5c; stroke-width: 3; }
.m-fence { fill: none; stroke: #3d3d3d; stroke-width: 7; }
.m-post { fill: #3d3d3d; }
.m-barricade { fill: rgba(200, 70, 20, .07); stroke: #c2410c; stroke-width: 3; stroke-dasharray: 12 7; }
.m-boom { stroke: #8a6d1c; stroke-width: 7; stroke-linecap: round; }
.m-hook { stroke: #444; stroke-width: 2; }
.m-load { fill: #8b3a2b; stroke: #5a2219; stroke-width: 1.5; }
.m-pipe { stroke: #8f99a3; stroke-width: 4; stroke-linecap: round; }
.m-rail { stroke: #4b5563; stroke-width: 5; stroke-linecap: round; }
.m-rail-post { fill: #4b5563; }
.m-rebar-stock { stroke: #8b4a36; stroke-width: 3; stroke-linecap: round; }
.m-rebar-thick { stroke: #8b4a36; stroke-width: 3; }
.m-rebar-thin { stroke: #8b4a36; stroke-width: 2; }
.m-sleeper { fill: #9a7a52; }
.m-puddle { fill: #9fbfd3; opacity: .85; }
.m-mud { fill: #6e5236; }
.m-form { fill: #c9975a; stroke: #7a5a2c; stroke-width: 1; }
.m-spacer { fill: #444; }
.m-opening { fill: #2c2c2c; }
.m-bar { stroke: #d9480f; stroke-width: 4; stroke-dasharray: 10 5; }
.m-sign-fallen { fill: #f5d90a; stroke: #444; transform-box: fill-box; transform-origin: center; transform: rotate(25deg); }
.m-box { fill: #b88a52; stroke: #6b4d26; stroke-width: 1.5; }
.m-cover { fill: #c9975a; stroke: #7a5a2c; stroke-width: 2; }
.m-cone-base { fill: #f08a24; stroke: #b45309; stroke-width: 1.5; }
.m-cone-top { fill: #fff; }
.m-person-body { fill: #2f5f9e; stroke: #1c3a63; stroke-width: 1; }
.m-person-helmet { fill: #fff6d6; stroke: #333; stroke-width: 1.5; }
.m-worker-b .m-person-body { fill: #2e7d4f; }
.m-driver .m-person-body { fill: #6b6b6b; }
.m-guide .m-person-body { fill: #e85d04; }
.m-sleeve { fill: #e8e8e8; stroke: #555; stroke-width: 2; }
.m-stair { fill: #d8d2c4; stroke: #6f6a5c; stroke-width: 2; }
.m-stair-line { stroke: #6f6a5c; stroke-width: 2; }
.m-panel { fill: #9aa6b2; stroke: #3d4650; stroke-width: 2; }
.m-outrigger { stroke: #6b5a1c; stroke-width: 5; stroke-linecap: round; }
.m-crane-body { fill: #f2c94c; stroke: #8a6d1c; stroke-width: 2; }
.m-crane-cab { fill: #4b6584; }
.m-crane-turret { fill: #d9a520; stroke: #8a6d1c; stroke-width: 2; }
.m-truck { fill: #b9c7d6; stroke: #4b6584; stroke-width: 2; }
.m-truck-cab { fill: #4b6584; }
.m-boards { fill: #d4a76a; stroke: #7a5a2c; stroke-width: 1; }
.m-grate { fill: url(#pat-grate); stroke: #50575e; stroke-width: 2; }
.m-board { fill: #ffffff; stroke: #555; stroke-width: 2; }
.m-extinguisher { fill: #d62828; stroke: #7a1010; stroke-width: 1.5; }
.m-bench { fill: #9a7a52; }
.m-toilet { fill: #a8c5da; stroke: #4b6584; stroke-width: 2; }
.m-bin { fill: #a9b8a0; stroke: #4f6146; stroke-width: 2; }
.m-wood-piece { fill: #a0703a; }
.m-can { fill: #c0c0c0; stroke: #555; }
.m-lunchbox { fill: #f2f2f2; stroke: #777; }

.m-lbl-area, .m-lbl-sm, .m-lbl-tiny, .m-lbl-warn, .m-lbl-walk, .m-lbl-road2 {
  paint-order: stroke; stroke: rgba(255, 255, 255, .92); stroke-width: 4px; stroke-linejoin: round;
}
.m-lbl-area { font-size: 21px; font-weight: 700; fill: #2b2b2b; }
.m-lbl-sm { font-size: 16px; fill: #222; font-weight: 600; }
.m-lbl-tiny { font-size: 13.5px; fill: #222; font-weight: 600; }
.m-lbl-bin { font-size: 12.5px; fill: #222; font-weight: 600; paint-order: stroke; stroke: rgba(255, 255, 255, .92); stroke-width: 3px; }
.m-lbl-warn { font-size: 16px; font-weight: 700; fill: #9a3412; }
.m-lbl-walk { font-size: 16px; font-weight: 700; fill: #2c6b28; }
.m-lbl-road { font-size: 16px; fill: #fff; font-weight: 700; }
.m-lbl-road-sm { font-size: 14px; fill: #fff; font-weight: 700; }
.m-lbl-road2 { font-size: 16px; fill: #333; font-weight: 700; }
.m-lbl-gate { font-size: 20px; fill: #fff; font-weight: 700; }

.spot { cursor: pointer; outline: none; }
.spot-hit { fill: transparent; stroke: transparent; stroke-width: 3; }
.spot:hover .spot-hit { fill: rgba(29, 79, 145, .08); stroke: #1d4f91; stroke-dasharray: 6 4; }
.spot:focus-visible .spot-hit, .spot:focus .spot-hit { fill: rgba(240, 164, 0, .12); stroke: var(--focus); stroke-width: 5; stroke-dasharray: none; }
.spot.is-selected .spot-hit { fill: rgba(29, 79, 145, .12); stroke: #1d4f91; stroke-width: 5; stroke-dasharray: none; }
.spot-marker circle:first-child { fill: #fff; stroke: #1d4f91; stroke-width: 2.5; }
.spot-marker .lens { fill: none; stroke: #1d4f91; stroke-width: 2.5; stroke-linecap: round; }
.spot-badge text { font-size: 17px; font-weight: 700; fill: #fff; }
.badge-answered circle { fill: #1e6b34; stroke: #fff; stroke-width: 2.5; }
.badge-review polygon { fill: #b26a00; stroke: #fff; stroke-width: 2.5; }
.hint-range circle { fill: rgba(29, 95, 168, .08); stroke: #1d5fa8; stroke-width: 4; stroke-dasharray: 12 8; }
.hint-range text { font-size: 16px; font-weight: 700; fill: #1d5fa8; paint-order: stroke; stroke: #fff; stroke-width: 4px; }

/* ---------- 3D 表示（js/ui/map3d.js） ---------- */
.map-box.is-3d { padding: 0; overflow: hidden; }
.map-box.zoomed.is-3d { overflow: hidden; max-height: none; }
.mode-switch { display: inline-flex; align-items: center; gap: .3rem; }
.mode-label { font-weight: 700; }
.view3d { position: relative; }
.v3d-stage { position: relative; height: clamp(380px, 64vh, 680px); overflow: hidden; border-radius: var(--radius) var(--radius) 0 0;
  background: linear-gradient(180deg, #c6dbef 0%, #e2ecf5 42%, #eef1ec 100%); user-select: none; -webkit-user-select: none; }
.map-box.zoomed .v3d-stage { height: 88vh; }
.view3d-focus .v3d-stage { height: clamp(260px, 44vh, 460px); }
.view3d.big .v3d-stage { height: 60vh; }
.v3d-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: grab; outline: none; }
.v3d-stage canvas:active { cursor: grabbing; }
.v3d-stage canvas:focus-visible { box-shadow: inset 0 0 0 4px var(--focus); }
.v3d-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.l3d { position: absolute; left: 0; top: 0; white-space: nowrap; font-size: .78rem; line-height: 1.25; color: #1f2933;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 2px #fff; }
.l3d-area { font-size: .88rem; font-weight: 700; background: rgba(255, 255, 255, .85); border: 1px solid rgba(31, 41, 51, .2); padding: .05rem .45rem; border-radius: 6px; text-shadow: none; }
.l3d-walk { font-weight: 700; color: #155d27; }
.l3d-road { font-weight: 700; color: #fff; text-shadow: 0 0 3px #222, 0 0 2px #222; }
.l3d-warn { font-weight: 700; color: #b42318; }
.l3d-board { font-size: .72rem; font-weight: 700; color: #1d4f91; text-shadow: none; }
.l3d-bin { font-size: .72rem; font-weight: 700; text-shadow: none; background: #fff; border: 1px solid #555; padding: 0 .25rem; }
.spot3d { position: absolute; left: 0; top: 0; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: transparent; opacity: 0; pointer-events: none; }
.spot3d:focus, .spot3d:focus-visible { opacity: 1; outline: 4px solid var(--focus); outline-offset: 2px; background: rgba(240, 164, 0, .3); }
.spot3d-tip { position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%); white-space: nowrap; background: #1f2933; color: #fff; font-size: .85rem; font-weight: 700; padding: .15rem .55rem; border-radius: 6px; }
.v3d-labels .spot-badge { position: absolute; left: 0; top: 0; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 15px; }
.v3d-labels .badge-answered { background: #1e6b34; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.v3d-labels .badge-review { width: 30px; height: 30px; background: #b26a00; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.spot-marker3d { position: absolute; left: 0; top: 0; line-height: 0; }
.hint3d { position: absolute; left: 0; top: 0; white-space: nowrap; font-size: .8rem; font-weight: 700; color: #1d5fa8; background: rgba(255, 255, 255, .92); border: 2px dashed #1d5fa8; border-radius: 6px; padding: 0 .4rem; }
.v3d-controls { display: flex; flex-wrap: wrap; gap: .3rem .7rem; padding: .45rem .5rem; background: var(--surface); border-top: 1px solid var(--line); }
.view3d-focus .v3d-controls, .view3d.big .v3d-controls { border: 0; padding: .4rem 0 0; }
.v3d-group { display: inline-flex; gap: .25rem; }
.view3d-focus .v3d-pan { display: none; }
[hidden] { display: none !important; } /* display を指定した部品でも、hidden を付けたら隠す */

/* 歩いて見る（人を動かす） */
.l3d-me { font-size: .8rem; font-weight: 700; color: #fff; background: #0f7d76; border: 2px solid #fff; border-radius: 999px; padding: 0 .5rem; text-shadow: none; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.l3d-room { font-size: .76rem; font-weight: 700; background: rgba(255, 255, 255, .9); border: 1px solid rgba(31, 41, 51, .25); border-radius: 4px; padding: 0 .3rem; text-shadow: none; }
.walk-ui { position: absolute; inset: 0; pointer-events: none; }
.walk-place { position: absolute; left: .5rem; top: .5rem; margin: 0; max-width: calc(100% - 11rem); background: rgba(255, 255, 255, .94); border: 1px solid rgba(31, 41, 51, .25); border-radius: 8px; padding: .15rem .6rem; font-size: .92rem; }
.walk-place-label { color: var(--ink-2); }
.walk-floor { position: absolute; right: .5rem; top: .45rem; pointer-events: auto; }
.walk-floor .walk-go { font-weight: 700; border-width: 2px; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); }
.l3d-guide { font-size: .78rem; font-weight: 700; color: #5c3d00; background: #fff4cc; border: 1px solid #b7791f; border-radius: 4px; padding: 0 .3rem; text-shadow: none; }
.walk-toast { position: absolute; left: 50%; top: 3rem; transform: translateX(-50%); width: max-content; max-width: min(92%, 36rem); margin: 0; background: #1f2933; color: #fff; border-radius: 8px; padding: .45rem .9rem; font-size: .92rem; line-height: 1.5; opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
.walk-toast.show { opacity: .96; visibility: visible; }
.walk-toast.warn { background: #8a1c12; }
.walk-near { position: absolute; left: .5rem; bottom: .6rem; max-width: calc(100% - 12rem); pointer-events: auto; display: flex; flex-wrap: wrap; gap: .3rem .6rem; align-items: center; background: rgba(255, 255, 255, .96); border: 2px solid var(--primary); border-radius: 10px; padding: .3rem .4rem .3rem .8rem; font-weight: 700; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.walk-pad { position: absolute; right: .6rem; bottom: .6rem; display: grid; grid-template-columns: repeat(3, 2.9rem); grid-template-rows: repeat(3, 2.9rem); pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none; }
.walk-pad button { font: inherit; font-size: 1.1rem; border: 2px solid #1f2933; border-radius: 10px; background: rgba(255, 255, 255, .92); color: #1f2933; cursor: pointer; padding: 0; touch-action: none; }
.walk-pad button:hover { background: #fff; }
.walk-pad button.is-down, .walk-pad button:active { background: var(--primary); color: #fff; border-color: var(--primary); }
.walk-pad button:focus-visible { outline: 4px solid var(--focus); outline-offset: 1px; }
.walk-pad .pad-f { grid-column: 2; grid-row: 1; }
.walk-pad .pad-l { grid-column: 1; grid-row: 2; font-size: 1.45rem; }
.walk-pad .pad-r { grid-column: 3; grid-row: 2; font-size: 1.45rem; }
.walk-pad .pad-b { grid-column: 2; grid-row: 3; }
.view3d.is-eye .v3d-tp { display: none; }
@media (max-width: 600px) {
  .walk-pad { grid-template-columns: repeat(3, 2.6rem); grid-template-rows: repeat(3, 2.6rem); }
  .walk-near { max-width: calc(100% - 9.5rem); font-size: .9rem; }
}

/* ---------- 問題 ---------- */
.crumb { margin: .2rem 0; }
.q-head h1 { margin: .1rem 0 .3rem; }
.q-kind { color: var(--muted); font-weight: 700; margin: 0; }
.q-meta { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .2rem 1rem; margin: .5rem 0; }
.q-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 1.4rem; align-items: start; }
.scene-figure { margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .4rem; }
.sitemap-crop { max-height: 52vh; }
.scene-figure.big .sitemap-crop { max-height: 62vh; }
.scene-figure figcaption { font-size: .88rem; color: var(--ink-2); padding: .3rem .3rem 0; }
.scene-drill { background: var(--surface-2); border: 1px dashed var(--line); border-radius: var(--radius); padding: .6rem 1rem; }
.scene-label { font-weight: 700; margin: 0; }
.situation { background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--primary); border-radius: var(--radius); padding: .4rem 1.1rem .8rem; margin: 0 0 .8rem; font-size: 1.04rem; }
.q-scene-col { position: sticky; top: 6rem; }
@media (max-width: 1080px) { .q-scene-col { position: static; } }
.situation h2 { margin-top: .5rem; }
.hint-box { margin: .6rem 0; }
.hint-text { background: var(--info-bg); border-radius: 8px; padding: .5rem .8rem; }
.q-question { font-size: 1.2rem; margin-top: .2rem; }
.format-caution { background: var(--warn-bg); border: 2px solid #c98a1b; border-radius: 8px; padding: .4rem .8rem; font-weight: 700; }
.answer-form fieldset { border: none; padding: 0; margin: 0 0 1rem; }
.answer-form legend { font-weight: 700; margin-bottom: .3rem; }
.choices { display: grid; gap: .55rem; }
.choice { display: grid; grid-template-columns: auto auto 1fr; gap: .55rem; align-items: start; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: .7rem .9rem; cursor: pointer; }
.choice:hover { border-color: var(--primary); }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 0 0 0 1px var(--primary); }
.choice input { width: 1.25rem; height: 1.25rem; margin-top: .25rem; }
.letter { display: inline-grid; place-items: center; min-width: 1.8rem; height: 1.8rem; border-radius: 6px; background: var(--ink); color: #fff; font-weight: 700; }
.note-field label { display: block; font-weight: 700; margin-bottom: .2rem; }
.note-field textarea { width: 100%; font: inherit; border: 1.5px solid var(--line); border-radius: 8px; padding: .5rem; background: var(--surface); }
.form-actions { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-top: .8rem; }
.form-actions .btn { min-width: 10rem; font-size: 1.05rem; }

.summary-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .4rem 1.1rem 1rem; }
.result-banner { display: flex; gap: 1rem; align-items: flex-start; border-radius: var(--radius); padding: .8rem 1.1rem; border: 2px solid; margin: .8rem 0; }
.result-banner h2 { margin: .1rem 0 .3rem; }
.result-banner.outcome-correct { background: var(--ok-bg); border-color: var(--ok); }
.result-banner.outcome-partial { background: var(--mid-bg); border-color: #c98a1b; }
.result-banner.outcome-incorrect { background: var(--ng-bg); border-color: var(--ng); }
.result-icon { font-size: 2.2rem; line-height: 1; font-weight: 700; }
.outcome-correct .result-icon { color: var(--ok); }
.outcome-partial .result-icon { color: var(--mid); }
.outcome-incorrect .result-icon { color: var(--ng); }
.my-note { background: var(--surface-2); border-radius: 8px; padding: .4rem .8rem; }
.review-ctrl { display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: center; background: var(--surface); border: 1px dashed var(--line); border-radius: 8px; padding: .3rem .8rem; margin: .6rem 0; }
.after-actions { display: flex; flex-wrap: wrap; gap: .2rem; margin: .8rem 0; }

.explanation { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .4rem 1.2rem 1rem; margin-top: 1rem; }
.explanation > h2 { margin-top: .6rem; }
.ex-sec { border-top: 1px solid var(--line); padding-top: .2rem; }
.ex-num { display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--primary); color: #fff; font-size: .95rem; margin-right: .5rem; }
.checklist { list-style: none; padding-left: .2rem; }
.checklist li::before { content: "□ "; font-weight: 700; color: var(--primary); }
.your-choice { background: var(--primary-soft); border-radius: 8px; padding: .3rem .9rem .6rem; }
.criteria { background: var(--surface-2); border-radius: 8px; padding: .5rem .8rem; margin: .6rem 0; }
.choice-ex-list { list-style: none; padding: 0; display: grid; gap: .5rem; }
.choice-ex { border: 1px solid var(--line); border-radius: 8px; padding: .4rem .8rem; background: var(--surface); }
.choice-ex.is-selected { border: 2px solid var(--primary); }
.choice-ex-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin: .2rem 0; }
.choice-ex-text { font-weight: 700; }
.you { font-size: .82rem; font-weight: 700; color: var(--primary); border: 1.5px solid var(--primary); border-radius: 999px; padding: 0 .5rem; background: #fff; }
.company { background: #f3f0fa; border: 2px solid #6b3fa0; border-radius: 8px; padding: .3rem 1rem .6rem; margin: .8rem 0; }
.company-label { font-weight: 700; color: #4b2a78; }
.term-list li { margin: .2rem 0; }
.material-info { font-size: .92rem; }

/* 用語ボタンと説明 */
.term { font: inherit; background: none; border: none; padding: 0; color: inherit; border-bottom: 2px dotted var(--primary); cursor: help; }
.term:hover, .term[aria-expanded="true"] { background: var(--primary-soft); }
.term-sample { border-bottom: 2px dotted var(--primary); }
.term-pop { position: absolute; z-index: 50; max-width: 340px; background: var(--surface); border: 2px solid var(--primary); border-radius: 10px; padding: .5rem .9rem; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); font-size: .95rem; }
.tp-term { font-weight: 700; margin: 0; }
.tp-read { font-weight: 400; color: var(--muted); font-size: .85rem; }
.tp-actions { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: 0; }

/* ---------- ドリル ---------- */
.review-box { background: var(--mid-bg); border: 2px solid #c98a1b; border-radius: var(--radius); padding: .3rem 1.2rem .8rem; margin: 1rem 0; }
.review-box h2 { margin-top: .6rem; }
.review-list { margin: .3rem 0; }
.drill-list { list-style: none; padding: 0; display: grid; gap: .6rem; }
.drill-card { display: grid; grid-template-columns: 1fr auto; gap: .5rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem 1rem; align-items: center; }
.drill-card h3 { margin: .1rem 0; }
.drill-side { text-align: right; }

/* ---------- 辞典 ---------- */
.gloss-tools { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; margin: .8rem 0; }
.gloss-tools input, .gloss-tools select { font: inherit; padding: .45rem .6rem; border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface); min-height: 2.6rem; }
.gloss-tools input { min-width: 16rem; }
.gloss-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 1rem; align-items: start; }
.gloss-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; max-height: 75vh; overflow: auto; }
.gloss-list a { display: grid; grid-template-columns: auto 1fr; gap: 0 .5rem; align-items: baseline; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .4rem .7rem; text-decoration: none; color: var(--ink); }
.gloss-list a.is-current { border: 2px solid var(--primary); background: var(--primary-soft); }
.g-term { font-weight: 700; }
.g-read { color: var(--muted); font-size: .85rem; font-weight: 400; }
.g-short { grid-column: 1 / -1; font-size: .88rem; color: var(--ink-2); }
.gloss-list a.has-thumb { grid-template-columns: 64px auto 1fr; align-items: start; }
.g-thumb { grid-row: 1 / span 2; position: relative; width: 64px; height: 48px; }
.g-thumb img { display: block; width: 64px; height: 48px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: #e6f0f7; }
.g-ai { position: absolute; right: 2px; bottom: 2px; font-size: .62rem; font-weight: 700; line-height: 1; color: #fff; background: rgba(31, 35, 40, .82); border-radius: 3px; padding: 2px 3px; }
.g-figure.is-ai { width: min(42%, 240px); }
.gloss-list a.has-thumb .g-short { grid-column: 2 / -1; }
.g-figure { float: right; width: min(42%, 320px); margin: .2rem 0 .8rem 1.2rem; }
.g-figure img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.g-figure figcaption { font-size: .78rem; color: var(--muted); margin-top: .3rem; line-height: 1.5; }
.gloss-detail::after { content: ""; display: block; clear: both; }
.tp-img { float: left; position: relative; width: 96px; height: 72px; margin: .2rem .7rem .3rem 0; }
.tp-img img { display: block; width: 96px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.tp-actions { clear: both; }
.gloss-detail { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .4rem 1.2rem 1rem; }
.gloss-detail h2 { margin-top: .2rem; }
.g-short-big { font-size: 1.1rem; font-weight: 700; }
.gloss-empty { padding: 2rem; text-align: center; }

/* ---------- 結果・管理 ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .7rem; margin: .6rem 0 1rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem 1rem; }
.stat-title { font-size: .9rem; color: var(--ink-2); font-weight: 700; margin: 0; }
.stat-value { font-size: 1.4rem; font-weight: 700; margin: .2rem 0; }
.stat-sub { font-size: .85rem; color: var(--muted); margin: 0; }
.page-nav ul { display: flex; flex-wrap: wrap; gap: .3rem; list-style: none; padding: 0; margin: .6rem 0; }
.page-nav a { display: inline-block; padding: .25rem .7rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); text-decoration: none; font-size: .9rem; }
.page-nav a:hover { border-color: var(--primary); }

/* ---------- 集合研修 ---------- */
.group-pick li { margin: .3rem 0; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.group-toolbar { display: flex; flex-wrap: wrap; gap: .3rem .5rem; align-items: center; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.group-head h1 { font-size: 2rem; margin: .2rem 0; }
.group-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.group-main > .group-text:only-child { grid-column: 1 / -1; }
.group-text { font-size: 1.15rem; }
.group-text h2 { margin-top: .2rem; }
.group-question { font-size: 1.35rem; font-weight: 700; background: var(--primary-soft); border-left: 6px solid var(--primary); padding: .5rem .9rem; border-radius: 8px; }
.group-steps { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0; }
.group-steps .btn { font-size: 1.05rem; min-height: 3rem; }
.discussion { background: #fffbe8; border: 2px solid #c98a1b; border-radius: var(--radius); padding: .3rem 1.2rem .8rem; font-size: 1.2rem; }
.discussion li { margin: .4rem 0; }
.group-choices ul { list-style: none; padding: 0; display: grid; gap: .5rem; }
.group-choice { font: inherit; font-size: 1.12rem; text-align: left; width: 100%; display: grid; grid-template-columns: auto 1fr auto; gap: .6rem; align-items: start; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: .7rem 1rem; cursor: pointer; color: var(--ink); }
.group-choice.is-on { border-color: var(--primary); background: var(--primary-soft); }

/* ---------- タブレット・狭い画面 ---------- */
@media (max-width: 1080px) {
  .explore-layout { grid-template-columns: 1fr; }
  .explore-panel { position: static; max-height: none; }
  .q-layout { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .status-board { grid-template-columns: 1fr; }
  .gloss-layout { grid-template-columns: 1fr; }
  .gloss-list { max-height: 40vh; }
  .g-figure { float: none; width: auto; max-width: 320px; margin: .4rem 0 .8rem; }
  .group-main, .two-col { grid-template-columns: 1fr; }
  .settings { margin-left: 0; }
  .site-header { position: static; }
  .kv { grid-template-columns: 1fr; }
  .kv dt { margin-top: .4rem; }
  .drill-card { grid-template-columns: 1fr; }
  .drill-side { text-align: left; }
}
@media (max-width: 560px) {
  html { font-size: 16px; }
  .main { padding: .6rem .8rem 2rem; }
  h1 { font-size: 1.45rem; }
}

@media print {
  .site-header, .site-footer, .after-actions, .map-toolbar, .group-toolbar, .group-steps { display: none !important; }
  body { background: #fff; }
}
