.tracing-maker{--accent:#1759be;--trace:#CCCCCC;--cell:24mm;--glyph:16.5mm;--gap:7.5mm;background:#eef2f7;color:#18314b}
.tracing-maker .site-header{max-width:none;background:#fff;padding:17px max(24px,calc((100vw - 1184px)/2));flex-wrap:wrap}
.tracing-maker .site-header nav{gap:14px 22px;font-size:14px}.tracing-maker .site-header nav [aria-current=page]{color:var(--accent);text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:6px}
.tracing-app{max-width:1250px;padding:24px 30px 48px;margin:0 auto}
.app-heading{display:flex;align-items:center;justify-content:space-between;gap:24px;margin-bottom:24px}.app-heading h1{font-size:24px;margin:0 0 6px;line-height:1.5}.app-heading p{font-size:14px;color:#53657a;margin:0}
.print-button{font:inherit;font-size:14px;font-weight:700;background:var(--accent);border:0;border-radius:9px;padding:13px 22px;color:#fff;white-space:nowrap;cursor:pointer}.print-button:hover{background:#104591}
.editor-layout{display:grid;grid-template-columns:248px minmax(0,1fr);gap:28px;align-items:start}.editor-controls{display:flex;flex-direction:column;gap:14px;position:sticky;top:20px}.control-panel{background:#fff;border:1px solid #dbe2ed;border-radius:11px;padding:18px}.control-panel h2{font-size:15px;margin:0 0 14px}.control-panel label{font-size:14px;font-weight:650;display:block;margin:14px 0 6px}.control-panel label small{font-size:12px;color:#6a7b8f;font-weight:400;margin-left:5px}.control-panel input,.control-panel textarea,.control-panel select{font:inherit;font-size:14px;color:#23394f;border:1px solid #c8d3df;border-radius:6px;background:#fff;padding:9px 10px;width:100%;resize:vertical}.control-panel p{font-size:13px;line-height:1.8;color:#54667b;margin:8px 0 12px}.format-note{display:flex;justify-content:space-between;gap:8px;border-top:1px solid #e4e9f0;padding-top:12px;margin-top:16px;color:#67788a;font-size:12px}.word-list summary{font-size:14px;font-weight:650;cursor:pointer}.word-list h3{font-size:12px;color:#506680;margin:14px 0 4px}.word-list p{font-size:13px;margin:0;line-height:1.9}.input-message{font-size:13px;line-height:1.7;color:#815422;margin:0 3px}.input-message:empty{display:none}
.worksheet-area{min-width:0}.preview-label{display:flex;justify-content:space-between;align-items:center;font-size:13px;color:#617187;margin-bottom:12px}.sheet-wrap{width:min(100%,210mm);position:relative;margin:0 auto}.tracing-sheet{position:relative;width:210mm;height:297mm;padding:13mm 14mm;background:#fff;color:#222;transform-origin:top left;box-shadow:0 4px 20px #17385812,0 0 0 1px #dbe2ed;overflow:hidden}
.worksheet-heading{height:33mm;position:relative;padding-top:1mm}.worksheet-heading h2{font-family:"UD Digi Kyokasho N-R","UD デジタル 教科書体 N-R","BIZ UDGothic","Yu Gothic",sans-serif;text-align:center;font-size:20pt;line-height:1.45;margin:0;font-weight:600;overflow-wrap:anywhere}.worksheet-heading p{font-size:10.5pt;line-height:1.8;margin:3mm 0 0;white-space:pre-wrap;overflow-wrap:anywhere}.heading-placeholder{font-size:11px;color:#7c8c9e;display:block;text-align:center;padding-top:8mm}.worksheet-heading.has-text .heading-placeholder{display:none}
.writing-rows{display:flex;flex-direction:column;gap:8mm}.writing-row{display:grid;grid-template-columns:122mm 36mm;column-gap:24mm;align-items:center;height:38mm;position:relative}.word-area{width:calc(var(--word-width) + 2px);position:relative}.row-tools{min-width:44mm;position:absolute;top:-6.5mm;left:0;right:0;display:flex;align-items:center;justify-content:space-between;font-size:11px;line-height:1.5;color:#728096}.row-tools strong{font-size:12px;font-weight:600;color:#587192}.row-tools button{font:inherit;font-size:11px;color:#63768b;border:0;background:transparent;cursor:pointer;padding:2px 0;text-decoration:underline;text-underline-offset:3px}.row-tools button:disabled{opacity:.35;cursor:default}.row-counter{position:absolute;bottom:-6mm;left:0;width:max(100%,44mm);text-align:right;white-space:nowrap;font-size:11px;color:#8692a0;line-height:1.5}
.writing-row{grid-template-areas:"word picture"}.word-area{grid-area:word}.picture-slot{grid-area:picture}.tracing-sheet:not(.matching) .writing-row{grid-template-columns:36mm 122mm;grid-template-areas:"picture word"}
.word-boxes{position:relative;width:var(--word-width);height:var(--cell);overflow:clip;border:1px solid #9fabb6;background:#fff;box-sizing:content-box}.word-boxes:focus-within{outline:2px solid #5c8ad1;outline-offset:3px}.cell-grid{position:absolute;inset:0;display:grid;grid-template-columns:repeat(var(--cells),1fr);pointer-events:none}.writing-cell{position:relative;border-right:1px solid #aab4bc}.writing-cell:last-child{border-right:0}.writing-cell::before{content:"";position:absolute;left:50%;top:0;bottom:0;border-left:1px dashed #e3e7eb}.writing-cell::after{content:"";position:absolute;top:50%;left:0;right:0;border-top:1px dashed #e3e7eb}
.word-input{position:absolute;left:0;top:0;width:calc(100% + var(--gap));height:100%;margin:0;padding:0 0 0 calc(var(--gap)/2);border:0!important;border-radius:0;outline:none!important;box-shadow:none;background:transparent!important;color:var(--trace)!important;-webkit-text-fill-color:var(--trace);caret-color:var(--accent);font-family:"UD Digi Kyokasho N-R","UD デジタル 教科書体 N-R","UD Digi Kyokasho NP-R","BIZ UDGothic","Yu Gothic",Meiryo,sans-serif;font-size:var(--glyph);font-weight:400;font-variant-ligatures:none;letter-spacing:var(--gap);line-height:var(--cell);appearance:none;box-sizing:border-box}
.picture-area{width:36mm;height:36mm;display:flex;align-items:center;justify-content:center;position:relative}.picture-area img{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain}.picture-message{font-family:"Yu Gothic",Meiryo,sans-serif;text-align:center;font-size:10pt;color:#738091;line-height:1.6;margin:0;letter-spacing:.3px}.picture-area[data-state=empty]{border:1px dashed #dce3eb;border-radius:8px}.picture-area[data-state=empty] .picture-message{font-size:11px;color:#8b99a9}.picture-area[data-state=missing]{border:1px dashed #ced6e0;border-radius:8px}.picture-area[data-state=loading] .picture-message{color:#8190a0;font-size:11px}.worksheet-footer{position:absolute;bottom:8mm;left:0;right:0;text-align:center;font-size:8pt;color:#9aa2a9;letter-spacing:.08em}
.tracing-maker button:focus-visible,.control-panel input:focus-visible,.control-panel textarea:focus-visible,.control-panel select:focus-visible,.word-list summary:focus-visible{outline:3px solid #7ba8ec;outline-offset:3px}

.control-panel label output{float:right;font-weight:500;color:#51667e}.control-panel input[type=range]{padding:0;border:0;accent-color:var(--accent);cursor:pointer}.control-panel .checkbox-label{display:flex;align-items:center;gap:9px;cursor:pointer}.control-panel .checkbox-label input{width:17px;height:17px;margin:0;accent-color:var(--accent)}.secondary-button{font:inherit;font-size:13px;border:1px solid #c5d1e0;border-radius:6px;background:#f6f9fd;color:#214e84;padding:9px 12px;cursor:pointer;width:100%}.secondary-button:disabled{opacity:.45;cursor:default}.print-button:disabled{opacity:.6;cursor:wait}.picture-slot{position:relative;width:36mm;height:36mm}.matching .has-word .word-area::after,.matching .picture-slot.has-picture::before{content:"";position:absolute;width:4.4mm;height:4.4mm;border-radius:50%;background:#b6b6b6;top:50%;transform:translateY(-50%)}.matching .has-word .word-area::after{right:-7.1mm}.matching .picture-slot.has-picture::before{left:-7.1mm}
@media(max-width:1020px){.tracing-app{padding:22px}.editor-layout{grid-template-columns:220px minmax(0,1fr);gap:22px}.control-panel{padding:15px}.app-heading h1{font-size:22px}}
@media(max-width:760px){.tracing-app{padding:18px 14px 32px}.tracing-maker .site-header{padding:15px 18px}.tracing-maker .site-header nav{font-size:13px;gap:9px 18px}.app-heading{flex-wrap:wrap;gap:13px;margin-bottom:18px}.app-heading h1{font-size:21px}.app-heading p{font-size:13px}.print-button{width:100%}.editor-layout{display:flex;flex-direction:column;gap:20px}.editor-controls{position:static;width:100%;gap:12px}.control-panel{padding:14px}.control-panel h2{margin-bottom:10px}.control-panel p{margin:6px 0}.format-note{margin-top:9px;padding-top:9px}.worksheet-area{width:100%}.preview-label{font-size:12px}}
@page{size:A4 portrait;margin:0}
@media print{html,body.tracing-maker{width:210mm!important;height:297mm!important;margin:0!important;padding:0!important;background:#fff!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}.site-header,.app-heading,.editor-controls,.preview-label,.screen-only,.row-tools,.row-counter,noscript{display:none!important}.tracing-app,.editor-layout,.worksheet-area{display:block!important;max-width:none!important;width:210mm!important;padding:0!important;margin:0!important;min-height:0!important}.sheet-wrap{width:210mm!important;height:297mm!important;margin:0!important}.tracing-sheet{transform:none!important;box-shadow:none!important;break-inside:avoid;page-break-inside:avoid}.word-boxes:focus-within{outline:none!important}.word-input{color:var(--trace)!important;-webkit-text-fill-color:var(--trace)!important}.picture-area[data-state=empty]{border:0}.picture-area[data-state=empty] .picture-message{display:none}.picture-area[data-state=missing]{border:0}}

/* Input stays hiragana; the separate glyph layer controls screen and print support. */
.trace-letter,.edit-letter{position:absolute;inset:0;display:grid;place-items:center;color:var(--trace);font-family:var(--tracing-font,"UD デジタル 教科書体 N", "UD Digi Kyokasho N", "UD デジタル 教科書体 N-R", "UD Digi Kyokasho N-R", "BIZ UDGothic", sans-serif);font-size:var(--glyph);font-weight:400;font-synthesis:none;line-height:1;z-index:1}
.word-input{color:transparent!important;-webkit-text-fill-color:transparent!important}
/* SVG ink bounds center full kana; small kana retain their size and lower-left placement. */
.trace-letter svg,.edit-letter svg{display:block;width:100%;height:100%;overflow:visible;fill:currentColor}
.trace-letter text,.edit-letter text{font-family:inherit;font-weight:400;font-synthesis:none}
.edit-letter{visibility:hidden}
@media screen{.word-boxes:focus-within .trace-letter{visibility:hidden}.word-boxes:focus-within .edit-letter{visibility:visible}}
@media print{.word-input,.edit-letter{display:none!important}.trace-letter{visibility:visible!important}}

.font-status{font-size:14px;color:#53657a;margin:0 0 16px}.font-status:empty{display:none}
.print-font-warning{display:none}
body:not(.tracing-font-ready) .trace-letter,body:not(.tracing-font-ready) .edit-letter{visibility:hidden!important}
@media print{body:not(.tracing-font-ready) .tracing-sheet{display:none!important}body:not(.tracing-font-ready) .print-font-warning{display:block!important;margin:20mm;font-size:14pt}}

.font-fallback{font-size:12px;color:#67788a;margin:0 0 16px}.font-fallback:empty{display:none}

/* Automated sheets omit unused rows; normal editing keeps its empty inputs. */
.batch-mode .writing-row:not(.has-word){display:none}
@media print{.writing-row:not(.has-word){display:none}}
.batch-mode .worksheet-heading h2,.batch-mode .worksheet-heading p,.batch-mode .worksheet-footer{font-family:var(--tracing-font);font-weight:400;font-synthesis:none}


/* Each selected group is a real A4 sheet, including in the browser print dialog. */
.sheet-wrap + .sheet-wrap{margin-top:28px}
@media print{
 html,body.tracing-maker{height:auto!important}
 .sheet-wrap{break-after:page;page-break-after:always;break-inside:avoid;page-break-inside:avoid}
 .sheet-wrap:last-child{break-after:auto;page-break-after:auto}
 .sheet-wrap + .sheet-wrap{margin-top:0!important}
}
@media screen and (min-width:761px){.editor-controls{max-height:calc(100vh - 40px);overflow-y:auto;overscroll-behavior:contain}}

/* Batch non-matching pages use the existing picture-left mode with room for 32mm cells. */
.batch-mode .tracing-sheet:not(.matching) .writing-row{grid-template-columns:36mm minmax(0,1fr);column-gap:8mm}

/* Compact visual controls; hidden compatibility fields are not editable. */
.maker-mode-buttons{display:flex;gap:8px;margin-bottom:18px}
.maker-mode-buttons button{flex:1;min-width:0;min-height:74px;padding:8px 3px;border:1px solid #c5d1e0;border-radius:8px;background:#fff;color:inherit;font:inherit;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px}
.maker-mode-buttons button[aria-pressed="true"]{border:2px solid var(--accent);padding:7px 2px;background:#edf7f0;color:var(--accent)}
.maker-mode-buttons .mode-symbol{font-size:30px;font-weight:500;line-height:1.2;width:36px;height:36px}
.maker-mode-buttons small{font-size:11px;white-space:nowrap}

/* Opening cue points into the first input without moving or covering the sheet. */
.input-start-hint{position:absolute;z-index:5;left:0;bottom:calc(100% + 7mm);padding:2mm 3mm;border:1px solid var(--accent);border-radius:2mm;background:#fff;color:var(--accent);font:500 12pt/1.4 sans-serif;white-space:nowrap;pointer-events:none;box-shadow:0 2px 8px #00000012;animation:input-cue 3.6s ease both}
.input-start-hint::after{content:"";position:absolute;top:100%;left:6mm;height:10mm;border-left:1.5px solid var(--accent)}
.input-start-hint::before{content:"";position:absolute;top:calc(100% + 9mm);left:calc(6mm - 2px);width:5px;height:5px;background:var(--accent);border-radius:50%}
@keyframes input-cue{0%{opacity:0}8%,82%{opacity:1}100%{opacity:0}}
@media(prefers-reduced-motion:reduce){.input-start-hint{animation:none}}

.opening-demo-hint{animation:none;opacity:1}
.opening-demo-input{outline:2px solid var(--accent);outline-offset:3px}
@media screen{.opening-demo-input .trace-letter{visibility:hidden}.opening-demo-input .edit-letter{visibility:visible}}

/* Continuous opening demonstration, with immediate cancellation on interaction. */
.opening-demo-active .opening-demo-hint{animation:demo-appear .45s ease both;transition:opacity .18s ease}
.opening-demo-active .opening-demo-hint.demo-caption-changing{opacity:0;animation:none}
.opening-demo-active .picture-message{visibility:hidden}
.opening-demo-active .picture-area img{animation:demo-appear .65s ease both}
.opening-demo-active .demo-letter-enter{animation:demo-appear .4s ease both}
.opening-demo-active .edit-letter,.opening-demo-active .picture-area,.opening-demo-active .opening-demo-hint{transition:opacity .5s ease,transform .5s ease}
.opening-demo-leaving .edit-letter,.opening-demo-leaving .picture-area,.opening-demo-leaving .opening-demo-hint{opacity:0;transform:translateY(-2px);animation:none}
.opening-demo-input{outline-color:transparent;box-shadow:0 0 0 2px var(--accent);transition:box-shadow .5s ease}
.opening-demo-leaving .opening-demo-input{box-shadow:0 0 0 2px transparent}
@keyframes demo-appear{from{opacity:0;transform:translateY(3px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.opening-demo-active *{animation:none!important;transition:none!important}}

/* Four or more kana automatically use A4 landscape, on screen and in print. */
.tracing-landscape .sheet-wrap{width:min(100%,297mm)}
.tracing-landscape .tracing-sheet{width:297mm;height:210mm;padding:8mm 14mm}
.tracing-landscape .worksheet-heading{height:18mm}
.tracing-landscape .writing-rows{gap:2mm}
.tracing-landscape .writing-row{height:32mm;grid-template-columns:209mm 36mm;column-gap:24mm}
.tracing-landscape .tracing-sheet:not(.matching) .writing-row{grid-template-columns:36mm 209mm;column-gap:24mm}
.tracing-landscape .picture-area,.tracing-landscape .picture-slot{height:32mm}
.tracing-landscape .worksheet-footer{bottom:4mm}
@media print{
 html:has(body.tracing-landscape),body.tracing-landscape,
 .tracing-landscape .tracing-app,.tracing-landscape .editor-layout,.tracing-landscape .worksheet-area{width:297mm!important}
 .tracing-landscape .sheet-wrap{width:297mm!important;height:210mm!important}
}

@media screen and (prefers-reduced-motion:no-preference){
 .tracing-sheet{transition:width .37s ease-in-out,height .37s ease-in-out,padding .37s ease-in-out}
 .worksheet-heading{transition:height .37s ease-in-out}
 .writing-rows{transition:gap .37s ease-in-out}
 .writing-row{transition:height .37s ease-in-out,grid-template-columns .37s ease-in-out,column-gap .37s ease-in-out}
 .word-area,.word-boxes{transition:width .37s ease-in-out,height .37s ease-in-out}
 .picture-area,.picture-slot{transition:height .37s ease-in-out}
 .worksheet-footer{transition:bottom .37s ease-in-out}
 .sheet-wrap{transition:width .37s ease-in-out}
}

/* Long words retain 28mm squares on two lines; each sheet is a complete matching set. */
.cell-grid{grid-template-columns:repeat(var(--columns,var(--cells)),1fr);grid-template-rows:repeat(var(--lines,1),1fr)}
.word-boxes{height:calc(var(--cell) * var(--lines,1))}
.two-line-word:not([data-cols="5"]):not([data-cols="6"]) .writing-cell:nth-child(4){border-right:0}
.two-line-word:not([data-cols="5"]):not([data-cols="6"]) .writing-cell:nth-child(n+5){border-top:1px solid #aab4bc}
/* 9文字以上の恐竜の名前（A4よこ）：1行5マス・6マス（2026-10-29） */
.two-line-word[data-cols="5"] .writing-cell:nth-child(5),.two-line-word[data-cols="6"] .writing-cell:nth-child(6){border-right:0}
.two-line-word[data-cols="5"] .writing-cell:nth-child(n+6),.two-line-word[data-cols="6"] .writing-cell:nth-child(n+7){border-top:1px solid #aab4bc}
.two-line-word .word-input{height:var(--cell)}
.tracing-landscape .three-row-sheet .writing-rows{gap:2mm}
.tracing-landscape .three-row-sheet .writing-row{height:56mm}
.tracing-landscape .three-row-sheet .worksheet-heading{height:18mm}
/* 一括作成の A4よこ・1枚2こ（恐竜の名前のカタカナ。2026-10-22）：絵を大きく、7文字以上は2行の大きいマス */
.tracing-landscape .two-row-sheet .writing-rows{gap:10mm;padding-top:6mm}
.tracing-landscape .two-row-sheet .writing-row,.batch-mode.tracing-landscape .two-row-sheet:not(.matching) .writing-row{height:76mm;grid-template-columns:80mm 177mm;column-gap:12mm}
.tracing-landscape .two-row-sheet .picture-area,.tracing-landscape .two-row-sheet .picture-slot{width:80mm;height:76mm}
.tracing-landscape .two-row-sheet .word-area{align-self:center}
@media print{.empty-print-sheet{display:none!important}}

@media print{.last-print-sheet{break-after:auto!important;page-break-after:auto!important}.writing-row{transform:none!important}}

/* Printing and batch export always use final geometry, never an in-between frame. */
.batch-mode .tracing-sheet,.batch-mode .tracing-sheet *{transition:none!important}
@media print{
 .tracing-sheet,.tracing-sheet *,.sheet-wrap{transition:none!important;animation:none!important}
 .word-boxes{width:var(--word-width)!important;height:calc(var(--cell) * var(--lines,1))!important}
}

/* Native input keeps editing/selection, while SVG alone renders the visible kana. */
.word-input::selection{
 color:transparent!important;
 -webkit-text-fill-color:transparent!important;
 text-shadow:none!important;
 background:rgba(23,89,190,.18);
}
.word-input::-moz-selection{
 color:transparent!important;
 text-shadow:none!important;
 background:rgba(23,89,190,.18);
}
.tracing-maker:not(.tracing-landscape) .tracing-sheet:not(.matching) .writing-row{grid-template-columns:36mm minmax(0,1fr);column-gap:8mm}


/* Whole-word PNGs retain the existing grid and never substitute another typeface. */
.word-image{position:absolute;left:0;top:0;width:var(--word-width);height:calc(var(--cell) * var(--lines,1));z-index:1;pointer-events:none;overflow:hidden}
.word-image img{display:block;width:var(--word-width);height:calc(var(--cell) * var(--lines,1));max-width:none}
.word-image.first-only{width:var(--cell);height:var(--cell)}
.word-image-edit{visibility:hidden}
.font-fallback,.print-font-warning{white-space:pre-line}
@media screen{
 .word-boxes:focus-within .word-image-trace,.opening-demo-input .word-image-trace{visibility:hidden}
 .word-boxes:focus-within .word-image-edit,.opening-demo-input .word-image-edit{visibility:visible}
 .word-input.unavailable-word{color:var(--trace)!important;-webkit-text-fill-color:var(--trace)!important}
}
@media print{
 .word-image-edit{display:none!important}.word-image-trace{visibility:visible!important}
 .tracing-print-blocked .tracing-sheet{display:none!important}
 .tracing-print-blocked .print-font-warning{display:block!important;margin:20mm;font-size:14pt}
}

/* Only the preview labels words drawn with BIZ UD Gothic. */
.word-font-note{position:absolute;left:0;top:calc(100% + 1mm);font:400 10px/1.4 Meiryo,sans-serif;color:#67788a;white-space:nowrap;pointer-events:none}
.word-font-note[hidden]{display:none}
@media print{.word-font-note{display:none!important}}


/* Title PNGs use the same 20pt / 1.45 line box, including seasonal headings. */
.tracing-title-box{display:inline-block;position:relative;height:1.45em;vertical-align:top}
.tracing-title-image{display:block;position:absolute;max-width:none}

/* 1枚の量：すくなめ（たて・1枚3問）。行・絵・マスを大きくして紙面を使う */
.less-sheet .writing-rows{gap:12mm}
/* 線むすびの「すくなめ」：問題を紙の上から下まで広げて、線を引く間をあける */
.tracing-sheet.matching.less-match:not([hidden]){display:flex;flex-direction:column}
.tracing-sheet.matching.less-match .writing-rows{flex:1;justify-content:space-evenly;gap:0;padding-bottom:6mm}
.less-sheet .writing-row{height:62mm}
.tracing-maker:not(.tracing-landscape) .tracing-sheet.less-sheet:not(.matching) .writing-row{grid-template-columns:46mm minmax(0,1fr)}
.less-sheet:not(.matching) .picture-area,.less-sheet:not(.matching) .picture-slot{width:46mm;height:46mm}
/* かきかた：よむ（濃い字・マスなし）／おとのかず（1音に1つの〇） */
body.mode-read{--trace:#243246}
body.mode-read .writing-cell,body.mode-oto .writing-cell{border-right:0!important;border-top:0!important}
body.mode-read .writing-cell::before,body.mode-read .writing-cell::after,body.mode-oto .writing-cell::before{display:none}
body.mode-oto .trace-letter,body.mode-oto .word-image-trace{display:none!important}
body.mode-oto .writing-cell::after{content:"";position:absolute;inset:16%;border:2.5px solid #243246;border-top:2.5px solid #243246;border-radius:50%;background:#fff}
body.mode-oto .writing-cell.oto-off::after{display:none}
body.mode-oto .edit-letter{z-index:1}
body.mode-read .word-boxes,body.mode-oto .word-boxes{border-color:transparent!important;background:transparent!important}
/* 余白を切り落とした絵を、枠いっぱいに（2026-10-15）。iOSのPDF化（html2canvas）はobject-fitを無視して絵をゆがませるため、width/height:100%ではなくmax-width/max-heightで収める（2026-10-17） */
.picture-area img{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain}
body.mode-oto .writing-cell.oto-small::after{inset:34%;border-width:2px}
/* 拗音の小さい〇：前の大きい〇の右下にくっつける（2026-10-26。マスは js で細くしている） */
body.mode-oto:not(.dir-tate) .writing-cell.oto-small::after{inset:auto;left:calc(var(--cell) * -.06);bottom:16%;width:calc(var(--cell) * .4);height:calc(var(--cell) * .4);box-sizing:border-box}
@media screen{body.mode-oto .word-boxes:not(:focus-within) .word-input{color:transparent!important;-webkit-text-fill-color:transparent!important}}
/* だんかいスライダーで決めるので、やること・なぞりの補助は画面に出さない（2026-10-15） */
#mode-label,.write-mode-buttons,#trace-support,label[for="trace-support"]{display:none!important}
.stage-control{margin-bottom:14px}
.stage-control .manabi-age-head{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
.stage-name{font-weight:700;color:#1F6E40;font-size:15px;flex-basis:100%}
.stage-track{padding-top:6px}
.stage-scale{position:relative;height:48px;margin:4px 12px 0;font-size:12px;color:#5f6b78}
.stage-scale span{position:absolute;top:0;transform:translateX(-50%);white-space:nowrap}
body.mode-oto .writing-cell.oto-mark::after{background:#FCE3A6}
.stage-why{margin:8px 0 0;padding:8px 10px;border-radius:8px;background:#F3F7F4;color:#3d4a43;font-size:13px;line-height:1.6}
/* えを ゆびさす／なまえを いう（2026-10-15） */
/* ゆびさし・いう（2026-10-15）：A4を半分に折ってA5で使う。A5に1題。見出し・フッターなし。
   上も下も絵は同じ向き。支援者が読むことばは各半分の上のはしに、子どもと反対向き（向かいに座った大人から読める向き）で入れる。
 */
body.mode-point .tracing-sheet{padding:0!important}
body.mode-point .worksheet-heading,body.mode-point .worksheet-footer{display:none!important}
body.mode-point .writing-rows{gap:0!important;height:297mm}
body.mode-point .tracing-sheet .writing-row{display:block!important;height:148.5mm!important;position:relative}
body.mode-point .picture-area,body.mode-point .cell-grid,body.mode-point .trace-letter,body.mode-point .word-image,body.mode-point .word-font-note{display:none!important}
body.mode-point .picture-slot{position:absolute!important;inset:0;width:auto!important;height:auto!important;display:block}
body.mode-point .picture-slot>.point-choices{position:absolute;left:12mm;right:12mm;top:22mm;height:114.5mm;width:auto}
body.mode-point .word-area{position:absolute!important;left:50%;top:5mm;width:110mm!important;margin-left:-55mm;height:12mm;z-index:1}
body.mode-point .word-boxes{width:110mm!important;height:12mm!important;border-color:transparent!important;background:transparent!important}
body.mode-point .word-boxes .word-input{font-size:7mm!important;line-height:12mm!important;letter-spacing:0!important;text-align:center;padding:0!important;width:100%!important}
body.mode-point .point-cue{position:absolute;left:0;top:0;width:110mm;height:12mm;display:flex;align-items:center;justify-content:center;font-size:4.2mm;font-weight:700;color:#5d6b7c;line-height:1.3;pointer-events:none;transform:rotate(180deg)}
body.mode-point .row-tools{top:1mm;left:6mm;right:6mm}
body.mode-point .row-counter{display:none}
@media screen{body.mode-point .word-boxes:not(:focus-within) .word-input{color:transparent!important;-webkit-text-fill-color:transparent!important}body.mode-point .word-boxes:focus-within~.point-cue,body.mode-point .word-boxes:focus-within .point-cue{visibility:hidden}}
/* ゆびさし：入力しているあいだは、打った文字を見せる（ふだんの紙面では文字を画像で描くので、入力欄の文字は消している） */
@media screen{body.mode-point .word-boxes:focus-within .word-input{color:#243246!important;-webkit-text-fill-color:#243246!important}}
/* 折り線と、折って使うことのお知らせ */
body.mode-point .tracing-sheet::after{content:"";position:absolute;left:0;right:0;top:148.5mm;border-top:0.35mm dashed #c3cbd4;pointer-events:none}
body.mode-point .tracing-sheet::before{content:"情報をしぼるため、この線で おって つかってください";position:absolute;left:calc(50% - 62mm);width:124mm;top:calc(148.5mm - 2mm);text-align:center;font-size:2.8mm;line-height:4mm;color:#b7c0ca;background:#fff;letter-spacing:.06em;pointer-events:none;z-index:1}
.point-choices{display:grid;width:100%;height:100%;gap:8mm;align-items:center;justify-items:center}
.point-choices[data-count="2"]{grid-template-columns:1fr 1fr}
.point-choices[data-count="4"]{grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;gap:5mm 14mm}
.point-card{display:flex;align-items:center;justify-content:center;width:100%;height:100%;max-width:100%;max-height:100%;aspect-ratio:1;box-sizing:border-box;border:0}
.point-choices[data-count="2"] .point-card{width:86mm;height:86mm}
.point-choices[data-count="4"] .point-card{width:52mm;height:52mm}
.point-choices[data-count="1"] .point-card{width:104mm;height:104mm}
.point-card img{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain}
/* カタカナは、ことばと絵のプリントの段階には入れないのでボタンを出さない（URLの characterType=katakana では今までどおり使える）2026-10-15 */
[data-character]{display:none!important}
.stage-all{display:flex;align-items:center;gap:6px;margin-top:8px;font-size:13px;color:#5f6b78}
.stage-all[hidden]{display:none}
.stage-scale span.lower{top:15px}
.stage-scale span.lower2{top:30px}
.stage-scale span{font-size:11.5px}

/* ゆびさし：いっしょに出す絵の設定 */
.point-options{margin-top:14px;padding-top:12px;border-top:1px solid #e3e8ee}
.point-options[hidden]{display:none}
.point-options-head{margin:0 0 6px;font-size:13px;font-weight:700;color:#51667e}
.point-choices[hidden],.point-cue[hidden]{display:none!important}
/* ゆびさし・いう：1枚の量は選ばない（紙を折って1題ずつ使うため） */
body.mode-point #amount-label,body.mode-point .amount-buttons{display:none!important}
/* いう（2026-10-15）：A4よこを4つに折ってA6で使う。A6に1題。支援者のことばは各面の上のはしに反対向き */
body.mode-point.point-name .writing-rows{display:grid!important;grid-template-columns:148.5mm 148.5mm;grid-template-rows:105mm 105mm;height:210mm;position:relative}
body.mode-point.point-name .tracing-sheet .writing-row{height:105mm!important;width:148.5mm}
body.mode-point.point-name .picture-slot>.point-choices{left:10mm;right:10mm;top:16mm;height:84mm}
body.mode-point.point-name .point-choices[data-count="1"] .point-card{width:84mm;height:84mm}
body.mode-point.point-name .word-area{top:3mm;width:100mm!important;margin-left:-50mm;height:11mm}
body.mode-point.point-name .word-boxes{width:100mm!important;height:11mm!important}
body.mode-point.point-name .point-cue{width:100mm;height:11mm}
body.mode-point.point-name .tracing-sheet::after{top:105mm}
body.mode-point.point-name .writing-rows::after{content:"";position:absolute;top:0;bottom:0;left:148.5mm;border-left:0.35mm dashed #c3cbd4;pointer-events:none}
body.mode-point.point-name .tracing-sheet::before{content:"情報をしぼるため、点線で 4つに おって つかってください";left:calc(25% - 58mm);width:116mm;top:calc(105mm - 2mm)}
/* ゆびさし：いっしょに出す絵はアイコンで。説明はホバー（タップ）で出す */
.point-buttons{margin-bottom:8px}
.point-buttons button{position:relative}
.point-buttons small{white-space:normal;line-height:1.3}
.point-buttons button::after{content:attr(data-tip);position:absolute;left:50%;bottom:calc(100% + 8px);width:190px;transform:translateX(-50%);padding:8px 10px;border-radius:8px;background:#243246;color:#fff;font-size:12px;font-weight:400;line-height:1.6;text-align:left;white-space:normal;opacity:0;pointer-events:none;transition:opacity .15s;z-index:20}
.point-buttons button:hover::after,.point-buttons button:focus-visible::after{opacity:1}
.point-buttons button:first-child::after{left:0;transform:none}.point-buttons button:last-child::after{left:auto;right:0;transform:none}
.point-hover-note{margin:2px 0 0;font-size:12px;color:#6b7785}
/* プリントの上のガイド（画面だけ） */
.point-badge{position:absolute;top:0;left:50%;transform:translateX(-50%);padding:0.6mm 2.4mm;border-radius:99px;background:#E8833A;color:#fff;font-size:3.4mm;font-weight:700;line-height:1.4;white-space:nowrap;opacity:0;transition:opacity .15s;pointer-events:none}
.point-badge.is-answer{background:#2f8a57}
.point-card{position:relative}
.point-guide{position:absolute;left:50%;bottom:-6mm;transform:translateX(-50%);width:150mm;max-width:100%;padding:2.4mm 3.6mm;border-radius:2.4mm;background:rgba(36,50,70,.94);color:#fff;font-size:3.6mm;line-height:1.6;opacity:0;transition:opacity .15s;pointer-events:none;z-index:5}
.point-guide p{margin:0}
@media (hover:hover) and (pointer:fine){.point-choices:hover .point-badge,.point-choices:hover .point-guide{opacity:1}}
@media (hover:none),(pointer:coarse){.point-choices:active .point-badge,.point-choices:active .point-guide,.point-choices.show-guide .point-badge,.point-choices.show-guide .point-guide{opacity:1}}
@media print{.point-badge,.point-guide,.point-hover-note{display:none!important}}


/* Short sentences: five questions, shared action canvases at identical scale. */
.mode-sentence .sentence-hide,.mode-sentence #input-position-help,.mode-sentence #input-message,.mode-sentence #matching-help,.mode-sentence .format-note,.mode-sentence .maker-mode-buttons,.mode-sentence #amount-label,.mode-sentence #mode-label{display:none!important}
.mode-sentence .sheet-wrap[hidden]{display:none!important}
#sentence-answer-option[hidden]{display:none!important}
.sentence-wrap{margin-bottom:24px}
.sentence-sheet{font-family:"BIZ UDGothic",sans-serif;box-sizing:border-box;padding:10mm 14mm;width:210mm;height:297mm}
.sentence-heading{height:20mm;box-sizing:border-box;font-family:"BIZ UDGothic",sans-serif}
.sentence-heading h2{font-family:inherit;font-size:18pt;line-height:1.4;margin:0 0 2mm;font-weight:700}
.sentence-heading p{font-size:11pt;line-height:1.4;margin:0}
.sentence-question{height:50mm;box-sizing:border-box;break-inside:avoid}
.sentence-line{display:flex;align-items:center;gap:3mm;height:9mm;font-family:"BIZ UDGothic",sans-serif;font-size:16pt;font-weight:400;white-space:pre;line-height:1.2}
.sentence-number{font-size:11pt}
.sentence-word-image{height:7mm;width:auto;max-width:165mm;object-fit:contain;vertical-align:middle}
.sentence-choices{display:flex;justify-content:space-evenly;align-items:center;height:40mm}
.sentence-choice{position:relative;box-sizing:border-box;flex:0 0 40mm;width:40mm;height:40mm;border:0.25mm solid #ddd;border-radius:2mm}
.sentence-choice img{display:block;position:absolute;inset:0;margin:auto;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain}
.sentence-correct::after{content:"";position:absolute;inset:0;border:0.8mm solid #333;border-radius:50%;pointer-events:none}
@media print{
  #sentence-pages{margin:0;padding:0}
  .sentence-wrap{break-after:page;page-break-after:always}
  .sentence-wrap:last-child{break-after:auto;page-break-after:auto}
  .mode-sentence .pair-header,.mode-sentence .pair-footer{display:none!important}
}
/* ことばのきろく（ゆびさし・いう。子どもを選んでいるときだけ。印刷しない） */
.wp-words{max-width:210mm;margin:10px auto 26px;padding:10px 14px;background:#fff;border:1px solid #dbe2ed;border-radius:12px}
.wp-words-title{margin:0 0 6px;font-size:12.5px;color:#617187}
.wp-word{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px;padding:6px 0;border-top:1px solid #eef1f5}
.wp-word:first-of-type{border-top:0}
.wp-word-name{min-width:6em;font-weight:700}
.wp-word button{min-height:34px;padding:0 12px;border:1px solid #cfd8e2;border-radius:999px;background:#fff;font:inherit;font-size:13px;cursor:pointer}
.wp-word button[aria-pressed="true"]{color:#fff;border-color:transparent;font-weight:700}
.wp-word .wp-word-done[aria-pressed="true"]{background:#2E9D5B}
.wp-word .wp-word-support[aria-pressed="true"]{background:#C98A1B}
.wp-word .wp-word-notyet[aria-pressed="true"]{background:#8A8478}
@media print{.wp-words{display:none!important}}

/* ことばが空のとき：まず絵からえらぶ（2026-10-15） */
.empty-start{display:flex;flex-direction:column;align-items:center;gap:8px;margin:0 auto 18px;padding:22px 16px;max-width:210mm;border:2px dashed #b9d8c4;border-radius:16px;background:#F3FAF5;text-align:center}
.empty-start[hidden]{display:none}
.empty-start-button{display:inline-flex;align-items:center;gap:10px;min-height:56px;padding:0 30px;border-radius:999px;background:#2E9D5B;color:#fff!important;font-size:19px;font-weight:700;text-decoration:none;box-shadow:0 3px 8px rgba(46,157,91,.25)}
.empty-start-button:hover{background:#237846}
.empty-start-icon{font-size:22px}
.empty-start p{margin:0;font-size:13px;color:#617187}
@media print{.empty-start{display:none!important}}

/* 紙からサイトにたどり着けるように、名前の横にURL（2026-10-15）。名前より少し小さく、同じうすい灰色 */
.worksheet-footer .footer-url{margin-left:.3em;font-family:"Zen Kaku Gothic New",system-ui,sans-serif;font-size:7pt;letter-spacing:.03em}
/* 使い方の見本を途中で止めたときは、動きをつけずに消す（2026-10-15 ちかちか対策） */
.demo-reset .tracing-sheet,.demo-reset .tracing-sheet *{transition:none!important;animation:none!important}
/* 何も入っていないとき：年齢のめやすに合う絵を おまかせで ならべる（2026-10-15） */
.empty-start-random{display:flex;flex-direction:column;align-items:center;gap:10px;width:100%;max-width:360px;margin-top:6px;padding-top:14px;border-top:1px solid #cfe5d7}
.empty-start-age{width:100%}
.empty-start-random-button{display:inline-flex;align-items:center;gap:8px;min-height:48px;padding:0 24px;border:2px solid #2E9D5B;border-radius:999px;background:#fff;color:#1F6E40;font-size:16px;font-weight:700;cursor:pointer}
.empty-start-random-button:hover{background:#E8F5EC}

/* べつのメーカーでつくる段（なかま）を選んでいるときは、プリントを薄く見せる */
body.stage-external .sheet-wrap{opacity:.35;pointer-events:none}
/* 2026-10-15 まだ絵のないところは、画面だけ点線＋「ことばを入れると、絵が出ます」（印刷には出さない）。並べ替えられないときは「画像を並べ替える」を出さない。段のまとまりが少ないときは横一列 */
.picture-area[data-state=empty]{border:1.5px dashed #b4c0cc;border-radius:8px}
.picture-area[data-state=empty] .picture-message{font-size:11px;color:#7d8b9a;padding:0 6px;white-space:pre-line}
@media print{.picture-area[data-state=empty]{border:0!important}.picture-area[data-state=empty] .picture-message{display:none!important}}
#shuffle-pictures:disabled{display:none}
.stage-scale.one-row{height:22px}
/* 2026-10-15 入力の場所をわかりやすく（画面だけ）：空の行は色と「ここに ことばを入力」。絵のある行は右上に小さな×で消せる */
@media screen{
  body.mode-read .writing-row.is-empty .word-boxes,body.mode-oto .writing-row.is-empty .word-boxes,body.mode-point .writing-row.is-empty .word-boxes{background:#FFF7DD!important;border:1.5px dashed #E2B54F!important;border-radius:6px}
  body:not(.mode-read):not(.mode-oto):not(.mode-point) .writing-row.is-empty .word-boxes{background:#FFFBEC}
}
.row-clear{position:absolute;top:-2.5mm;right:-2.5mm;z-index:3;width:24px;height:24px;padding:0;border:1px solid #c9d1da;border-radius:50%;background:#fff;color:#6a7889;font:700 15px/22px "BIZ UDPGothic",sans-serif;text-align:center;cursor:pointer;box-shadow:0 1px 3px rgba(0,0,0,.12)}
.row-clear:hover{background:#fdecec;border-color:#e3a4a4;color:#b8423f}
.writing-row.is-empty .row-clear{display:none}
@media screen{.writing-row.is-empty .word-boxes::after{content:"ここに\Aことばを入力";white-space:pre;position:absolute;inset:0;display:flex;align-items:center;justify-content:center;text-align:center;font:600 12px/1.5 "BIZ UDPGothic",sans-serif;color:#a07a22;pointer-events:none;z-index:2}
  .writing-row.is-empty .word-boxes:focus-within::after{content:none}}
body.mode-point .row-clear{top:3mm;right:3mm}
@media print{.row-clear{display:none!important}.word-boxes::after{content:none!important}}

/* ききて（2026-10-22）：ひだりききは、絵を右に（書いている手で絵がかくれないように）。線むすびは もとから絵が右なので そのまま */
body.hand-left:not(.mode-point):not(.mode-sentence) .tracing-sheet:not(.matching) .writing-row{direction:rtl}
body.hand-left:not(.mode-point):not(.mode-sentence) .tracing-sheet:not(.matching) .writing-row>*{direction:ltr}
/* たて書き（2026-10-22）：1つの ことばが1列。列は右から左へ。絵が上、ことばが下 */
body.dir-tate .tracing-sheet .writing-rows{flex-direction:row-reverse;justify-content:center;align-items:flex-start;gap:3mm}
body.dir-tate .tracing-sheet .writing-row{display:flex!important;flex-direction:column;align-items:center;justify-content:flex-start;gap:5mm;height:auto!important;width:34mm;direction:ltr}
body.dir-tate .tracing-sheet .writing-row .picture-slot{order:-1;width:32mm;height:32mm;flex:none}
body.dir-tate .tracing-sheet .writing-row .picture-area{width:32mm;height:32mm}
body.dir-tate .tracing-sheet.less-sheet .writing-row{width:48mm}
body.dir-tate .tracing-sheet.less-sheet .writing-row .picture-slot,body.dir-tate .tracing-sheet.less-sheet .writing-row .picture-area{width:44mm;height:44mm}
body.dir-tate .tracing-sheet .word-area{width:calc(var(--cell) + 2px)}
body.dir-tate .tracing-sheet .word-boxes{width:var(--cell);height:calc(var(--cell) * var(--cells))}
body.dir-tate .tracing-sheet .cell-grid{grid-template-columns:1fr;grid-template-rows:repeat(var(--cells),1fr)}
body.dir-tate .tracing-sheet .writing-cell{border-right:0;border-bottom:1px solid #aab4bc}
body.dir-tate .tracing-sheet .writing-cell:last-child{border-bottom:0}
body.dir-tate .tracing-sheet .word-input{width:100%;height:100%;padding:0}
.dir-buttons button:disabled{opacity:.4;cursor:default}
/* スマホ（2026-10-22。docs/phone-plan.md）：見本を最初の画面に入れるため、メーカーの説明文は出さない */
@media(max-width:700px){.app-heading p{display:none}.app-heading{margin-bottom:10px}}
/* 文字画像のはばは字の数ぶん（2026-10-22） */
.word-image,.word-image img{width:calc(var(--cell) * var(--image-cols,var(--columns,1)))}

/* じぶんの画像（ドラッグ＆ドロップ。2026-11-05）*/
.picture-area.photo-drop-on{outline:1.2mm dashed #6e96eb;outline-offset:.6mm;background:#edf3ff;border-radius:8px}
.row-photo-reset{display:none;position:absolute;top:-2.5mm;right:calc(-2.5mm + 28px);z-index:3;width:24px;height:24px;padding:0;border:1px solid #c9d1da;border-radius:50%;background:#fff;color:#6a7889;font:700 14px/22px "BIZ UDPGothic",sans-serif;text-align:center;cursor:pointer;box-shadow:0 1px 3px rgba(0,0,0,.12)}
.writing-row.has-photo .row-photo-reset{display:block}
.row-photo-reset:hover{background:#eef4ff;border-color:#9fb6e3}
@media print{.row-photo-reset{display:none!important}.picture-area.photo-drop-on{outline:0;background:none}}

/* おとのかず「まるを おおきく」：〇をマスいっぱいにして、中に文字を書きこめるように（2026-11-06 運営者） */
body.mode-oto.oto-big .writing-cell::after{inset:4%}
body.mode-oto.oto-big .writing-cell.oto-small::after{inset:22%}
body.mode-oto.oto-big:not(.dir-tate) .writing-cell.oto-small::after{inset:auto;left:calc(var(--cell) * -.04);bottom:4%;width:calc(var(--cell) * .55);height:calc(var(--cell) * .55)}
