/* 小学生の勉強：/kids-study/article.css（ヘッダー・フッター）の上に重ねる */
:root {
  --ink: #1f2937; --sub: #4b5563; --line: #e5e7eb; --bg: #f6f7f4; --card: #fff;
  --teal: #1abc9c; --teal-d: #0f8a72; --teal-l: #e8f8f4;
  --orange: #f59e0b; --orange-l: #fff4dc; --orange-t: #b45309; --ok: #0f8a72; --ng: #c2410c; --ok-l: #e7f7ef; --self: #15803d; --self-l: #f3faf5;
}
body.sh { background: var(--bg); color: var(--ink); font-size: 18px; line-height: 1.9; }
.sh ruby rt { font-size: max(10px, 0.55em); color: var(--sub); }
.sh .sh-sub { padding-top: 6px; }
.sh .subject-nav a { font-size: 0.95rem; font-weight: 700; }

.sh-main { max-width: 760px; margin: 0 auto; padding: 16px 16px 40px; }
.sh .breadcrumb { font-size: 0.8rem; color: var(--sub); margin: 4px 0 12px; }
.sh .breadcrumb a { color: var(--sub); }
.sh-h1 { font-size: 2rem; line-height: 1.8; margin: 0; }
.sh-grade { display: block; width: fit-content; font-size: 0.85rem; font-weight: 700; color: #fff; background: var(--teal-d); border-radius: 999px; padding: 0 12px; margin-bottom: 14px; }
.sh-school, .sh-lead { color: var(--sub); font-size: 0.9rem; margin: 6px 0 18px; }
.sh-lead { font-size: 1rem; }

.sh-card { background: var(--card); border-radius: 16px; padding: 20px 20px 22px; margin: 0 0 18px; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.sh-label { font-size: 1rem; font-weight: 700; color: var(--teal-d); margin: 0 0 10px; padding: 0; border: 0; background: none; letter-spacing: .05em; }
.sh-label::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--teal); margin-right: 8px; }

/* なぜ？ */
.sh-ask { background: linear-gradient(180deg, var(--teal-l), #fff 70%); }
.sh-question { font-size: 1.5rem; font-weight: 700; line-height: 1.7; margin: 0 0 14px; }
.p-lead { font-size: 0.9rem; color: var(--sub); margin: 0 0 8px; }
.p-choices, .q-choices { display: flex; flex-wrap: wrap; gap: 10px; }
.sh button { font: inherit; cursor: pointer; }
.p-choice, .q-choice { min-height: 48px; padding: 6px 18px; border: 2px solid var(--line); background: #fff; border-radius: 12px; font-weight: 700; color: var(--ink); }
.p-choice:hover:not(:disabled), .q-choice:hover:not(:disabled) { border-color: var(--teal); }
.p-choice.picked, .q-choice.picked { border-color: var(--ink); }
.p-choice.right { background: var(--teal-l); border-color: var(--teal-d); }
.p-choice.right::before { content: "○ "; color: var(--ok); }
.p-choice:disabled, .q-choice:disabled { cursor: default; }
.p-choice:disabled:not(.right) { opacity: .6; }
.p-why { background: #fff; border-left: 4px solid var(--teal); padding: 8px 12px; margin: 14px 0 0; border-radius: 0 8px 8px 0; }

/* さわってみよう（割合のバー） */
.bar-bases { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.bar-bases::before { content: "もとのねだん："; font-size: 0.85rem; color: var(--sub); }
.bar-bases button { min-height: 48px; font-size: 1rem; padding: 4px 14px; border: 2px solid var(--line); background: #fff; border-radius: 999px; font-weight: 700; color: var(--ink); }
.bar-bases button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.bar-svg { width: 100%; height: auto; display: block; }
.bar-cap { font-size: 22px; font-weight: 700; fill: var(--ink); }
.bar-base { fill: #fff; stroke: var(--ink); stroke-width: 2; }
.bar-part { fill: var(--orange); }
.bar-in { font-size: 24px; font-weight: 700; fill: var(--ink); }
.bar-axis { stroke: var(--sub); stroke-width: 2; }
.bar-tick { font-size: 22px; font-weight: 700; fill: var(--ink); }
.bar-tick2 { font-size: 19px; fill: var(--sub); }
.bar-mark { fill: var(--ink); }
.bar-now { font-size: 22px; font-weight: 700; fill: var(--orange-t); paint-order: stroke; stroke: #fff; stroke-width: 4px; }
.bar-slider { display: block; margin: 10px 0 4px; font-size: 0.9rem; font-weight: 700; }
.bar-slider input { display: block; width: 100%; height: 44px; accent-color: var(--orange); }
.bar-read { background: var(--orange-l); border-radius: 12px; padding: 10px 14px; text-align: center; }
.bar-eq { font-size: 1.15rem; }
.bar-eq b { font-size: 1.5rem; }
.bar-same { display: flex; justify-content: center; gap: 14px; font-size: 1.6rem; font-weight: 700; }
.bar-hint { font-size: 0.9rem; color: var(--sub); margin: 10px 0 0; }

/* わかったこと */
.sh-steps { list-style: none; padding: 0; margin: 0; counter-reset: none; }
.sh-step { padding: 0 0 18px; margin: 0 0 18px; border-bottom: 1px dashed var(--line); }
.sh-step:last-child { border-bottom: 0; margin-bottom: 0; }
.sh-step h3 { font-size: 1.15rem; line-height: 1.9; margin: 0 0 6px; padding: 0 0 0 38px; border: 0; background: none; position: relative; }
.sh-step h3 .n { position: absolute; left: 0; top: 4px; width: 28px; height: 28px; line-height: 28px; text-align: center; border-radius: 50%; background: var(--teal-d); color: #fff; font-size: 0.9rem; }
.sh-step p { margin: 0 0 10px; }
.sh-fig { width: 100%; max-width: 600px; height: auto; display: block; margin: 0 auto; }
.sh-fig text { font-size: 24px; font-weight: 700; fill: var(--ink); }
.sh-fig .nl-mark { fill: var(--orange-t); font-size: 28px; }
.nl-axis { stroke: var(--ink); stroke-width: 2; }
.nl-tick { stroke: var(--sub); stroke-width: 2; stroke-dasharray: 4 3; }
.fig-cap { display: flex; justify-content: center; gap: 18px; font-size: 0.85rem; color: var(--sub); margin: 0; }
.sh-table { border-collapse: collapse; margin: 0 auto; min-width: 70%; text-align: center; }
.sh-table th, .sh-table td { border: 1px solid var(--line); padding: 6px 14px; }
.sh-table th { background: var(--teal-l); font-size: 0.9rem; }
.sh-table tr.mark td { background: var(--orange-l); font-weight: 700; }
.sh-formula { background: var(--teal-l); border-radius: 12px; padding: 10px 16px; }
.sh-formula p { margin: 4px 0; font-weight: 700; font-size: 1.05rem; }
.sh-one { margin: 18px 0 0; padding: 12px 16px; border: 2px solid var(--teal); border-radius: 12px; font-weight: 700; font-size: 1.15rem; }
.sh-one span { display: block; font-size: 0.8rem; color: var(--teal-d); }

/* やってみよう・ふくしゅう */
.sh-q { padding: 14px 0 16px; border-bottom: 1px dashed var(--line); }
.sh-q:last-of-type { border-bottom: 0; }
.q-text { margin: 0 0 10px; font-weight: 700; padding-left: 38px; position: relative; line-height: 2; }
.q-text .qn { position: absolute; left: 0; top: 6px; width: 28px; height: 28px; line-height: 28px; text-align: center; border-radius: 8px; background: var(--ink); color: #fff; font-size: 0.85rem; }
.q-input { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.q-input input { width: 8em; min-height: 48px; font-size: 1.3rem; padding: 4px 10px; border: 2px solid var(--line); border-radius: 10px; text-align: right; }
.q-input input:focus { outline: 3px solid var(--teal); border-color: var(--teal); }
.q-unit { font-weight: 700; }
.q-check { min-height: 48px; padding: 4px 18px; border: 0; border-radius: 10px; background: var(--teal-d); color: #fff; font-weight: 700; }
.q-check:disabled { background: #9ca3af; }
.q-fb p { margin: 8px 0 0; }
.q-res { font-weight: 700; }
.q-res.ok { color: var(--ok); }
.q-res.ng { color: var(--ng); }
.q-why { background: var(--bg); border-radius: 8px; padding: 6px 12px; }
.q-back a, .q-back { font-weight: 700; }
.sh-q.is-ok .q-choice.picked { background: var(--teal-l); border-color: var(--teal-d); }
.sh-quiz-end { margin-top: 12px; background: var(--teal-l); border-radius: 12px; padding: 12px 16px; }
.sh-quiz-end p { margin: 0; }
.sh-review { background: #fff; border: 3px solid var(--orange); border-radius: 16px; padding: 14px 18px; margin: 0 0 18px; }
.sh-review h2 { font-size: 1.1rem; margin: 0; padding: 0; border: 0; background: none; color: var(--ink); }
.rv-lead { font-size: 0.9rem; color: var(--sub); margin: 2px 0 0; }

/* もどる・つぎ */
.sh-nav2 .sh-label + .sh-links { margin-bottom: 18px; }
.sh-links { display: flex; flex-direction: column; gap: 8px; }
.sh-link { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 48px; padding: 6px 14px; border: 2px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 700; }
a.sh-link:hover { border-color: var(--teal); }
.sh-link .g { font-size: 0.75rem; background: var(--teal-l); color: var(--teal-d); border-radius: 6px; padding: 0 8px; }
.sh-link.off { color: var(--sub); border-style: dashed; font-weight: 400; }
.sh-link small { font-size: 0.75rem; }

/* おうちの方へ */
.sh-parents { background: #fff; border-radius: 16px; padding: 0 20px; margin: 0 0 18px; border: 2px solid var(--line); }
.sh-parents summary { cursor: pointer; font-weight: 700; padding: 14px 0; min-height: 48px; }
.sh-parents dl { margin: 0 0 16px; font-size: 0.95rem; }
.sh-parents dt { font-weight: 700; margin-top: 10px; }
.sh-parents dd { margin: 0; }
.sh-parents ul { margin: 0; padding-left: 1.2em; }
.sh-meta { font-size: 0.8rem; color: var(--sub); margin: 0; }
.sh-src { font-size: 0.8rem; margin: 0; padding-left: 1.2em; }

/* 目次 */
.sh-units { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.sh-units a, .sh-units .off { display: block; padding: 10px 14px; border: 2px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 700; }
.sh-units a:hover { border-color: var(--teal); }
.sh-units .off { color: var(--sub); border-style: dashed; font-weight: 400; }
.sh-units small { display: block; font-size: 0.75rem; }

@media (max-width: 600px) {
  body.sh { font-size: 17px; }
  .sh-card { padding: 16px 14px 18px; border-radius: 12px; }
  .sh-h1 { font-size: 1.7rem; }
  .sh-question { font-size: 1.3rem; }
  .bar-same { font-size: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
/* スマホでは2段ヘッダーが画面の1/3を占めるので固定しない */
@media (max-width: 760px) { body.sh header { position: static !important; } }
.sh-review .q-text { padding-left: 0; }
.sh-unit-h { font-size: 0.95rem; margin: 14px 0 6px; padding: 0; border: 0; background: none; color: var(--sub); }
.sh-unit-h:first-of-type { margin-top: 0; }
.sh .subject-nav { flex-wrap: wrap; gap: 4px; }
/* 読み上げボタン */
.say { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin-left: 6px; vertical-align: middle; border: 2px solid var(--line); border-radius: 50%; background: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.say:hover { border-color: var(--teal); }
/* どっちを1にする？ */
.p1-pairs, .p1-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.p1-pairs button { min-height: 48px; padding: 4px 14px; border: 2px solid var(--line); background: #fff; border-radius: 999px; font-size: 1rem; }
.p1-pairs button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.p1-ask { font-weight: 700; margin: 0 0 8px; }
.p1-btn { min-height: 48px; padding: 4px 16px; border: 2px solid var(--line); background: #fff; border-radius: 12px; font-weight: 700; color: var(--ink); }
.p1-btn[aria-pressed="true"] { border-color: #2563eb; background: #eaf1ff; }
.p1-btn b { color: #2563eb; font-size: 1.2em; }
.p1-svg { width: 100%; height: auto; display: block; }
.p1-name { font-size: 20px; font-weight: 700; fill: var(--ink); }
.p1-tape { fill: #d1d5db; }
.p1-tape.one { fill: #bfd4ff; stroke: #2563eb; stroke-width: 4; }
.p1-tape.other { fill: var(--orange); }
.p1-axis { stroke: var(--ink); stroke-width: 2; }
.p1-grid { stroke: #2563eb; stroke-width: 2; stroke-dasharray: 5 4; }
.p1-grid.half { stroke-width: 1; opacity: .6; }
.p1-tick { font-size: 22px; font-weight: 700; fill: #2563eb; }
.p1-tick.half { font-size: 17px; font-weight: 400; }
.p1-read { background: #f3f6ff; border-radius: 12px; padding: 10px 14px; text-align: center; min-height: 64px; }
.p1-read p { margin: 2px 0; }
.p1-big { font-size: 1.3rem; font-weight: 700; }
.p1-big b { font-size: 1.6rem; }
.p1-big .b { color: #2563eb; }
.p1-big .o { color: #b45309; }
.p1-eq { font-size: 1rem; color: var(--sub); }
.p1-note { font-size: .9rem; color: var(--sub); }
/* v0.2：苦手な子向けの部品 */
body.sh .header-nav { display: none; }            /* 単元ページは気が散らないよう、サイト全体のメニューを隠す */
.say-note { display: none; margin-left: 10px; font-size: .8rem; }
body.can-say .say-note { display: inline; }
.saying { background: #fff7cc; border-radius: 6px; box-shadow: 0 0 0 4px #fff7cc; }
.sh-lead2 { color: var(--sub); font-size: .95rem; margin: -2px 0 12px; }
.sh-after { margin: 12px 0 0; padding: 10px 14px; background: var(--teal-l); border-radius: 12px; }
.q-hint { background: #fff7e6; border-left: 4px solid var(--orange); border-radius: 0 8px 8px 0; padding: 6px 12px; }
.hint-tag { display: inline-block; font-size: .75rem; font-weight: 700; background: var(--orange-t); color: #fff; border-radius: 6px; padding: 0 8px; margin-right: 8px; }
.q-choice.show-ans { border-color: var(--teal-d); border-style: dashed; }
.sh-check { border: 2px dashed var(--line); }
.ck-ok, .ck-ng { margin-top: 12px; padding: 10px 14px; border-radius: 12px; }
.ck-ok { background: var(--teal-l); }
.ck-ng { background: #fff7e6; }
.ck-ok p, .ck-ng p { margin: 0; }
.sh-ex { padding: 14px 0; border-bottom: 1px dashed var(--line); }
.sh-ex:last-child { border-bottom: 0; }
.ex-tag { display: inline-block; font-size: .8rem; font-weight: 700; border-radius: 999px; padding: 0 12px; color: #fff; }
.ex-tag.show { background: #2563eb; } .ex-tag.fill { background: var(--teal-d); } .ex-tag.solo { background: var(--ink); }
.ex-head { margin: 0 0 6px; }
.ex-steps { margin: 6px 0 10px; padding-left: 1.4em; }
.ex-steps li { margin: 2px 0; }
.sh-ex .sh-q { padding-top: 4px; border: 0; }
.am-bases, .am-muls { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.am-bases button, .am-muls button { min-height: 48px; font-size: 1rem; padding: 4px 14px; border: 2px solid var(--line); background: #fff; border-radius: 999px; font-weight: 700; color: var(--ink); }
.am-bases button[aria-pressed="true"] { background: #2563eb; color: #fff; border-color: #2563eb; }
.am-muls button[aria-pressed="true"] { background: var(--orange); color: var(--ink); border-color: var(--orange); }
.am-svg { width: 100%; height: auto; display: block; }
.am-tape.add { fill: #a7d8c9; }
.am-read { background: #f3f6ff; border-radius: 12px; padding: 8px 14px; }
.am-read p { margin: 4px 0; }
.p1-btn .b { color: #2563eb; } .p1-btn .o { color: #b45309; }
.p1-gbtns { display: flex; gap: 10px; margin-bottom: 8px; }
.p1-g { min-height: 48px; padding: 4px 18px; border: 2px solid var(--ink); background: #fff; border-radius: 12px; font-weight: 700; }
.p1-res { font-weight: 700; color: var(--teal-d); }
.sh-table, .sh-fig { margin-top: 6px; }
.sh-q .sh-fig { max-width: 520px; margin: 0 0 10px; }
.q-choice.nope { opacity: .5; border-style: dashed; }
.q-text:not(:has(.qn)) { padding-left: 0; }
/* せつめいを聞く */
.sh-playbar, .sh-playtop { display: none; margin: 0 0 12px; }
body.can-say .sh-playbar, body.can-say .sh-playtop { display: block; }
.sh-play, .sh-play-top { display: inline-flex; align-items: center; min-height: 48px; padding: 4px 18px; border: 2px solid var(--teal-d); border-radius: 999px; background: #fff; color: var(--teal-d); font-weight: 700; text-decoration: none; cursor: pointer; }
.sh-play[aria-pressed="true"] { background: var(--teal-d); color: #fff; }
.sh-play-top { background: var(--teal-d); color: #fff; }
/* せつめいの操作バー（画面の下に固定） */
.sh-player { position: fixed; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 200; display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: var(--ink); border-radius: 18px; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: calc(100vw - 24px); }
.sh-player[hidden] { display: none; }
.sh-player button { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 60px; min-height: 56px; border: 0; border-radius: 12px; background: #374151; color: #fff; font-size: 20px; line-height: 1.1; cursor: pointer; }
.sh-player button small { font-size: 11px; margin-top: 2px; }
.sh-player button:disabled { opacity: .35; cursor: default; }
.sh-player .pl-toggle { background: var(--teal-d); min-width: 72px; }
.sh-player .pl-pos { color: #fff; font-size: 13px; padding: 0 4px; white-space: nowrap; }
body.playing .sh-main { padding-bottom: 110px; }
/* 多角形の図（figure poly） */
.sh-fig.poly { max-width: 520px; }
.pg { fill: #f3f4f6; stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.pg.one { fill: #bfd4ff; stroke: #2563eb; }
.pg.other { fill: #fde7b0; stroke: #b45309; }
.pg-name { font-size: 24px; font-weight: 700; fill: var(--ink); }
.pg-side { font-size: 21px; font-weight: 700; fill: #2563eb; }
.pg-ang { font-size: 20px; font-weight: 700; fill: #b45309; }
.pg-arc { fill: none; stroke: #b45309; stroke-width: 2.5; }
.pg-diag { stroke: var(--sub); stroke-width: 2; stroke-dasharray: 6 5; }
/* たて書きの分数 [[1/2]] */
.frac { display: inline-flex; align-items: center; vertical-align: middle; margin: 0 .12em; line-height: 1; white-space: nowrap; }
.frac .fw { font-size: 1em; margin-right: .08em; }
.frac .fs { display: inline-flex; flex-direction: column; align-items: center; font-size: .92em; }
.frac .fn { padding: 0 .15em .08em; border-bottom: 2px solid currentColor; }
.frac .fd { padding: .08em .15em 0; }
/* 分数で答える欄 */
.q-frac { align-items: center; }
.q-frac .fw-in { width: 3.2em; }
.fr-box { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; }
.fr-box input { width: 4em; min-height: 44px; text-align: center; }
.fr-bar { display: block; width: 4.4em; height: 3px; background: var(--ink); border-radius: 2px; }
.sh-after-btn { margin-top: 12px; min-height: 48px; padding: 4px 16px; border: 2px dashed var(--teal); border-radius: 12px; background: #fff; color: var(--teal-d); font-weight: 700; cursor: pointer; }
.pg-ln { stroke: var(--sub); stroke-width: 2; stroke-dasharray: 6 5; }
.pg-ln.base { stroke: #2563eb; stroke-width: 5; stroke-dasharray: none; }
.pg-ln.height { stroke: #ea580c; stroke-width: 4; stroke-dasharray: 8 5; }
.pg-ln.axis { stroke: #7c3aed; stroke-width: 3; stroke-dasharray: 10 6; }
.pg-lab { font-size: 21px; font-weight: 700; fill: var(--sub); }
.pg-lab.base { fill: #2563eb; } .pg-lab.height { fill: #ea580c; } .pg-lab.axis { fill: #7c3aed; }
.pg-right { fill: none; stroke: var(--ink); stroke-width: 2; }
.pg-pt { fill: #7c3aed; }
/* 静的なグラフ（dotplot / bandg / bars） */
.dp-t { font-size: 20px; fill: var(--ink); }
.dp-dot { fill: #f59e0b; stroke: #b45309; stroke-width: 2; }
.dp-mark { stroke: #2563eb; stroke-width: 3; stroke-dasharray: 6 4; }
.dp-ml { font-size: 18px; font-weight: 700; fill: #2563eb; }
.bg { stroke: #fff; stroke-width: 2; } .bg1 { fill: #f59e0b; } .bg2 { fill: #93c5fd; } .bg3 { fill: #a7d8c9; } .bg4 { fill: #fca5a5; } .bg5 { fill: #d8b4fe; } .bg6 { fill: #d1d5db; }
.bg-n { font-size: 18px; font-weight: 700; fill: var(--ink); } .bg-v { font-size: 17px; fill: var(--ink); }
.bars-grid { stroke: var(--line); stroke-width: 1.5; } .bars-bar { fill: #f59e0b; }
.pg-ln.ext { stroke: var(--sub); stroke-width: 2; stroke-dasharray: 3 5; }
/* 表がスマホの幅をこえるときは、表だけ横にスクロール */
.sh-tablewrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 600px) { .sh-table th, .sh-table td { padding: 4px 7px; font-size: .9rem; } .sh-table { min-width: 0; } }
.sh-fig text.nl-mark[font-size] { font-size: 19px; }
.sh-fig .nl-fbar { stroke: currentColor; }
.sh-fig text.nl-mark + .nl-fbar { stroke: var(--orange-t); }
/* 説明が先の並び（2026-11-12）：このページで分かること・たしかめは閉じて置く */
.sh-intro { margin: 0 0 12px; padding: 12px 16px; background: #fff; border: 2px solid var(--teal); border-radius: 12px; font-weight: 700; font-size: 1.1rem; }
.sh-intro span { display: block; font-size: .8rem; color: var(--teal-d); }
details.sh-check { border: 2px dashed var(--line); }
details.sh-check > summary { cursor: pointer; font-weight: 700; color: var(--sub); min-height: 48px; display: list-item; line-height: 2.3; padding-top: 6px; }
details.sh-check[open] > summary { margin-bottom: 8px; }
.sh-fig .nl-one { fill: #2563eb; font-size: 24px; }
.sh-fig .nl-arrow { fill: none; stroke: #2563eb; stroke-width: 2.5; }
.sh-fig .nl-ah { fill: #2563eb; }
.sh-fig .nl-arrow-t { font-size: 20px; font-weight: 700; fill: #2563eb; }

.sh-video { margin: 0; }


.sh-video video { display: block; width: 100%; height: auto; border-radius: 12px; background: #000; }

/* ===== UI改善（2026-11-12 理事長「おすすめどおり」）===== */
/* A6：入力・単位・ボタンを1行に */
.q-input { flex-wrap: nowrap; }
.q-input input { width: 5.5em; flex: 0 1 5.5em; min-width: 3.2em; transition: border-color .2s, background-color .2s; }
.q-unit { white-space: nowrap; }
.q-check { flex-shrink: 0; padding: 4px 14px; white-space: nowrap; }
.q-frac .fr-box input { width: 3.4em; flex: none; min-width: 0; }
.q-frac .fw-in { width: 2.6em; flex: none; }
/* A4：正解は 緑の枠・薄い緑地・右に○。番号は緑の ✓ */
.sh-q.is-ok .q-input input { border-color: var(--ok); background: var(--ok-l); color: var(--ink); opacity: 1; -webkit-text-fill-color: var(--ink); }
.sh-q.is-ok .q-check { display: none; }
.q-okmark { font-size: 1.6rem; font-weight: 700; color: var(--ok); line-height: 1; margin-left: 2px; }
.q-text .qn { transition: background-color .2s; }
.sh-q.is-ok .q-text .qn { background: var(--ok); font-size: 0; }
.sh-q.is-ok .q-text .qn::after { content: "✓"; font-size: 1rem; font-weight: 700; }
.sh-q.is-ok .q-choice.picked { background: var(--ok-l); border-color: var(--ok); }
.sh-q.is-ok .q-choice.picked::after { content: " ○"; color: var(--ok); }
.q-res.ok { color: var(--ok); }
/* A5：まちがいは ×を出さず、ヒントの箱だけ */
.q-hint { background: #fff8eb; border-left: 4px solid var(--orange); border-radius: 0 10px 10px 0; padding: 8px 12px; margin-top: 10px; }
.q-hint p { margin: 2px 0; }
.hint-h { font-weight: 700; color: var(--orange-t); font-size: .95rem; }
.q-hint .q-why { background: #fff; }
.hint-next { font-size: .95rem; color: var(--sub); }
/* A7：タップ先 48px 以上 */
.sh .breadcrumb { line-height: 1.6; }
.sh .breadcrumb a { display: inline-block; padding: 10px 2px; }
.sh-parents summary { display: flex; align-items: center; min-height: 52px; padding: 8px 0; }
.sh .subject-nav a { display: inline-flex; align-items: center; min-height: 44px; }
/* A8：キーボードで動かすときの枠 */
.sh button:focus-visible, .sh a:focus-visible, .sh summary:focus-visible, .sh input:focus-visible, .sh [tabindex]:focus-visible { outline: 3px solid #1d4ed8; outline-offset: 2px; }
/* B2：見出し・アイコン・自分でやる節の色帯 */
.sh-label { font-size: 1.25rem; display: flex; align-items: center; gap: 8px; letter-spacing: .03em; }
.sh-label::before { display: none; }
.sh-ico { flex: none; width: 26px; height: 26px; padding: 4px; box-sizing: content-box; border-radius: 9px; background: var(--teal-l); color: var(--teal-d); }
.sh-card.sh-self { border-left: 5px solid var(--self); background: linear-gradient(90deg, var(--self-l), #fff 40%); }
.sh-self > .sh-label { color: var(--self); }
.sh-self > .sh-label .sh-ico { background: #dcfce7; color: var(--self); }
/* B1：進みぐあいバー（上に固定。下の読み上げバーとは重ならない） */
.sh-prog { position: sticky; top: var(--sh-top, 0px); z-index: 90; margin: 0 -16px 14px; padding: 0 8px; background: var(--bg); border-bottom: 1px solid var(--line); }
.sh-prog ol { list-style: none; display: flex; margin: 0 auto; padding: 0; max-width: 560px; position: relative; }
.sh-prog ol::before { content: ""; position: absolute; left: 10%; right: 10%; top: 13px; height: 2px; background: #d1d5db; }
.sh-prog li { flex: 1 1 0; min-width: 0; position: relative; }
.sh-prog a { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 1px; min-height: 48px; padding: 7px 0 3px; text-decoration: none; color: var(--sub); font-size: 12px; font-weight: 700; line-height: 1.25; white-space: nowrap; }
.sh-prog i { display: block; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid #9ca3af; position: relative; z-index: 1; transition: background-color .2s, border-color .2s, transform .2s; }
.sh-prog a.on { color: var(--self); }
.sh-prog a.on i { background: var(--self); border-color: var(--self); transform: scale(1.25); }
@media (min-width: 761px) { .sh-prog { margin: 0 0 14px; border-radius: 0 0 12px 12px; } .sh-prog a { font-size: 13px; } }
.sh-card[id], .sh-card[data-sec] { scroll-margin-top: 70px; }
/* A9 / V2：動画カード（明るい表紙＋ふきだし＋長さ入りのボタン） */
.sh-video-btn { position: relative; display: block; width: 100%; padding: 0; border: 2px solid var(--teal); border-radius: 14px; overflow: hidden; background: #fff; cursor: pointer; text-align: left; color: var(--ink); }
.sh-video-btn img { display: block; width: 100%; height: auto; }
.vb-foot { display: block; padding: 10px 12px 12px; background: #fff; }
.vb-bubble { position: relative; display: block; margin: 4px 0 12px auto; max-width: 92%; width: fit-content; padding: 8px 14px; background: #fff7e0; border: 2px solid var(--orange); border-radius: 14px; font-weight: 700; font-size: 1.05rem; line-height: 1.9; }
.vb-bubble::before { content: ""; position: absolute; right: 13%; top: -11px; width: 16px; height: 16px; background: #fff7e0; border-left: 2px solid var(--orange); border-top: 2px solid var(--orange); transform: rotate(45deg); }
.vb-who { display: inline-block; margin-right: 8px; padding: 0 10px; border-radius: 999px; background: var(--orange-t); color: #fff; font-size: .8rem; line-height: 1.7; vertical-align: 2px; }
.vb-play { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.vb-main { display: block; width: 100%; text-align: center; padding: 10px 14px; border-radius: 999px; background: var(--teal-d); color: #fff; font-weight: 700; font-size: 1.1rem; line-height: 1.5; }
.vb-play small { font-size: .8rem; color: var(--sub); }
.sh-video-btn:hover .vb-main { background: #0b6e5b; }
.vb-main .dur { white-space: nowrap; }
@media (max-width: 600px) { .vb-main { font-size: 1rem; padding: 10px 10px; } }
@media (min-width: 601px) {
  .vb-foot { display: flex; align-items: center; gap: 16px; padding: 14px 16px 14px; }
  .vb-bubble { order: 2; flex: 1 1 58%; margin: 0; }
  .vb-bubble::before { right: 18%; }
  .vb-play { order: 1; flex: 1 1 42%; }
}
/* V3：動画ありのしるし */
.vbadge { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 6px; background: #e0f2fe; color: #075985; font-size: .72rem; font-weight: 700; line-height: 1.7; white-space: nowrap; vertical-align: 1px; }
/* B5：ページの終わり */
.sh-done { margin: 0 0 16px; padding: 12px 16px; background: var(--teal-l); border-radius: 12px; font-weight: 700; font-size: 1.1rem; }
.sh-next-big { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px; min-height: 72px; padding: 12px 16px 12px 20px; border-radius: 16px; background: var(--teal-d); color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; line-height: 1.5; }
.sh-next-big small { font-size: .85rem; opacity: .9; }
.sh-next-big .g { display: inline-block; margin-right: 8px; padding: 0 8px; border-radius: 6px; background: rgba(255,255,255,.2); font-size: .8rem; vertical-align: 2px; }
.sh-next-big .vbadge { background: #fff; }
.sh-next-big .arr .sh-ico, .sh-next-big .arr svg { width: 28px; height: 28px; background: none; color: #fff; }
.sh-next-big:hover { background: #0b6e5b; }
.sh-next-big small { grid-column: 1 / -1; }
.sh-backbox { margin-top: 20px; }
.sh-back-h { font-size: .95rem; font-weight: 700; color: var(--sub); margin: 0 0 8px; padding: 0; border: 0; background: none; }
.sh-links.sub .sh-link { min-height: 48px; font-weight: 400; font-size: .95rem; border-width: 1px; }
/* B4：目次の学年タブ */
.sh-tabs { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 0 0 12px; scroll-margin-top: 80px; }
.sh-tab { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 56px; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.1rem; line-height: 1.2; }
.sh-tab small { font-size: .72rem; font-weight: 400; color: var(--sub); }
.sh-tab[aria-selected="true"] { background: var(--teal-d); border-color: var(--teal-d); color: #fff; }
.sh-tab[aria-selected="true"] small { color: #e6fffa; }
.sh-gpanel[hidden] { display: none; }
.sh-units a { min-height: 48px; }
.sh-units a .vbadge { margin-left: 6px; }
.sh-none { color: var(--sub); margin: 0 0 8px; }
.sh-stubs { margin-top: 14px; border-top: 1px dashed var(--line); }
.sh-stubs summary { cursor: pointer; display: flex; align-items: center; min-height: 48px; color: var(--sub); font-weight: 700; }
.sh-stublist { margin: 0; padding-left: 1.2em; color: var(--sub); font-size: .9rem; columns: 2 200px; }

/* 折れ線グラフ（静的）・表の1マス強調（2026-11-13） */
.lg-line { fill: none; stroke: var(--ink); stroke-width: 3; } .lg-pt { fill: var(--ink); } .lg-mark { stroke: #f59e0b; stroke-width: 8; stroke-linecap: round; } .lg-wave { fill: none; stroke: var(--ink); stroke-width: 2.5; }
.sh-table td.mark-cell { background: var(--orange-l); font-weight: 700; outline: 2px solid #f59e0b; outline-offset: -2px; }
.lg-t { font-size: 26px; fill: var(--ink); }
.p1-tape.unk { fill: #e5e7eb; stroke: #6b7280; stroke-dasharray: 6 4; } .p1-part { font-size: 20px; font-weight: 700; fill: var(--ink); }

/* 組み合わせたグラフ（combo）・何本かの折れ線（lines）・人口ピラミッド（pyramid）（2026-11-13）
   棒＝左の目もり＝青、折れ線＝右の目もり＝オレンジ。目もりの数字も同じ色 */
.sh-fig .cb-tl { fill: #1d4ed8; font-size: 24px; } .sh-fig .cb-tr { fill: #b45309; font-size: 24px; }
.sh-fig .cb-key { font-size: 22px; } .sh-fig .cb-t { font-size: 24px; }
.cb-bar { fill: #93c5fd; stroke: #2563eb; stroke-width: 2; } .cb-bar.on { fill: #2563eb; }
.cb-axl { stroke: #2563eb; stroke-width: 4; } .cb-axr { stroke: #d97706; stroke-width: 4; }
.cb-line { fill: none; stroke: #f59e0b; stroke-width: 4; } .cb-pt { fill: #f59e0b; stroke: #b45309; stroke-width: 2; }
.cb-gl { stroke: #1d4ed8; stroke-width: 3; stroke-dasharray: 8 5; } .cb-gr { stroke: #b45309; stroke-width: 3; stroke-dasharray: 8 5; }
.cb-ring { fill: none; stroke: #b45309; stroke-width: 4; }
.sh-fig .ln-t, .sh-fig .ln-key { font-size: 24px; }
.ln-l { fill: none; stroke-width: 4; stroke-linejoin: round; } .ln-l.ln0 { stroke: #2563eb; } .ln-l.ln1 { stroke: #ea580c; stroke-dasharray: 12 6; } .ln-l.ln2 { stroke: #15803d; stroke-dasharray: 3 5; }
.ln-pt.ln0 { fill: #2563eb; } .ln-pt.ln1 { fill: #ea580c; } .ln-pt.ln2 { fill: #15803d; }
.ln-cg { stroke: var(--ink); stroke-width: 2.5; stroke-dasharray: 6 5; } .ln-ring { fill: none; stroke: var(--ink); stroke-width: 4; }
.sh-fig .py-t { font-size: 22px; } .sh-fig .py-t.on { fill: var(--orange-t); }
.sh-fig .py-hl { fill: #1d4ed8; font-size: 24px; } .sh-fig .py-hr { fill: #c2410c; font-size: 24px; }
.py-l { fill: #93c5fd; stroke: #2563eb; stroke-width: 2; } .py-r { fill: #fdba74; stroke: #c2410c; stroke-width: 2; }
.py-l.on, .py-r.on { stroke: var(--ink); stroke-width: 3; }
.py-markbg { fill: var(--orange-l); stroke: #f59e0b; stroke-width: 2; } .py-c { stroke: var(--ink); stroke-width: 3; }

/* 目次の教科きりかえ（算数＝index.html・理科＝rika.html・国語＝kokugo.html、2026-11-13） */
.sh-subj { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.sh-subj a { flex: 1 1 0; min-width: 5.5em; display: flex; align-items: center; justify-content: center; min-height: 48px; border: 2px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.05rem; }
.sh-subj a:hover { border-color: var(--teal-d); }
.sh-subj a[aria-current="page"] { background: var(--teal-d); border-color: var(--teal-d); color: #fff; }

/* 国語のページだけ：教科書に近い字の形 Klee One（SIL OFL。build.py が subject=koku のときだけ Google Fonts を読み込み、body に sh-koku）。算数・理科は 今のまま */
body.sh-koku .sh-main, body.sh-koku .sh-main button, body.sh-koku .sh-main input, body.sh-koku .sh-main select, body.sh-koku .sh-main textarea { font-family: "Andika", "Klee One", "UD Digi Kyokasho NK-R", "UD デジタル 教科書体 NK-R", "Hiragino Maru Gothic ProN", sans-serif; }
body.sh-koku .sh-main svg text { font-family: "Andika", "Klee One", "UD Digi Kyokasho NK-R", sans-serif; }
body.sh-koku .kk { --kf: "Andika", "Klee One", "UD Digi Kyokasho NK-R", "UD デジタル 教科書体 NK-R", "UD Digi Kyokasho N-R", sans-serif; }

/* 国語の 50音ひょう（図 kanatable、2026-11-13）：大きな マス。字は Klee One。光る＝ぎょう・だん（うすい オレンジ）、1マス（こい オレンジ） */
.sh-kanawrap { max-width: 100%; overflow-x: auto; margin: 10px 0 4px; }
.sh-kana { --w: min(84vw, 600px); border-collapse: separate; border-spacing: 4px; margin: 0 auto; background: linear-gradient(180deg, #fffaf0, #fdf3df); border: 2px solid #e8d6b0; border-radius: 16px; padding: 4px; }
.sh-kana td { width: calc(var(--w) / var(--n) - 8px); max-width: 72px; height: calc(min(var(--w) / var(--n), 76px) * 1.02); padding: 0; text-align: center; vertical-align: middle; border: 1.5px solid #ead9b6; border-radius: 8px; background: #fff; color: var(--ink); font-family: "Andika", "Klee One", "UD Digi Kyokasho NK-R", "UD デジタル 教科書体 NK-R", sans-serif; font-size: clamp(1.3rem, calc(var(--w) / var(--n) * .66), 2.8rem); line-height: 1; box-shadow: 0 1.5px 0 #e9d6ad; }
.sh-kana td.alt { background: #fff6e3; }
.sh-kana td.e { visibility: hidden; }
.sh-kana td.on { background: #ffe8b8; border-color: #f59e0b; border-width: 2.5px; font-weight: 600; }
.sh-kana td.hit { background: #f97316; color: #fff; border-color: #c2410c; font-weight: 600; box-shadow: 0 3px 8px rgba(194, 65, 12, .35); }

/* 国語のページだけ：表の字と えらぶ ボタンの 字を 大きく（2026-11-14 統括の決定。漢字の 形を 見くらべる ため）。算数・理科は 今のまま */
body.sh-koku .sh-table td { font-size: 1.2rem; line-height: 1.9; }
body.sh-koku .sh-table th { font-size: 1.05rem; }
body.sh-koku .q-choice { font-size: 1.25rem; }
/* 小1・2 の 国語だけ：えらぶ ボタンの 字を もっと 大きく（゛と ゜が 見分けられる 大きさ。2026-11-14）。学年は canonical の ファイル名 g1-・g2- で 見る */
html:has(link[rel="canonical"][href*="/g1-koku-"]) body.sh-koku :is(.q-choice, .p-choice),
html:has(link[rel="canonical"][href*="/g2-koku-"]) body.sh-koku :is(.q-choice, .p-choice) { font-size: 1.7rem; line-height: 1.5; min-height: 60px; padding: 6px 22px; letter-spacing: .04em; }
html:has(link[rel="canonical"][href*="/g1-koku-"]) body.sh-koku :is(.q-choice, .p-choice) rt,
html:has(link[rel="canonical"][href*="/g2-koku-"]) body.sh-koku :is(.q-choice, .p-choice) rt { font-size: .45em; letter-spacing: 0; }

/* 図の cap（出典・説明の一行。build.py fig_html、2026-11-14） */
.fig-note { text-align: center; font-size: 0.85rem; color: var(--sub); margin: 4px 0 8px; line-height: 1.9; }
.fig-note rt { font-size: .55em; }
/* combo の color:"climate"（雨温図。soc-climate と同じ色：降水量の棒＝青、気温の線＝赤）と れい下の 0 の横線（2026-11-14） */
.cb-bar.clim { fill: #7cc0f2; stroke: #1d5fa8; } .cb-bar.clim.on { fill: #1d5fa8; }
.sh-fig .cb-tl.clim { fill: #1d5fa8; } .cb-axl.clim { stroke: #1d6fc4; } .cb-gl.clim { stroke: #1d5fa8; }
.sh-fig .cb-tr.red { fill: #b91c1c; } .cb-axr.red { stroke: #dc2626; }
.cb-line.red { stroke: #dc2626; } .cb-pt.red { fill: #fff; stroke: #dc2626; stroke-width: 3; }
.cb-gr.red { stroke: #b91c1c; } .cb-ring.red { stroke: #b91c1c; }
.cb-zero { stroke: var(--ink); stroke-width: 3.5; }

/* 情報の図（tools/sho_joho_figs.py、2026-11-15） */
.jf-prog{display:flex;flex-wrap:wrap;gap:6px;list-style:none;counter-reset:jp;padding:0;margin:8px 0 0;justify-content:center}
.jf-prog li{counter-increment:jp;background:#eaf1ff;border:2px solid #2563eb;border-radius:8px;padding:4px 10px;font-weight:700}
.jf-prog li::before{content:counter(jp) " ";color:#64748b;font-weight:400}
/* わからない（2026-11-15 情報） */
.q-idk{display:block;margin:10px 0 0;min-height:44px;padding:6px 16px;border:2px dashed var(--line);border-radius:999px;background:#fff;color:var(--sub);font:inherit;font-weight:700;cursor:pointer}
.sh-q.is-ok .q-idk,.sh-q.is-ng .q-idk{display:none}
.q-wrongwhy{margin:6px 0;padding:8px 12px;border-left:4px solid #f59e0b;background:#fffbeb;border-radius:6px}
/* 中学（2026-11-15）：学年が 小3〜中3 の7つになったので、スマホでも1行に入るように詰める */
@media (max-width: 600px) { .sh .subject-nav { gap: 0; justify-content: center; } .sh .subject-nav a { padding-left: 7px; padding-right: 7px; min-width: 44px; justify-content: center; } }

/* 動画の小さいボタン（2026-11-16）：使い方・例題・おうちの方へ・まとめ版 */
.sh-vpill-w { margin: 4px 0 14px; }
.sh-vpill { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 8px 14px 8px 12px; border: 2px solid var(--teal); border-radius: 12px;
  background: var(--teal-l); color: var(--teal-d); font: inherit; font-weight: 700; line-height: 1.5; text-align: left; cursor: pointer; }
.sh-vpill:hover, .sh-vpill:focus-visible { background: #d3f2ea; }
.sh-vpill .sh-ico { flex: none; width: 22px; height: 22px; }
.sh-vpill small { display: block; font-weight: 400; font-size: .8rem; color: #4b5563; }
.sh-vplayer { display: block; width: 100%; height: auto; border-radius: 12px; background: #000; margin: 4px 0 14px; }
.sh-videocard .sh-vpill-w { margin: 12px 0 0; }
.sh-parents .sh-vpill-w { margin: 10px 0 6px; }
