/* 経営者の鍛錬場 — 黒×白銀。計器盤のような静かな高級感。外部フォント・外部通信なし */
:root {
  --bg: #05080d; --surface: #0b1018; --surface2: #111826;
  --ink: #eef2f8; --sub: #b0bbcb; --dim: #8e9aae;
  --hair: rgba(214, 226, 245, .15); --hair2: rgba(214, 226, 245, .32);
  --silver: #e4ecf8; --silver2: #aeb9ca;
  --up: #86cfa6; --down: #de9494; --warnc: #d9bd86;
  --c: #aeb9ca;                                  /* 柱の色(点・細い線だけに使う) */
  --radius: 10px;
  --num: "SF Pro Display", "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; color-scheme: dark; background: var(--bg); }
body {
  margin: 0; color: var(--ink); background: var(--bg); position: relative; isolation: isolate;
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "BIZ UDPGothic", "Meiryo", system-ui, sans-serif;
  font-size: 16px; line-height: 1.85; min-height: 100vh;
  line-break: strict; overflow-wrap: break-word; word-break: auto-phrase;
}
/* 背景は画面に固定した1枚の層。継ぎ目(横帯)が出ない */
body::before, body::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; }
body::before {
  background-image:
    linear-gradient(rgba(214, 226, 245, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(214, 226, 245, .035) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 20%, transparent 100%);
  mask-image: radial-gradient(ellipse 80% 70% at 50% 30%, #000 20%, transparent 100%);
}
body::after {
  background:
    radial-gradient(60vmax 40vmax at 20% 10%, rgba(150, 175, 215, .09), transparent 70%),
    radial-gradient(50vmax 40vmax at 85% 90%, rgba(120, 150, 200, .07), transparent 70%);
  animation: drift 26s ease-in-out infinite alternate;
}
main { max-width: 640px; margin: 0 auto; padding: calc(22px + env(safe-area-inset-top)) 20px calc(120px + env(safe-area-inset-bottom)); }
h1, h2, h3 { font-weight: 600; line-height: 1.45; margin: 0; text-wrap: balance; letter-spacing: .03em; }
h1 { font-size: 1.5rem; margin: 6px 0 6px; }
h2 { font-size: .98rem; margin: 36px 0 14px; display: flex; align-items: center; gap: 12px; color: var(--silver); }
h2::after { content: ""; flex: 1; height: 1px; background: var(--hair); }
p { margin: 0 0 .9em; text-wrap: pretty; }
a { color: var(--silver); }
b { font-weight: 600; }
.sub { color: var(--sub); font-size: .9rem; }
.dim { color: var(--dim); }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; font-weight: 500; letter-spacing: .03em; }
.thin { font-weight: 200; letter-spacing: .06em; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.eyebrow { font-size: .7rem; letter-spacing: .34em; color: var(--dim); margin: 0; font-weight: 500; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }

/* 面: 線だけのカード。角に小さなブラケット */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius);
  padding: 20px; margin: 16px 0;
}
.card::before, .card::after, .pcard::before, .pcard::after, .scenario::before, .scenario::after {
  content: ""; position: absolute; width: 11px; height: 11px; pointer-events: none; border: 0 solid var(--hair2);
}
.card::before, .pcard::before, .scenario::before { left: -1px; top: -1px; border-left-width: 1px; border-top-width: 1px; border-top-left-radius: 3px; }
.card::after, .pcard::after, .scenario::after { right: -1px; bottom: -1px; border-right-width: 1px; border-bottom-width: 1px; border-bottom-right-radius: 3px; }
.card.glow { border-color: var(--hair2); }

/* ボタン(タップ領域 44px 以上) */
button, .btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px; padding: 12px 20px;
  border-radius: 8px; border: 1px solid var(--hair2); background: transparent; color: var(--ink);
  font: inherit; font-weight: 500; letter-spacing: .05em; text-align: center; text-decoration: none; cursor: pointer; touch-action: manipulation;
  transition: transform .12s ease, background .2s ease, border-color .2s ease;
}
button:hover, .btn:hover { border-color: var(--silver); }
button:active, .btn:active { transform: scale(.985); }
button:focus-visible, .btn:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--silver); outline-offset: 2px; }
button.primary, .btn.primary { border: 0; color: #060a10; background: linear-gradient(180deg, #f6f9ff, #c3cddd); font-weight: 600; }
button.hero { min-height: 62px; font-size: 1.08rem; letter-spacing: .12em; }
button.danger { color: var(--down); border-color: rgba(222, 148, 148, .5); }
button:disabled { color: var(--dim); background: transparent; border: 1px solid var(--hair); cursor: default; }
button.primary:disabled { background: transparent; color: var(--dim); border: 1px solid var(--hair2); }
button + button, .btn + .btn, .btn + button, button + .btn { margin-top: 12px; }
button.small { width: auto; min-height: 44px; padding: 8px 16px; display: inline-flex; margin: 0; }
a.back { display: inline-flex; align-items: center; min-height: 44px; color: var(--sub); text-decoration: none; letter-spacing: .05em; }

/* 下のタブ */
nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center;
  padding: 0 max(8px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(8px, env(safe-area-inset-left));
  background: rgba(5, 8, 13, .94); border-top: 1px solid var(--hair);
}
nav[hidden] { display: none; }
nav a { position: relative; flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 58px; color: var(--dim); text-decoration: none; font-size: .72rem; letter-spacing: .08em; }
nav svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
nav a.on { color: var(--ink); }
nav a.on::after { content: ""; position: absolute; left: 28%; right: 28%; bottom: 6px; height: 1px; background: var(--silver); }

/* ホーム: 進捗リング(主役の光) */
.mission { text-align: center; padding: 14px 16px 16px; position: relative; overflow: hidden; }
.mission::before { content: none; }
.sweep { position: absolute; top: 0; bottom: 0; width: 30%; left: -40%; pointer-events: none; background: linear-gradient(100deg, transparent, rgba(220, 232, 252, .06), transparent); animation: sweep 9s ease-in-out infinite; }
.ring { width: 188px; height: 188px; display: block; margin: 0 auto; overflow: visible; }
.ring .tick { stroke: rgba(214, 226, 245, .28); stroke-width: 1; }
.ring .tick.big { stroke: rgba(214, 226, 245, .5); stroke-width: 1.4; }
.ring .seg { fill: none; stroke-width: 3; stroke-linecap: butt; stroke: rgba(214, 226, 245, .14); }
.ring .seg.on { stroke: var(--silver); filter: drop-shadow(0 0 5px rgba(228, 236, 248, .75)); animation: segIn .7s ease both; }
.ring text { fill: var(--ink); text-anchor: middle; }
.mission-label { margin: 0; font-size: .92rem; color: var(--sub); letter-spacing: .06em; }

.pgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 16px 0; }
.pcard {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; min-height: 124px; padding: 16px;
  border-radius: var(--radius); color: var(--ink); text-decoration: none;
  background: var(--surface); border: 1px solid var(--hair);
}
.pcard .dot { position: absolute; right: 14px; top: 14px; }
.pcard .ico { width: 28px; height: 28px; fill: none; stroke: var(--silver2); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.pcard .nm { font-weight: 600; line-height: 1.4; font-size: .96rem; letter-spacing: .03em; }
.pcard .st { font-size: .8rem; color: var(--sub); margin-top: 2px; }
.pcard.todo:hover { border-color: var(--hair2); }
.pcard.done { background: var(--surface2); border-color: var(--hair2); }
.pcard.done .ico { stroke: var(--silver); }
.pcard.done .st { color: var(--ink); }
.pcard.wait { border-style: dashed; border-color: var(--hair2); }
.pcard.none { opacity: .5; pointer-events: none; }
.pcard .chk { position: absolute; right: 12px; bottom: 12px; width: 18px; height: 18px; }
.pcard .chk svg { width: 100%; height: 100%; fill: none; stroke: var(--silver); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 16px; border-radius: 99px; border: 1px solid var(--hair2); color: var(--ink); text-decoration: none; font-size: .88rem; }

/* スタンプ: 未押し=点線の輪 / 押印=白銀の輪と刻印 */
.stamps { display: grid; gap: 10px; margin-top: 16px; }
.stamp { position: relative; aspect-ratio: 1; border-radius: 50%; border: 1px dotted rgba(214, 226, 245, .4); display: grid; place-items: center; }
.stamp svg { width: 46%; height: 46%; fill: none; stroke: #2a3345; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.stamp.on {
  border: 1px solid var(--silver);
  background: radial-gradient(circle at 35% 30%, #232c3c, #0c121c 70%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, .22), inset 0 -2px 4px rgba(0, 0, 0, .7), 0 0 0 3px rgba(5, 8, 13, 1), 0 0 0 4px rgba(214, 226, 245, .22);
}
.stamp.on::after { content: ""; position: absolute; inset: 18%; border-radius: 50%; border: 1px solid rgba(214, 226, 245, .35); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .8); }
.stamp.on svg { opacity: 1; stroke: var(--silver); stroke-width: 1.8; z-index: 1; }
.stamp.drop { animation: drop .7s cubic-bezier(.2, .9, .3, 1.15) both; }

/* 進捗バー: 細い白銀 */
.bar { height: 3px; background: rgba(214, 226, 245, .14); border-radius: 3px; overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #aeb9ca, #f4f8ff); transition: width .9s cubic-bezier(.2, .8, .2, 1); }

/* タグ(彩度を抑える) */
.tag { display: inline-block; white-space: nowrap; word-break: keep-all; overflow-wrap: normal; flex: none; font-size: .72rem; line-height: 1.8; padding: 0 9px; border-radius: 4px; border: 1px solid var(--hair2); color: var(--sub); margin: 0 6px 0 0; vertical-align: middle; letter-spacing: .05em; }
.tag.ok { color: var(--up); border-color: rgba(134, 207, 166, .45); }
.tag.warn { color: var(--down); border-color: rgba(222, 148, 148, .5); }
.tag.gold { color: var(--silver); border-color: var(--silver2); }
.tag.fict { color: var(--sub); border-style: dashed; }

/* 問題画面 */
.qtop { height: 2px; border-radius: 2px; background: var(--c); opacity: .85; margin: 0 0 14px; }
.ticks { display: inline-flex; gap: 3px; align-items: center; vertical-align: middle; }
.ticks i { display: block; width: 8px; height: 14px; border: 1px solid rgba(214, 226, 245, .35); border-radius: 1px; }
.ticks i.on { background: var(--silver); border-color: var(--silver); }
.scenario { position: relative; background: var(--surface); border: 1px solid var(--hair); padding: 20px; border-radius: var(--radius); margin: 16px 0 22px; font-size: 1.02rem; }
.choice {
  justify-content: flex-start; align-items: flex-start; text-align: left; gap: 14px; min-height: 64px; margin: 12px 0; padding: 16px;
  font-weight: 400; letter-spacing: .02em; line-height: 1.75; background: var(--surface); border-color: var(--hair);
}
.choice .k { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(214, 226, 245, .4); margin-top: 4px; position: relative; }
.choice.sel { border-color: #fff; background: var(--surface2); box-shadow: 0 0 0 1px rgba(255, 255, 255, .7), 0 0 26px rgba(214, 228, 252, .22); animation: pop .28s ease; }
.choice.sel .k { border-color: #fff; }
.choice.sel .k::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #fff; }
textarea, input[type=password], input[type=number], input[type=text], select {
  width: 100%; font: inherit; padding: 14px; color: var(--ink); background: #070b12;
  border: 1px solid var(--hair2); border-radius: 8px;
}
textarea { min-height: 200px; resize: vertical; line-height: 1.8; }
label { display: block; font-size: .9rem; margin: 18px 0 6px; color: var(--sub); }
.count { text-align: right; font-size: .85rem; color: var(--sub); margin: 4px 0 12px; }
.pick { margin: 12px 0; padding: 14px 16px; border-radius: 8px; border: 1px solid var(--hair); background: var(--surface); }

/* 採点結果 */
.scorebox { text-align: center; padding: 26px 16px 22px; }
.score { font-size: 5rem; line-height: 1; color: #fff; font-family: var(--num); font-weight: 200; letter-spacing: .04em; text-shadow: 0 0 28px rgba(214, 228, 252, .45); font-variant-numeric: tabular-nums; }
.score small { font-size: 1.1rem; color: var(--sub); text-shadow: none; font-weight: 300; }
.meter { display: flex; justify-content: center; gap: 6px; margin: 16px 0 6px; }
.meter i { display: block; width: 34px; height: 8px; border: 1px solid rgba(214, 226, 245, .35); border-radius: 1px; }
.meter i.lit { background: var(--silver); border-color: var(--silver); box-shadow: 0 0 10px rgba(228, 236, 248, .7); animation: tickIn .45s ease both; animation-delay: calc(var(--i) * .2s + .8s); }
.xp { margin-top: 18px; text-align: left; }
.xp .gain { color: #fff; font-size: 1.3rem; }
.notice { background: rgba(214, 226, 245, .05); border: 1px solid var(--hair2); border-radius: 8px; padding: 14px 16px; margin: 14px 0; }
.notice.warn { border-color: rgba(222, 148, 148, .55); background: rgba(222, 148, 148, .06); }
.notice.neon { border-color: var(--silver2); }
ul.list { margin: 4px 0 0; padding-left: 1.3em; }
ul.list li { margin: 8px 0; }
details { border: 1px solid var(--hair); border-radius: 8px; margin: 10px 0; background: var(--surface); }
details[open] { border-color: var(--hair2); }
summary { list-style: none; cursor: pointer; padding: 12px 16px; min-height: 48px; display: flex; gap: 10px; align-items: flex-start; line-height: 1.65; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "＋"; margin-left: auto; color: var(--sub); flex: none; }
details[open] > summary::after { content: "－"; }
details .why { padding: 0 16px 16px; color: var(--sub); font-size: .95rem; }
.best-card { border-color: var(--silver2); }
.radio { display: flex; gap: 12px; align-items: center; min-height: 48px; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--hair); margin: 8px 0; cursor: pointer; background: var(--surface); color: var(--ink); font-size: .95rem; }
.radio input { width: 22px; height: 22px; accent-color: #fff; flex: none; }

/* 演出の重ね: レベルアップ(光が横切る) / スタンプ完成(光が輪を一周) */
.overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; text-align: center; background: rgba(4, 6, 10, .93); animation: ovl 1.9s ease both; overflow: hidden; }
.overlay .beam { position: absolute; top: 0; bottom: 0; width: 38%; left: -45%; background: linear-gradient(100deg, transparent, rgba(236, 243, 255, .5) 48%, rgba(255, 255, 255, .85) 50%, rgba(236, 243, 255, .5) 52%, transparent); filter: blur(6px); animation: beam 1.1s .15s cubic-bezier(.5, 0, .3, 1) both; }
.overlay .lab { font-size: .8rem; letter-spacing: .5em; color: var(--sub); margin: 0 0 6px; }
.overlay .lv { position: relative; height: 1.2em; font-size: clamp(4.4rem, 22vw, 7rem); font-family: var(--num); font-weight: 200; color: #fff; line-height: 1.2; text-shadow: 0 0 36px rgba(214, 228, 252, .6); }
.overlay .lv span { display: block; }
.overlay .lv .from { animation: outUp .45s .55s ease both; }
.overlay .lv .to { position: absolute; left: 0; right: 0; top: 0; opacity: 0; animation: inUp .55s .6s ease both; }
.overlay .small { margin-top: 18px; font-size: 1rem; color: var(--ink); letter-spacing: .1em; }
.overlay.long { animation-duration: 2.8s; }
.orbit { width: 200px; height: 200px; margin: 0 auto 8px; display: block; overflow: visible; }
.orbit circle.base { fill: none; stroke: rgba(214, 226, 245, .25); stroke-width: 1; }
.orbit circle.run { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 60 440; filter: drop-shadow(0 0 6px #fff); animation: run 1.6s linear 2; transform-origin: 100px 100px; }
.orbit text { fill: #fff; text-anchor: middle; }

/* 成績 */
.radar { width: 100%; max-width: 440px; display: block; margin: 0 auto; overflow: visible; }
.legend { display: flex; gap: 22px; justify-content: center; font-size: .82rem; color: var(--sub); margin-top: 8px; }
.legend i { display: inline-block; width: 22px; height: 0; border-top: 1.5px solid #fff; vertical-align: middle; margin-right: 8px; }
.legend i.dash { border-top: 1.5px dashed var(--silver2); }
.pillar-card { display: block; color: inherit; text-decoration: none; }
.pillar-card .head { display: flex; align-items: center; gap: 12px; }
.pillar-card .ico { width: 24px; height: 24px; fill: none; stroke: var(--silver2); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.up { color: var(--up); font-weight: 600; } .down { color: var(--down); font-weight: 600; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.hist { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--hair); font-size: .9rem; min-height: 44px; }

/* 管理・設定 */
.filters { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.filters button { flex: none; width: auto; min-height: 44px; padding: 6px 18px; margin: 0; }
.filters button.on { color: #060a10; background: var(--silver); border-color: var(--silver); font-weight: 600; }
.adm { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; min-height: 64px; padding: 14px 16px; margin: 10px 0; }
.kv { display: grid; grid-template-columns: 6.5em 1fr; gap: 8px 10px; font-size: .92rem; margin: 0; }
.kv dt { color: var(--sub); } .kv dd { margin: 0; overflow-wrap: anywhere; min-width: 0; }
.fieldset { border: 1px solid var(--hair); border-radius: var(--radius); padding: 6px 20px 20px; background: var(--surface); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.switch input { width: 28px; height: 28px; accent-color: #fff; flex: none; }

/* ボス戦(ホログラム風) */
.boss { text-align: center; padding: 30px 16px 26px; overflow: hidden; }
.boss svg { width: min(240px, 70%); height: auto; display: block; margin: 0 auto 10px; }
.boss .scan { animation: scan 5s linear infinite; }
.boss .eyes { animation: blink 4s ease-in-out infinite; }
.bosslink { display: flex; align-items: center; gap: 16px; text-decoration: none; color: var(--ink); }
.bosslink svg { width: 30px; height: 30px; fill: none; stroke: var(--silver2); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; flex: none; }

@keyframes drift { from { transform: translate3d(-2%, -1%, 0); opacity: .8; } to { transform: translate3d(2%, 2%, 0); opacity: 1; } }
@keyframes sweep { 0%, 55% { left: -40%; } 100% { left: 130%; } }
@keyframes pop { 0% { transform: scale(.985); } 60% { transform: scale(1.012); } 100% { transform: scale(1); } }
@keyframes drop { 0% { transform: translateY(-60px) scale(1.5); opacity: 0; } 55% { transform: translateY(0) scale(.94); opacity: 1; } 78% { transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes tickIn { 0% { opacity: .1; transform: scaleX(.3); } 100% { opacity: 1; transform: scaleX(1); } }
@keyframes segIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes ovl { 0% { opacity: 0; } 8% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; } }
@keyframes beam { from { left: -45%; } to { left: 115%; } }
@keyframes outUp { to { opacity: 0; transform: translateY(-40%); } }
@keyframes inUp { from { opacity: 0; transform: translateY(45%); } to { opacity: 1; transform: translateY(0); } }
@keyframes run { to { stroke-dashoffset: -500; } }
@keyframes scan { from { transform: translateY(-20px); opacity: 0; } 20% { opacity: .8; } 80% { opacity: .8; } to { transform: translateY(240px); opacity: 0; } }
@keyframes blink { 0%, 44%, 50%, 100% { opacity: 1; } 47% { opacity: .2; } }

/* 画面幅: スマホが主役。広い画面は中央の細い枠(背景は共通の1枚なので継ぎ目なし) */
@media (min-width: 560px) { .pgrid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) {
  main { max-width: 720px; padding: 36px 40px 140px; border-left: 1px solid var(--hair); border-right: 1px solid var(--hair); min-height: 100vh; }
  h1 { font-size: 1.7rem; }
  .ring { width: 210px; height: 210px; }
}

/* 演出を弱める(OS設定 または 設定画面のスイッチ) */
body.calm *, body.calm *::before, body.calm *::after { animation: none !important; transition: none !important; }
body.calm .meter i.lit, body.calm .overlay .lv .to { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .meter i.lit { opacity: 1; }
}

/* 柱アイコンの共通設定 */
.ico { width: 100%; height: auto; fill: none; stroke: var(--silver2); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* 図(表・グラフ・図解): 白銀の細い線。文字は12px以上、横スクロールなし */
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.fig { position: relative; margin: 16px 0 22px; padding: 16px; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); }
.ftitle { font-size: .82rem; color: var(--sub); letter-spacing: .08em; margin: 0 0 12px; }
.fcap { font-size: .82rem; color: var(--sub); margin: 12px 0 0; line-height: 1.7; }
.ftable { width: 100%; border-collapse: collapse; font-size: .86rem; line-height: 1.55; }
.ftable th, .ftable td { padding: 8px 6px; border-bottom: 1px solid var(--hair); text-align: left; vertical-align: top; font-weight: 400; }
.ftable thead th { color: var(--sub); font-size: .78rem; border-bottom-color: var(--hair2); }
.ftable .r { text-align: right; }
.ftable td.num { font-weight: 400; white-space: nowrap; }
.ftable tr.hd th { padding-top: 16px; color: var(--silver); font-size: .78rem; letter-spacing: .1em; border-bottom-color: var(--hair2); }
.fcompare .frow { padding: 10px 0; border-bottom: 1px solid var(--hair); }
.fcompare .frow:last-child { border-bottom: 0; }
.fcompare .fl { font-size: .78rem; color: var(--sub); letter-spacing: .08em; margin-bottom: 6px; }
.fcells { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 8px; }
.fcell { font-size: .86rem; line-height: 1.6; padding: 10px; border: 1px solid var(--hair); border-radius: 6px; }
.fcell .fh { display: block; font-size: .75rem; color: var(--dim); margin-bottom: 4px; }
@media (max-width: 420px) { .fcells { grid-template-columns: 1fr; } }
.fbars .fb { margin: 10px 0; } .fbl { font-size: .84rem; color: var(--sub); margin-bottom: 4px; }
.fbt { display: flex; align-items: center; gap: 8px; height: 24px; margin: 3px 0; background: rgba(214, 226, 245, .06); border-radius: 2px; }
.fbt i { display: block; flex: none; height: 100%; border-radius: 2px; background: linear-gradient(90deg, #7f8ba0, #e4ecf8); }
.fbt i.s1 { background: linear-gradient(90deg, #4a5468, #8e9aae); } .fbt i.s2 { background: #3a4356; }
.fbt span { font-size: .82rem; color: var(--ink); white-space: nowrap; }
.flegend { display: flex; gap: 16px; flex-wrap: wrap; font-size: .78rem; color: var(--sub); margin-bottom: 8px; }
.flegend i { display: inline-block; width: 18px; height: 8px; margin-right: 6px; border-radius: 1px; background: #e4ecf8; } .flegend i.s1 { background: #8e9aae; } .flegend i.s2 { background: #3a4356; }
.flegend i.l0 { height: 0; border-top: 1.5px solid #f4f8ff; background: none; } .flegend i.l1 { height: 0; border-top: 1.5px dashed #aeb9ca; background: none; } .flegend i.l2 { height: 0; border-top: 1.5px dotted #aeb9ca; background: none; }
.fline { width: 100%; height: auto; display: block; overflow: visible; } .funit { font-size: .75rem; color: var(--dim); text-align: right; }
.forg, .forg ul { list-style: none; margin: 0; padding: 0; }
.forg ul { margin-left: 14px; padding-left: 16px; border-left: 1px solid var(--hair2); }
.forg li { position: relative; margin: 8px 0; }
.forg ul > li::before { content: ""; position: absolute; left: -16px; top: 22px; width: 14px; border-top: 1px solid var(--hair2); }
.onode { display: inline-block; padding: 8px 12px; border: 1px solid var(--hair2); border-radius: 6px; background: var(--surface2); line-height: 1.5; font-size: .88rem; }
.onode span { display: block; font-size: .8rem; color: var(--sub); }
.fflow { list-style: none; margin: 0; padding: 0; }
.fflow li { position: relative; padding: 0 0 18px 26px; line-height: 1.6; font-size: .88rem; }
.fflow li::before { content: ""; position: absolute; left: 4px; top: 6px; width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--silver); background: var(--bg); }
.fflow li::after { content: ""; position: absolute; left: 8px; top: 18px; bottom: 0; border-left: 1px solid var(--hair2); }
.fflow li:last-child { padding-bottom: 0; } .fflow li:last-child::after { content: none; }
.fflow b { display: block; font-weight: 600; } .fflow span { color: var(--sub); font-size: .82rem; }

/* 判断のクセ: 細いスライダー。色分けはしない(点は白) */
.ax { border: 0; border-bottom: 1px solid var(--hair); border-radius: 0; background: none; margin: 0; }
.ax:last-child { border-bottom: 0; }
.ax summary { padding: 14px 0; }
.ax-body { padding: 0 0 18px; }
.ax-ends { display: flex; justify-content: space-between; font-size: .88rem; color: var(--ink); margin-bottom: 8px; }
.ax-track { position: relative; height: 24px; }
.ax-track::before { content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 1px; background: var(--hair2); }
.ax-track::after { content: ""; position: absolute; left: 0; right: 0; top: 6px; height: 11px; background: repeating-linear-gradient(90deg, var(--hair2) 0 1px, transparent 1px 25%); background-size: 25% 100%; border-right: 1px solid var(--hair2); }
.ax-dot { position: absolute; top: 4px; width: 15px; height: 15px; margin-left: -7.5px; border-radius: 50%; background: #fff; box-shadow: 0 0 12px rgba(214, 228, 252, .5); z-index: 1; }
.ax-q { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--hair); font-size: .9rem; }

/* ---- 問題文の固定(スマホ: 上に固定 / PC: 左の列に固定) ---- */
.coord { font-family: var(--num); font-size: .75rem; letter-spacing: .18em; color: var(--sub); font-weight: 400; white-space: nowrap; }
.ruler { height: 9px; margin: -8px 0 12px; opacity: .7;
  background:
    repeating-linear-gradient(90deg, rgba(214, 226, 245, .22) 0 1px, transparent 1px 8px) left bottom / 100% 4px no-repeat,
    repeating-linear-gradient(90deg, rgba(214, 226, 245, .5) 0 1px, transparent 1px 40px) left bottom / 100% 9px no-repeat; }
.mini { white-space: nowrap; display: inline-flex; width: auto; min-height: 44px; padding: 6px 14px; font-size: .85rem; letter-spacing: .04em; }
.qpin { position: sticky; top: 0; z-index: 20; margin: 8px -20px 0; padding: 4px 20px 8px; background: var(--bg); border-bottom: 1px solid var(--hair); }
.qpin-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.qpin-btns { display: flex; gap: 8px; }
.qpin-body { max-height: max(90px, calc(35vh - 66px)); max-height: max(90px, calc(35dvh - 66px)); overflow-y: auto; overscroll-behavior: contain; }
.qpin .scenario { margin: 0 0 4px; padding: 14px 16px; font-size: .98rem; line-height: 1.75; background: #0a0f17; }
.qpin.fold .scenario { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qfig-pc { display: none; }
.qright > h2:first-child { margin-top: 24px; }
.figov { position: fixed; inset: 0; z-index: 60; overflow-y: auto; background: rgba(5, 8, 13, .985); padding: calc(12px + env(safe-area-inset-top)) 16px 48px; }
.figov-in { max-width: 640px; margin: 0 auto; }
.figov-close { margin: 0 0 8px auto; }

/* ---- 採点中の演出(進み具合は分からないので % は出さない) ---- */
.analyzing { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(4, 6, 10, .96); }
.an-box { width: min(320px, 80vw); text-align: center; }
.an-line { position: relative; height: 2px; background: var(--hair2); overflow: hidden; margin: 0 0 24px; }
.an-line i { position: absolute; top: 0; bottom: 0; width: 40%; left: -40%; background: linear-gradient(90deg, transparent, #fff, transparent); box-shadow: 0 0 12px rgba(255, 255, 255, .7); animation: anrun 1.3s linear infinite; }
.an-text { font-size: 1.05rem; letter-spacing: .2em; color: #fff; margin: 0 0 10px; font-weight: 300; }
@keyframes anrun { to { left: 100%; } }
body.calm .an-line i { left: 0; width: 100%; opacity: .5; box-shadow: none; }
@media (prefers-reduced-motion: reduce) { .an-line i { left: 0; width: 100%; opacity: .5; box-shadow: none; } }

@media (min-width: 900px) {
  main.qmode { max-width: 1180px; }
  .qwrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 44px; align-items: start; }
  .qpin { top: 24px; z-index: 1; margin: 16px 0 0; padding: 0; background: transparent; border: 0; max-height: calc(100vh - 48px); overflow-y: auto; }
  .qpin-body { max-height: none; overflow: visible; }
  .figonly, .foldonly { display: none; }
  .qpin.fold .scenario { display: block; overflow: visible; }
  .qpin.fold .scenario p:not(:first-child) { display: block; }
  .qpin.fold .scenario p:first-child { display: block; -webkit-line-clamp: unset; overflow: visible; margin: 0 0 .7em; }
  .qpin.hasdec .qpin-body { max-height: none; }
  .qpin .scenario { font-size: 1.02rem; padding: 20px; }
  .qfig-pc { display: block; }
}

/* ---- 図(追加分): アイコン、ファネル、内訳、タイムライン、2軸マップ、位置関係・関係図・しくみ図 ---- */
.fic { width: 26px; height: 26px; flex: none; fill: none; stroke: var(--silver); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; }
.onode .fic, .fflow li .fic { display: block; margin: 0 auto 4px; }
.ffun .fst { margin: 12px 0; }
.ffun .fsl { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; margin-bottom: 5px; }
.ffun .fsb { height: 12px; background: rgba(214, 226, 245, .06); border: 1px solid var(--hair); }
.ffun .fsb i { display: block; height: 100%; background: linear-gradient(90deg, rgba(228, 236, 248, .35), rgba(244, 248, 255, .85)); }
.fbk .fbkbar { display: flex; height: 22px; border: 1px solid var(--hair2); margin-bottom: 12px; }
.fbk .fbkbar i { display: block; border-right: 1px solid var(--bg); min-width: 2px; }
.fbk ul { list-style: none; margin: 0; padding: 0; }
.fbk li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--hair); font-size: .92rem; }
.fbk .sw { width: 12px; height: 12px; flex: none; border: 1px solid var(--hair2); }
.fbktotal { display: flex; justify-content: space-between; padding-top: 8px; font-size: .92rem; color: var(--sub); }
.ftl { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 1px solid var(--hair2); }
.ftl li { position: relative; display: flex; gap: 14px; padding: 0 0 16px 14px; }
.ftl li:last-child { padding-bottom: 0; }
.ftl li::before { content: ""; position: absolute; left: -19px; top: .55em; width: 9px; height: 9px; border-radius: 50%; background: var(--bg); border: 1px solid var(--silver); }
.ftl .tw { flex: none; min-width: 4.8em; font-size: .88rem; color: var(--silver); }
.ftl b { display: block; font-weight: 500; font-size: .95rem; }
.ftl span:not(.tw) { display: block; color: var(--sub); font-size: .85rem; line-height: 1.6; }
.fmx .mxbox { position: relative; aspect-ratio: 100 / 92; margin: 18px 14px 6px; border: 1px solid var(--hair2); background-image: linear-gradient(rgba(214, 226, 245, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(214, 226, 245, .05) 1px, transparent 1px); background-size: 25% 25%; }
.fmx .ax { position: absolute; background: rgba(214, 226, 245, .3); }
.fmx .ax.x { left: 0; right: 0; top: 50%; height: 1px; }
.fmx .ax.y { top: 0; bottom: 0; left: 50%; width: 1px; }
.fmx .mlab { position: absolute; font-size: 12px; color: var(--sub); background: var(--bg); padding: 0 4px; white-space: nowrap; }
.fmx .mlab.t { top: -10px; left: 50%; transform: translateX(-50%); }
.fmx .mlab.b { bottom: -10px; left: 50%; transform: translateX(-50%); }
.fmx .mlab.l { left: 4px; top: calc(50% + 6px); }
.fmx .mlab.r { right: 4px; top: calc(50% + 6px); }
.fmx .mpt { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 3px; width: 92px; text-align: center; font-size: 12.5px; line-height: 1.35; }
.fmx .mpt i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--silver); background: var(--bg); }
.fmx .mpt.self i { background: #fff; box-shadow: 0 0 10px rgba(255, 255, 255, .6); }
.fmx .mpt.self span { color: #fff; font-weight: 600; }
.fmx .mxcap { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--sub); margin: 0 14px; }
.fgraph { position: relative; width: 100%; margin: 4px 0; }
.fgraph > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.fgraph > svg line { stroke: rgba(207, 216, 230, .7); stroke-width: 1; vector-effect: non-scaling-stroke; }
.fgraph.map { background-image: linear-gradient(rgba(214, 226, 245, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(214, 226, 245, .05) 1px, transparent 1px); background-size: 12.5% 12.5%; border: 1px solid var(--hair); }
.gnode { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; width: max-content; min-width: 48px; max-width: 88px; text-align: center; padding: 4px 3px; background: var(--bg); border: 1px solid var(--hair); border-radius: 6px; font-size: 12px; line-height: 1.35; }
.gnode b { font-weight: 600; font-size: 12.5px; }
.gnode span { color: var(--sub); font-size: 12px; }
.gnode .fic { width: 22px; height: 22px; margin-bottom: 2px; }
.gnode.self { border-color: #fff; box-shadow: 0 0 14px rgba(214, 228, 252, .22); }
.gnode.rival { border-style: dashed; border-color: var(--hair2); }
.gnode.muted { opacity: .72; }
.glink { position: absolute; transform: translate(-50%, -50%); padding: 0 4px; font-size: 12px; line-height: 1.3; color: var(--silver); background: var(--bg); white-space: nowrap; }
@media (max-width: 420px) { .gnode { max-width: 80px; } .fmx .mpt { width: 80px; } }

/* 問題の種類のラベル・決めること・目安時間 */
.tag.ty { color: var(--ink); border-color: var(--hair2); }
.tag.ty.quick { border-color: rgba(174, 185, 202, .7); }
.tag.ty.idea { border-style: dashed; }
.tag.ty.logic { border-color: var(--silver2); background: rgba(214, 226, 245, .06); }
.mins { font-size: .78rem; color: var(--sub); white-space: nowrap; margin-left: 4px; }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 0; margin-top: 3px; }
.meta .tag { margin-right: 4px; line-height: 1.6; padding: 0 7px; }
.decide { margin: 8px 0 0; padding: 9px 14px; border: 1px solid var(--silver); border-radius: var(--radius); background: rgba(214, 226, 245, .07); display: flex; flex-direction: column; gap: 2px; font-size: .96rem; line-height: 1.6; }
.decide b { font-size: .72rem; letter-spacing: .12em; color: var(--silver); font-weight: 600; }
.decide.static { margin: 10px 0 14px; }
.scenario p { margin: 0 0 .7em; white-space: pre-line; } .scenario p:last-child { margin-bottom: 0; }
@media (max-width: 899px) {
  .qpin.hasdec .qpin-body { max-height: max(70px, calc(35vh - 124px)); max-height: max(70px, calc(35dvh - 124px)); }
  .qpin.fold .scenario p:not(:first-child) { display: none; }
  .qpin.fold .scenario { display: block; }
  .qpin.fold .scenario p:first-child { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
}
textarea.short { min-height: 76px; }
.idea .kv { grid-template-columns: 7em 1fr; margin-top: 6px; }
.rvnote { margin: 8px 0 0; }
.card.dev { border-style: dashed; }
#xtypes button:disabled { opacity: .4; }

/* 出典の一覧 */
.src { padding: 14px 16px; }
.srcl { list-style: none; margin: 0; padding: 0; }
.srcl li { padding: 8px 0; border-top: 1px solid var(--hair); font-size: .85rem; overflow-wrap: anywhere; line-height: 1.6; }
.srcl li:first-child { border-top: 0; }
.srcl a { display: block; font-weight: 600; overflow-wrap: anywhere; }
.srctag { margin: 0 0 6px; }
.card, .scenario, .notice, .why, details, .hist .grow { overflow-wrap: anywhere; }
.card, .qright { min-width: 0; }

/* 挑戦レベル(経験値の「Lv」とは別物): 細い5段階の目盛り */
.pwrap { margin: 16px 0; } .pwrap > .card { margin: 0; }
.chal { border: 1px solid var(--hair); border-top: 0; border-radius: 0 0 var(--radius) var(--radius); padding: 0 16px; background: var(--surface); }
.chal summary { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; list-style: none; font-size: .88rem; }
.chal summary::-webkit-details-marker { display: none; }
.chal-t { color: var(--sub); letter-spacing: .08em; font-size: .78rem; }
.chal-v { font-size: 1.25rem; font-weight: 300; letter-spacing: .04em; }
.chal-d { margin-left: auto; font-size: .82rem; color: var(--sub); }
.chal-scale { position: relative; height: 22px; margin: 0 6px 6px; border-top: 1px solid var(--hair2); }
.chal-scale span { position: absolute; top: -4px; width: 1px; height: 8px; background: var(--hair2); }
.chal-scale span em { position: absolute; top: 9px; left: -4px; font-style: normal; font-size: .68rem; color: var(--sub); }
.chal-scale i { position: absolute; top: -5px; width: 9px; height: 9px; margin-left: -4.5px; border-radius: 50%; background: var(--silver); box-shadow: 0 0 0 3px rgba(214, 226, 245, .12); transition: left .6s ease; }
body.calm .chal-scale i { transition: none; }
.chal-body { padding: 4px 0 14px; font-size: .88rem; }
/* 問題の在庫表(管理画面) */
.stock summary { cursor: pointer; min-height: 32px; }
.stk { margin: 12px 0 0; } .stk b { font-size: .88rem; }
.stk table { width: 100%; border-collapse: collapse; font-size: .82rem; margin-top: 4px; table-layout: fixed; }
.stk th { color: var(--sub); font-weight: 400; font-size: .72rem; padding: 3px 2px; text-align: center; }
.stk tbody th { text-align: left; width: 5em; }
.stk td { text-align: center; padding: 5px 2px; border: 1px solid var(--hair); }
.stk td.zero { background: rgba(222, 148, 148, .22); border-color: rgba(222, 148, 148, .55); color: var(--down); }
.stk td.low { background: rgba(214, 190, 120, .16); border-color: rgba(214, 190, 120, .5); }
.stk td.na { color: var(--sub); opacity: .5; }
