/* 理科の図（img・circuit）と「おうちで やってみよう」。build.py が、使うページだけで読み込む（rika_figs.py） */
.rk-fig { margin: 12px auto 16px; max-width: 560px; --big: 1; }
.rk-box { position: relative; width: 100%; overflow: hidden; border-radius: 14px; }
.rk-box > img { display: block; width: 100%; height: auto; }
.rk-box > img.rk-crop { position: absolute; max-width: none; height: auto; }
.rk-fig.img .rk-box { background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, .08); }
.rk-svg { display: block; width: 100%; height: auto; background: radial-gradient(ellipse at 50% 30%, #fbfdff 0%, #eef3f8 100%); box-shadow: 0 2px 8px rgba(0, 0, 0, .08); border-radius: 14px; }
.rk-svg.rk-diag { background: #fff; box-shadow: inset 0 0 0 2px #e5e7eb; }
.rk-ov { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.rk-ln { stroke: #374151; stroke-width: 2.2; vector-effect: non-scaling-stroke; fill: none; }
.rk-dot { fill: #374151; stroke: #fff; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
/* ラベル：絵の上の 名前（HTML なので ふりがなが つく。スマホでも 13px より 小さく しない） */
.rk-lab { position: absolute; transform: translate(calc(var(--ax, .5) * -100%), calc(var(--ay, .5) * -100%)); z-index: 1; pointer-events: none; }
.rk-lab > span { display: inline-block; white-space: nowrap; background: rgba(255, 255, 255, .96); color: #1f2937; border: 2px solid #374151; border-radius: 10px;
  padding: 1px 8px; font-weight: 700; line-height: 1.55; font-size: calc(clamp(13px, 3.6vw, 16px) * var(--big)); box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.rk-lab ruby rt { font-size: max(9px, .55em); }
.rk-lab.plus > span { border-color: #dc2626; color: #b91c1c; }
.rk-lab.minus > span { border-color: #111827; color: #111827; }
.rk-lab.orange > span { border-color: #ea580c; color: #9a3412; }
.rk-lab.blue > span { border-color: #2563eb; color: #1d4ed8; }
.rk-lab.green > span { border-color: #0f8a72; color: #0f766e; }
.rk-lab.plain > span { border-color: transparent; background: rgba(255, 255, 255, .85); box-shadow: none; }
/* しるし（× ○ ？）・回路の文字 */
.rk-mx0 { stroke: #fff; fill: none; stroke-linecap: round; }
.rk-mx { stroke: #dc2626; fill: none; stroke-linecap: round; }
.rk-mo0 { stroke: #fff; fill: none; }
.rk-mo { stroke: #0f8a72; fill: none; }
.rk-mq0 { fill: #fff; stroke: #2563eb; stroke-width: 3; vector-effect: non-scaling-stroke; }
.rk-qb { fill: #fff; stroke: #2563eb; stroke-width: 3; }
.rk-mq, .rk-q { fill: #2563eb; font-weight: 800; text-anchor: middle; dominant-baseline: central; paint-order: stroke; stroke: #fff; stroke-width: 5px; stroke-linejoin: round; }
.rk-pl, .rk-mi { font-weight: 800; text-anchor: middle; dominant-baseline: central; paint-order: stroke; stroke: #fff; stroke-width: 6px; stroke-linejoin: round; }
.rk-pl { fill: #dc2626; }
.rk-mi { fill: #111827; }
.rk-sym { fill: #1f2937; font-weight: 700; text-anchor: middle; dominant-baseline: central; font-family: Arial, Helvetica, sans-serif; }
.rk-ar0 { fill: none; stroke: #fff; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.rk-ar { fill: none; stroke: #ea580c; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.rk-turn { fill: none; stroke: #7c3aed; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.rk-cap { text-align: center; font-size: .95rem; font-weight: 700; color: var(--ink, #1f2937); margin-top: 6px; }

/* おうちで やってみよう */
.sh-home { border-top: 6px solid #f59e0b; background: linear-gradient(180deg, #fffaf0, #fff 120px); }
.sh-home .sh-label { color: #b45309; }
.hm-safe { display: flex; gap: 10px; align-items: flex-start; background: #fff4dc; border: 2px solid #f59e0b; border-radius: 12px; padding: 10px 12px; margin: 0 0 14px; font-weight: 700; color: #7c2d12; }
.hm-safe svg { flex: none; width: 26px; height: 26px; color: #d97706; margin-top: 2px; }
.hm-need { margin: 0 0 12px; }
.hm-need h3, .hm-steps-h { font-size: 1rem; margin: 0 0 6px; color: #92400e; }
.hm-need ul { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.hm-need li { background: #fff; border: 2px solid #fcd34d; border-radius: 999px; padding: 2px 12px; font-weight: 700; }
.hm-steps { margin: 0 0 12px; padding-left: 1.6em; }
.hm-steps li { margin: 0 0 8px; }
.hm-after { background: #ecfdf5; border-left: 5px solid #0f8a72; border-radius: 10px; padding: 10px 12px; margin: 0; }
.hm-after b { color: #0f766e; }
