/* japanmap 固有スタイル */
.tool-main { max-width: 860px; }
[hidden] { display: none !important; }
.pt-tabs { overflow: visible; }

:root {
  --jm-r0: #fbd5d5; --jm-r1: #fde4b8; --jm-r2: #fdf3b0; --jm-r3: #cfeccf;
  --jm-r4: #bfe3f2; --jm-r5: #d3d1f5; --jm-r6: #f2cdea; --jm-r7: #e5d6c4;
  --jm-land: #ffffff; --jm-line: #475569;
  --jm-ok: #86efac; --jm-ng: #fca5a5; --jm-target: #fcd34d; --jm-sel: #c7d2fe;
}
html[data-theme="dark"] {
  --jm-r0: #6b3a3a; --jm-r1: #6b5230; --jm-r2: #66602a; --jm-r3: #3a5d3a;
  --jm-r4: #35596a; --jm-r5: #45447a; --jm-r6: #6a3b63; --jm-r7: #5a4c3d;
  --jm-land: #1e293b; --jm-line: #94a3b8;
  --jm-ok: #166534; --jm-ng: #991b1b; --jm-target: #b45309; --jm-sel: #4338ca;
}

.jm-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.2rem; margin-bottom: 0.8rem; }
.jm-sel { display: flex; align-items: center; gap: 0.5rem; }
.jm-sel label { margin: 0; font-size: 0.86rem; color: var(--text-sub); white-space: nowrap; }
.jm-sel select { width: auto; }
.jm-regs { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; }

.jm-map { position: relative; border: 1px solid var(--border); border-radius: var(--pt-r); background: var(--bg); overflow: hidden; }
.jm-svg { display: block; width: 100%; height: auto; max-height: 70vh; user-select: none; -webkit-user-select: none; }
.jm-svg.is-zoomed { touch-action: none; cursor: grab; }
.jm-map { --jm-asp: 0.833; }
.jm-svg .jm-p { fill: var(--jm-land); stroke: var(--jm-line); stroke-width: 0.9; stroke-linejoin: round; cursor: pointer; outline: none; }
.jm-svg.jm-color .jm-p.r0 { fill: var(--jm-r0); } .jm-svg.jm-color .jm-p.r1 { fill: var(--jm-r1); }
.jm-svg.jm-color .jm-p.r2 { fill: var(--jm-r2); } .jm-svg.jm-color .jm-p.r3 { fill: var(--jm-r3); }
.jm-svg.jm-color .jm-p.r4 { fill: var(--jm-r4); } .jm-svg.jm-color .jm-p.r5 { fill: var(--jm-r5); }
.jm-svg.jm-color .jm-p.r6 { fill: var(--jm-r6); } .jm-svg.jm-color .jm-p.r7 { fill: var(--jm-r7); }
.jm-svg .jm-p:hover { stroke: var(--pt-accent); stroke-width: 1.8; }
.jm-svg .jm-p:focus-visible { stroke: var(--pt-accent); stroke-width: 2.4; }
.jm-svg .jm-p.is-sel { fill: var(--jm-sel) !important; stroke: var(--pt-accent); stroke-width: 1.8; }
.jm-svg .jm-p.is-target { fill: var(--jm-target) !important; stroke: var(--text); stroke-width: 1.6; }
.jm-svg .jm-p.is-ok { fill: var(--jm-ok) !important; stroke: var(--text); stroke-width: 1.6; }
.jm-svg .jm-p.is-ng { fill: var(--jm-ng) !important; stroke: var(--text); stroke-width: 1.6; }
.jm-svg.is-locked .jm-p { cursor: default; }
.jm-svg .jm-inset { fill: none; stroke: var(--jm-line); stroke-width: 0.7; stroke-dasharray: 4 3; opacity: 0.6; pointer-events: none; }
.jm-lab { font-size: 9px; font-weight: 700; fill: var(--text); text-anchor: middle; pointer-events: none; stroke: var(--surface); stroke-width: 2.4px; paint-order: stroke; stroke-linejoin: round; }

.jm-zoom { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; }
.jm-zoom button { margin: 0; min-width: 2.2rem; padding: 0.3rem 0.5rem; font: inherit; font-size: 0.85rem; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--pt-r); cursor: pointer; }
.jm-zoom button:hover { border-color: var(--pt-accent); }

.jm-info { margin-top: 0.8rem; padding: 0.7rem 0.9rem; border: 1px solid var(--border); border-radius: var(--pt-r); background: var(--bg); min-height: 3.4em; line-height: 1.7; }
.jm-info strong { font-size: 1.15rem; }
.jm-info .k { color: var(--text-sub); font-size: 0.85rem; }
.jm-legend { display: flex; flex-wrap: wrap; gap: 0.3rem 0.9rem; margin-top: 0.7rem; font-size: 0.8rem; color: var(--text-sub); }
.jm-legend span { display: inline-flex; align-items: center; gap: 0.3rem; }
.jm-legend i { width: 0.9rem; height: 0.9rem; border: 1px solid var(--jm-line); border-radius: 2px; }

.jm-qhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; font-weight: 700; }
.jm-qhead .btn { margin: 0; }
.jm-prompt { font-size: 1.15rem; font-weight: 700; margin: 0.4rem 0 0.7rem; }
.jm-ans { margin-top: 0.8rem; }
.jm-choices { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
.jm-choice { margin: 0; padding: 0.7rem 0.5rem; font: inherit; font-size: 1rem; font-weight: 700; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--pt-r); cursor: pointer; }
.jm-choice:hover:not(:disabled) { border-color: var(--pt-accent); }
.jm-choice:disabled { cursor: default; }
.jm-choice.is-ok { background: var(--pt-ok-soft); border-color: var(--pt-ok-line); }
.jm-choice.is-ng { background: rgba(220, 38, 38, 0.12); border-color: #dc2626; }
.jm-typebox { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.jm-typebox input { flex: 1 1 10rem; min-width: 0; font-size: 1.05rem; }
.jm-typebox .btn { margin: 0; }
.jm-fb { margin-top: 0.7rem; min-height: 1.6em; font-weight: 700; }
.jm-fb.ok { color: #16a34a; }
.jm-fb.ng { color: #dc2626; }
html[data-theme="dark"] .jm-fb.ok { color: #4ade80; }
html[data-theme="dark"] .jm-fb.ng { color: #f87171; }

.jm-rtitle { margin: 0 0 0.4rem; font-size: 1.1rem; }
.jm-score { font-size: 1.6rem; font-weight: 700; margin: 0.2rem 0; }
.jm-wrong { width: 100%; border-collapse: collapse; margin: 0.5rem 0; font-size: 0.9rem; }
.jm-wrong th, .jm-wrong td { text-align: left; padding: 0.35rem 0.5rem; border-bottom: 1px solid var(--border); }
.jm-wrong th { color: var(--text-sub); font-weight: 500; }

.jm-prevwrap { overflow: hidden; background: var(--bg); border: 1px solid var(--border); border-radius: var(--pt-r); padding: 0.6rem; }
.jm-prev { transform-origin: 0 0; }
.jm-source { margin: 1rem 0; font-size: 0.78rem; color: var(--text-sub); line-height: 1.6; }

/* 用紙（A4。余白10mmの内側） */
.jm-sheet { box-sizing: border-box; background: #fff; color: #111; font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif; padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.jm-sheet.jm-portrait { width: 190mm; height: 276mm; }
.jm-sheet.jm-landscape { width: 277mm; height: 189mm; }
.jm-prev .jm-sheet { box-shadow: 0 0 0 1px #cbd5e1; margin-bottom: 8mm; }
.jm-sh-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 8mm; height: 11mm; flex: none; border-bottom: 0.4mm solid #333; padding-bottom: 1.5mm; margin-bottom: 3mm; }
.jm-sh-title { font-size: 5.5mm; font-weight: 700; }
.jm-sh-fields { font-size: 3.6mm; white-space: nowrap; }
.jm-sh-fields span { display: inline-block; border-bottom: 0.3mm solid #333; width: 32mm; margin: 0 2mm 0 1mm; height: 1em; vertical-align: bottom; }
.jm-sh-fields span.d { width: 22mm; }
.jm-sh-body { flex: 1 1 0; min-height: 0; display: flex; gap: 4mm; }
.jm-landscape .jm-sh-body { flex-direction: row; }
.jm-portrait .jm-sh-body { flex-direction: column; }
.jm-sh-map { flex: 1 1 0; min-width: 0; min-height: 0; display: flex; justify-content: center; align-items: center; }
.jm-sh-map svg { max-width: 100%; max-height: 100%; width: auto; height: auto; display: block; }
.jm-sheet.jm-num.jm-landscape .jm-sh-map { flex: 0 0 52%; }
.jm-sh-list { list-style: none; margin: 0; padding: 0; column-gap: 5mm; font-size: 3.5mm; line-height: 1; align-content: start; }
.jm-landscape .jm-sh-list { flex: 1 1 0; }
.jm-portrait .jm-sh-list { flex: none; }
.jm-sh-list li { display: flex; align-items: flex-end; gap: 1.5mm; break-inside: avoid; height: 6.2mm; }
.jm-sh-list b { flex: none; width: 5.5mm; text-align: right; font-weight: 700; }
.jm-sh-list i { flex: 1 1 auto; font-style: normal; border-bottom: 0.3mm solid #555; min-height: 1em; padding: 0 1mm 0.4mm; color: #b91c1c; font-weight: 700; white-space: nowrap; }

#jm-printroot { display: none; }
@media print {
  body > *:not(#jm-printroot) { display: none !important; }
  html, body { background: #fff !important; }
  #jm-printroot { display: block !important; }
  #jm-printroot .jm-sheet { break-after: page; page-break-after: always; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #jm-printroot .jm-sheet:last-child { break-after: auto; page-break-after: auto; }
}
