/* 数のしくみ（num）部品。青＝一のくらい・1こ分、オレンジ／みどり＝ぬった数、赤点線＝あまり */
.nm-w { --nm-b: #2563eb; --nm-bl: #eaf1ff; --nm-o: #f59e0b; --nm-od: #b45309; --nm-g: #5cc2a8; --nm-gd: #0f766e; --nm-r: #c2410c; }
.nm-svg { width: 100%; height: auto; display: block; margin: 4px 0; touch-action: manipulation; }
.nm-svg text { font-weight: 700; fill: var(--ink, #1f2937); }
.nm-mv { transition: transform .5s ease; }
.nm-in { animation: nm-in .35s ease both; }
.nm-z, .nm-late { animation: nm-in .3s ease .45s both; }
@keyframes nm-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .nm-mv { transition: none; } .nm-in, .nm-z, .nm-late { animation: none; } }

/* place */
.nm-ph { fill: #f3f4f6; stroke: #9ca3af; stroke-width: 1.5; }
.nm-pc { fill: #fff; stroke: #9ca3af; stroke-width: 1.5; }
.nm-ph.one { fill: var(--nm-bl); }
.nm-pc.one { fill: #f5f8ff; stroke: var(--nm-b); stroke-width: 3; }
.nm-svg .nm-pt { font-size: 26px; }
.nm-svg .nm-pt.s { font-size: 23px; }
.nm-svg .nm-pf { font-size: 23px; }
.nm-pl { stroke: var(--ink, #1f2937); stroke-width: 1.5; }
.nm-tile { fill: var(--nm-o); stroke: var(--nm-od); stroke-width: 2; }
.nm-svg .nm-d { font-size: 40px; }
.nm-svg .nm-z { font-size: 40px; fill: var(--sub, #4b5563); }
.nm-dot { fill: var(--nm-r); }
.nm-dot.dim { fill: #d1d5db; }

/* grid */
.nm-gc { fill: #fff; stroke: #d1d5db; stroke-width: 1; }
.nm-o { fill: var(--nm-o); }
.nm-gr { fill: var(--nm-g); }
.nm-svg .nm-gt { font-size: 24px; pointer-events: none; }
.nm-ring { fill: none; stroke: var(--nm-b); stroke-width: 4; }
.nm-pick { fill: none; stroke: var(--ink, #1f2937); stroke-width: 3; stroke-dasharray: 5 3; }
.nm-hit { fill: transparent; cursor: pointer; }

/* rect / pair */
.nm-bk { fill: var(--nm-o); stroke: var(--nm-od); stroke-width: 1.5; }
.nm-bk.x { fill: #fde2d6; stroke: var(--nm-r); }
.nm-rem { fill: none; stroke: var(--nm-r); stroke-width: 2.5; stroke-dasharray: 6 4; }
.nm-pr { fill: var(--nm-bl); stroke: var(--nm-b); stroke-width: 2; }
.nm-svg .nm-side { font-size: 26px; fill: var(--nm-b); }

/* tree / league */
.nm-nc { fill: #fff; stroke: var(--ink, #1f2937); stroke-width: 2; }
.nm-nd.open .nm-nc { stroke-dasharray: 4 3; stroke: var(--nm-b); }
.nm-nd.open { cursor: pointer; }
.nm-nd.dup { opacity: .3; }
.nm-svg .nm-nt { font-size: 23px; pointer-events: none; }
.nm-svg .nm-nt.w { fill: #fff; }
.nm-ln { fill: none; stroke: #6b7280; stroke-width: 2; }
.nm-ln.dup { opacity: .3; }
.nm-svg .nm-plus { font-size: 24px; fill: var(--nm-b); pointer-events: none; }
.nm-svg .nm-leaf { font-size: 24px; }
.nm-svg .nm-leaf.dup { fill: #9ca3af; text-decoration: line-through; }
.nm-svg .nm-same { font-size: 23px; fill: var(--nm-r); }
.nm-tc { fill: #fff; stroke: #9ca3af; stroke-width: 1.5; cursor: pointer; }
.nm-tc.diag { fill: #e5e7eb; cursor: default; }
.nm-tc.on { fill: #fff4dc; }
.nm-tc.same { fill: #f9fafb; }
.nm-dg { stroke: #9ca3af; stroke-width: 2; pointer-events: none; }
.nm-svg .nm-mk { font-size: 26px; fill: var(--nm-od); pointer-events: none; }
.nm-svg .nm-mk.s { fill: #9ca3af; }

/* HTML */
.nm-f { display: inline-flex; flex-direction: column; align-items: center; vertical-align: middle; line-height: 1.15; margin: 0 .12em; font-weight: 700; }
.nm-f > span { padding: 0 .2em; }
.nm-f > span + span { border-top: 2px solid currentColor; }
.nm-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 8px; }
.nm-q { font-weight: 700; margin: 0 0 8px; line-height: 2; }
.nm-w button { font: inherit; cursor: pointer; color: var(--ink, #1f2937); }
.nm-b, .nm-g, .nm-p { min-height: 48px; padding: 4px 14px; border: 2px solid var(--line, #e5e7eb); background: #fff; border-radius: 12px; font-weight: 700; }
.nm-g { border-color: var(--ink, #1f2937); min-width: 64px; }
.nm-g[aria-pressed="true"], .nm-p[aria-pressed="true"] { border-color: var(--nm-b); background: var(--nm-bl); }
.nm-p { border-radius: 999px; font-size: .9rem; min-height: 44px; }
.nm-b.go { background: var(--nm-b); border-color: var(--nm-b); color: #fff; }
.nm-b.up { border-color: var(--nm-od); }
.nm-b.co[aria-pressed="true"] { background: var(--nm-o); border-color: var(--nm-od); }
.nm-b.cg[aria-pressed="true"] { background: var(--nm-g); border-color: var(--nm-gd); }
.nm-b.back { border-style: dashed; font-weight: 400; }
.nm-b.sq { width: 48px; padding: 0; font-size: 1.3rem; }
.nm-w button:disabled { opacity: .45; cursor: default; }
.nm-lab { font-size: .9rem; color: var(--sub, #4b5563); font-weight: 700; }
.nm-num { font-size: 1.4rem; min-width: 1.6em; text-align: center; }
.nm-read { background: #f3f6ff; border-radius: 12px; padding: 8px 14px; min-height: 56px; }
.nm-read p { margin: 4px 0; }
.nm-big { font-size: 1.2rem; font-weight: 700; text-align: center; line-height: 2.2; }
.nm-note { font-size: .95rem; line-height: 1.9; }
.nm-note.s { font-size: .85rem; color: var(--sub, #4b5563); }
.nm-res { font-weight: 700; }
.nm-res.ok { color: var(--ok, #0f8a72); }
.nm-res.ng i { color: var(--ng, #c2410c); font-style: normal; }
.nm-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.nm-c { min-width: 2em; padding: 0 4px; text-align: center; border: 1.5px solid var(--line, #e5e7eb); border-radius: 8px; background: #fff; font-weight: 700; font-size: .9rem; line-height: 1.8; }
.nm-c.on { background: var(--nm-o); border-color: var(--nm-od); }
.nm-c.top { outline: 3px solid var(--nm-b); }
.nm-c.no { color: #9ca3af; text-decoration: line-through; }
.nm-c.gu { background: var(--nm-g); border-color: var(--nm-gd); }
.nm-c.ki { background: var(--nm-o); border-color: var(--nm-od); }
.nm-cl { margin: 4px 0; font-weight: 700; }
.nm-cl .nm-chips { display: inline-flex; vertical-align: middle; margin: 0 0 0 4px; }
.nm-dot.no { display: none; }
