/* joho-hako（変数・数を 入れる はこ）部品。
   はこ＝うすい みどり（名前の ふだ つき）／数の カード＝白に こい 字／計算らん＝うすい 青／← ＝オレンジで 太く
   いまの 行＝黄色く 光る／きえた カード＝灰色で 落ちる／まちがい＝赤は 使わない（黄色系） */
.jh-w { --jh-g: #0f8a72; --jh-gl: #e6f6f1; --jh-gd: #0b6b58; --jh-o: #ea580c; --jh-ol: #fff1e6; --jh-b: #2563eb; --jh-bl: #eef3ff;
  --jh-y: #f59e0b; --jh-yl: #fff4d6; --jh-ink: var(--ink, #1f2937); --jh-sub: var(--sub, #4b5563); color: var(--jh-ink); }
.jh-w * { box-sizing: border-box; }
.jh-w [hidden] { display: none !important; }
.jh-lead { margin: 0 0 6px; font-size: 1.02rem; line-height: 1.8; }
.jh-stage { margin: 0 0 4px; font-size: 1rem; font-weight: 700; color: var(--jh-gd); }
.jh-intro { margin: 0 0 8px; line-height: 1.8; }
.jh-w button { font: inherit; cursor: pointer; touch-action: manipulation; }
.jh-w button:focus-visible, .jh-w input:focus-visible { outline: 3px solid var(--jh-b); outline-offset: 2px; }
.jh-b { min-height: 48px; padding: 4px 14px; border: 2px solid #cbd5e1; border-radius: 12px; background: #fff; color: var(--jh-ink); font-weight: 700; font-size: 1rem; line-height: 1.3; }
.jh-b:disabled { opacity: .45; cursor: default; }
.jh-b.run { background: var(--jh-g); border-color: var(--jh-g); color: #fff; }
.jh-b.go { background: var(--jh-b); border-color: var(--jh-b); color: #fff; }
.jh-b.hint { border-style: dashed; color: var(--jh-sub); }

/* はこの 絵 */
.jh-svg { display: block; width: 100%; max-width: 460px; height: auto; margin: 0 auto 8px; background: #fbfcfd; border: 2px solid #e2e8f0; border-radius: 12px; }
.jh-stxt { font-size: 12px; font-weight: 700; text-anchor: middle; fill: #64748b; }
.jh-strip { fill: var(--jh-bl); stroke: #c7d6fb; stroke-width: 1.5; stroke-dasharray: 5 4; }
.jh-bin { fill: var(--jh-gl); }
.jh-bwall { fill: none; stroke: var(--jh-gd); stroke-width: 5; stroke-linejoin: round; stroke-linecap: round; }
.jh-plate { fill: var(--jh-gd); }
.jh-name { font-size: 15px; font-weight: 700; text-anchor: middle; fill: #fff; }
.jh-blab { font-size: 15px; font-weight: 700; text-anchor: middle; fill: #92400e; }
.jh-empty { font-size: 15px; text-anchor: middle; fill: #94a3b8; }
.jh-card rect { fill: #fff; stroke: #334155; stroke-width: 2.5; }
.jh-card text { font-size: 26px; font-weight: 800; text-anchor: middle; fill: #111827; }
.jh-card.copy rect { stroke-dasharray: 5 3; }
.jh-card.res rect { fill: var(--jh-ol); stroke: var(--jh-o); }
.jh-opx { font-size: 24px; font-weight: 800; text-anchor: middle; fill: #334155; }
.jh-gone { font-size: 14px; font-weight: 700; fill: #64748b; }
.jh-basket { fill: #fdf6e3; stroke: #a16207; stroke-width: 4; stroke-linejoin: round; }
.jh-ball { fill: var(--jh-o); stroke: #9a3412; stroke-width: 1.5; }

/* プログラム */
.jh-h { margin: 6px 0 4px; font-size: .9rem; font-weight: 700; color: var(--jh-sub); }
.jh-list { list-style: none; margin: 0 0 8px; padding: 0; }
.jh-list li { display: flex; align-items: center; gap: 8px; min-height: 40px; margin: 3px 0; padding: 4px 10px; border: 2px solid #e2e8f0; border-radius: 10px; background: #fff; font-size: 1.08rem; }
.jh-list li.now { background: var(--jh-yl); border-color: var(--jh-y); }
.jh-list li.jh-emp { color: #94a3b8; border-style: dashed; font-size: .95rem; }
.jh-no { flex: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #e2e8f0; font-size: .85rem; font-weight: 700; }
.jh-code { font-weight: 700; white-space: pre-wrap; }
.jh-arw { color: var(--jh-o); font-size: 1.25em; padding: 0 .1em; }
.jh-op { color: #334155; }
.jh-itn { margin-left: auto; padding: 2px 8px; border-radius: 999px; background: #fdecf4; color: #be185d; font-size: .85rem; font-weight: 700; }

/* めいれいを ならべる（swap） */
.jh-palrow { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.jh-cmd { background: var(--jh-gl); border-color: var(--jh-g); }

/* よそう */
.jh-ask:empty { display: none; }
.jh-ask { margin: 6px 0; padding: 10px 12px; border-radius: 12px; background: var(--jh-bl); }
.jh-q { margin: 0 0 8px; font-weight: 700; line-height: 1.7; }
.jh-ops { display: flex; flex-wrap: wrap; gap: 8px; }
.jh-op1.picked { border-color: var(--jh-b); box-shadow: 0 0 0 2px var(--jh-b) inset; }
.jh-op1.right { background: var(--jh-gl); border-color: var(--jh-g); opacity: 1; }
.jh-picked { margin: 8px 0 0; font-size: .95rem; color: var(--jh-sub); }

/* ボタン・返し */
.jh-run, .jh-next, .jh-hintrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.jh-note { margin: 0 0 6px; font-size: .88rem; color: var(--jh-sub); }
.jh-msg p { margin: 6px 0; padding: 8px 12px; border-radius: 10px; background: #f8fafc; line-height: 1.75; }
.jh-msg p.ok { background: var(--jh-gl); }
.jh-msg p.hm, .jh-msg p.hm2 { background: var(--jh-yl); }
.jh-tag { display: block; color: #92400e; }
.jh-hint p { margin: 4px 0; line-height: 1.7; }
.jh-hint .jh-hh { font-weight: 700; color: var(--jh-sub); font-size: .9rem; }

/* トレース表 */
.jh-twrap { max-width: 100%; overflow-x: auto; }
.jh-t { border-collapse: collapse; width: 100%; font-size: 1rem; }
.jh-t caption { text-align: left; font-size: .9rem; font-weight: 700; color: var(--jh-sub); padding: 0 0 4px; }
.jh-t th, .jh-t td { border: 1px solid #cbd5e1; padding: 4px 6px; text-align: center; }
.jh-t th { background: var(--jh-gl); font-size: .9rem; }
.jh-t td.jh-code { text-align: left; white-space: nowrap; }
.jh-t tr.now td { background: var(--jh-yl); }
.jh-t tr.done td.chg { font-weight: 800; color: var(--jh-gd); background: var(--jh-gl); }
.jh-t .jh-r0 td { color: #64748b; }
.jh-t input { width: 3.4em; min-height: 40px; font: inherit; font-weight: 700; text-align: center; border: 2px solid #94a3b8; border-radius: 8px; padding: 2px; }
.jh-no2 { color: #64748b; width: 2em; }
@media (max-width: 400px) { .jh-t { font-size: .92rem; } .jh-t th, .jh-t td { padding: 3px 3px; } .jh-t input { width: 2.9em; } }
