/* 創心館ドリル
   画面：藍（あい）を基調に、国語＝朱、算数＝若竹。プリントは白地・黒インクで印刷向け。 */
:root {
  --ai: #1d3557;        /* 藍：ブランド */
  --ai-soft: #e7edf5;
  --shu: #c8453a;       /* 朱：国語 */
  --shu-soft: #fbeceb;
  --take: #2a7f6f;      /* 若竹：算数 */
  --take-soft: #e6f3f0;
  --desk: #eef1f5;      /* 画面の机の色 */
  --ink: #1b1f24;
  --mute: #5d6878;
  --rule: #c9d1dc;
  --trace: #c3c9d1;     /* なぞり字 */
  --ansc: #e0245e;      /* こたえの赤 */
  --kfont: "UD デジタル 教科書体 N-R", "UD Digi Kyokasho N-R", "UD デジタル 教科書体 NK-R", "Klee One", "Yu Mincho", serif;
  --ui: "Zen Maru Gothic", "BIZ UDPGothic", "Yu Gothic UI", "Meiryo", sans-serif;
  --mono: "BIZ UDGothic", "BIZ UDゴシック", "MS Gothic", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--desk); color: var(--ink); font-family: var(--ui); font-size: 15px; line-height: 1.6; }
a { color: inherit; }
button, select { font: inherit; }
.mark { display: inline-grid; place-items: center; width: 2.2em; height: 2.2em; background: var(--ai); color: #fff; font-family: var(--kfont); font-weight: 700; border-radius: 4px; box-shadow: inset 0 0 0 2px var(--ai), inset 0 0 0 3px #fff; }

/* ---------- 網羅表 ---------- */
.top { background: var(--ai); color: #fff; padding-block: 28px 22px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.top-in { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: auto 1fr auto; gap: 28px; align-items: center; }
.brand { display: flex; gap: 12px; align-items: center; }
.brand .mark { width: 54px; height: 54px; font-size: 30px; background: #fff; color: var(--ai); box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 5px var(--ai); }
.brand b { display: block; font-size: 22px; letter-spacing: .08em; }
.brand small { opacity: .8; }
.top-txt h1 { margin: 0; font-size: 28px; letter-spacing: .2em; text-wrap: balance; }
.top-txt p { margin: 4px 0 0; opacity: .88; max-width: 62ch; font-size: 14px; }
.stats { display: flex; gap: 18px; align-items: center; }
.stats div { text-align: center; }
.stats b { display: block; font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; }
.stats span { font-size: 12px; opacity: .8; letter-spacing: .1em; }
.btn { background: var(--shu); color: #fff; border: 0; border-radius: 6px; padding: 8px 16px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.08); }
.btn:focus-visible, .seg button:focus-visible, a:focus-visible, select:focus-visible { outline: 3px solid #f4b942; outline-offset: 2px; }
.btn.ghost { background: transparent; color: var(--ai); box-shadow: inset 0 0 0 1.5px var(--ai); }
.snav { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--rule); display: flex; gap: 4px; overflow-x: auto; padding-block: 6px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); justify-content: center; }
.snav a { text-decoration: none; padding: 4px 14px; border-radius: 999px; display: flex; gap: 6px; align-items: baseline; white-space: nowrap; }
.snav a:hover { background: var(--ai-soft); }
.snav small { color: var(--mute); font-size: 11px; }
.cov-main { max-width: 1180px; margin: 0 auto; padding-block: 8px 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.stage { scroll-margin-top: 56px; margin-top: 26px; }
.stage h2 { font-size: 22px; margin: 0 0 10px; padding-left: 12px; border-left: 6px solid var(--ai); display: flex; gap: 12px; align-items: baseline; }
.stage h2 small { font-size: 14px; color: var(--mute); font-weight: 400; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.col { background: #fff; border-radius: 8px; overflow: hidden; border: 1px solid var(--rule); min-width: 0; }
.col h3 { margin: 0; padding: 8px 14px; font-size: 16px; color: #fff; display: flex; justify-content: space-between; align-items: baseline; letter-spacing: .1em; }
.col h3 span { font-size: 12px; font-weight: 400; letter-spacing: 0; opacity: .9; }
.col.sj-kokugo h3 { background: var(--shu); }
.col.sj-sansu h3 { background: var(--take); }
.cov { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.cov th { text-align: left; font-size: 11px; color: var(--mute); font-weight: 400; padding: 4px 12px; border-bottom: 1px solid var(--rule); letter-spacing: .1em; }
.cov td { padding: 8px 12px; border-bottom: 1px solid #edf0f4; vertical-align: top; }
.cov tr:last-child td { border-bottom: 0; }
.cov .n, .cov .age { text-align: center; white-space: nowrap; width: 3.8em; font-variant-numeric: tabular-nums; }
.cov td.n { font-weight: 700; color: var(--ai); }
.cov td.age { font-size: 12px; color: var(--mute); }
.u-t { font-weight: 700; text-decoration: none; font-size: 15px; }
.u-t:hover { text-decoration: underline; }
.sj-kokugo .u-t { color: #9b2f25; }
.sj-sansu .u-t { color: #1d5f53; }
.u-d { color: var(--mute); font-size: 12px; }
.u-s { display: flex; flex-wrap: wrap; gap: 3px 4px; margin-top: 4px; }
.u-s a { font-size: 11px; text-decoration: none; padding: 1px 7px 1px 2px; border-radius: 999px; background: #f3f5f8; color: #3a4553; display: inline-flex; align-items: center; gap: 4px; max-width: 100%; }
.u-s a:hover { background: var(--ai-soft); }
.u-s i { font-style: normal; display: inline-grid; place-items: center; min-width: 16px; height: 16px; border-radius: 50%; background: #fff; font-size: 10px; font-weight: 700; color: var(--ai); }
.cov-foot { text-align: center; color: var(--mute); font-size: 12px; padding: 0 16px 30px; }

/* ---------- プリント表示バー ---------- */
.bar { position: sticky; top: 0; z-index: 5; background: #fff; border-bottom: 1px solid var(--rule); padding-block: 8px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.bar-in { max-width: 1180px; margin: 0 auto; display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.back { text-decoration: none; color: var(--ai); font-weight: 700; }
.bar-t { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; margin-right: auto; }
.bar-t small { color: var(--mute); font-size: 11px; }
.fld { font-size: 12px; color: var(--mute); display: flex; gap: 6px; align-items: center; }
.fld select { max-width: 15em; padding: 4px; border: 1px solid var(--rule); border-radius: 5px; color: var(--ink); }
.seg { display: inline-flex; border: 1.5px solid var(--ai); border-radius: 6px; overflow: hidden; }
.seg button { border: 0; background: #fff; color: var(--ai); padding: 6px 10px; cursor: pointer; font-size: 13px; }
.seg button + button { border-left: 1px solid var(--ai); }
.seg button.on { background: var(--ai); color: #fff; }
.setno { font-size: 12px; color: var(--mute); }
.link { background: none; border: 0; color: var(--ai); text-decoration: underline; cursor: pointer; font-size: 12px; padding: 0; }
.sheets { padding: 24px 16px 60px; display: flex; flex-direction: column; align-items: center; gap: 24px; overflow-x: auto; }

/* ---------- プリント（A4） ---------- */
.sheet { width: 210mm; height: 297mm; flex: none; background: #fff; padding: 9mm 13mm 7mm; display: flex; flex-direction: column; box-shadow: 0 2px 10px rgba(29, 53, 87, .14); overflow: hidden; color: #111; font-family: var(--kfont); }
.sh-top { display: flex; justify-content: space-between; align-items: center; font-family: var(--ui); border-bottom: .5mm solid var(--ai); padding-bottom: 1.5mm; }
.sh-brand { display: flex; align-items: center; gap: 2mm; font-size: 3.4mm; }
.sh-brand .mark { width: 6.5mm; height: 6.5mm; font-size: 4mm; border-radius: 1mm; }
.sh-brand b { color: var(--ai); letter-spacing: .1em; }
.sh-cat { margin-left: 2mm; padding: .3mm 2.5mm; border-radius: 3mm; color: #fff; font-size: 3mm; }
.sj-kokugo .sh-cat { background: var(--shu); }
.sj-sansu .sh-cat { background: var(--take); }
.sh-no { font-size: 3.4mm; color: var(--mute); display: flex; align-items: center; gap: 2mm; }
.sh-no b { font-size: 5.5mm; color: var(--ai); }
.stamp { color: var(--ansc); border: .5mm solid var(--ansc); border-radius: 1mm; padding: 0 2mm; font-weight: 700; letter-spacing: .2em; font-size: 3.6mm; }
.sh-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 5mm; padding: 2.5mm 0 2mm; }
.sh-ttl { min-width: 0; }
.sh-ttl h1 { margin: 0; font-size: var(--tfs, 7mm); white-space: nowrap; line-height: 1.2; letter-spacing: .04em; }
.sh-ttl p { margin: .6mm 0 0; font-size: 3.8mm; color: #444; }
.sh-f { display: flex; gap: 2.5mm; align-items: flex-end; font-size: 3.4mm; flex: none; font-family: var(--ui); }
.sh-f > div { border: .3mm solid #555; border-radius: 1.2mm; height: 11mm; display: flex; align-items: flex-end; padding: 0 2mm 1mm; gap: 1mm; }
.f-date i { display: inline-block; width: 7mm; }
.f-name { width: 46mm; align-items: flex-start !important; padding-top: .6mm !important; }
.f-name span { font-size: 2.8mm; color: #555; }
.f-score { width: 22mm; justify-content: flex-end; }
.f-score i { flex: 1; }
.hanamaru { position: absolute; }
.sh-lead { margin: 0 0 2.5mm; font-size: 4.3mm; padding: 1.4mm 3mm; border-radius: 1.2mm; background: #f4f6f9; border-left: 1.2mm solid var(--ai); }
.sj-kokugo .sh-lead { border-left-color: var(--shu); }
.sj-sansu .sh-lead { border-left-color: var(--take); }
.sh-body { flex: 1; min-height: 0; overflow: hidden; font-size: 5.2mm; }
.sh-foot { display: flex; justify-content: space-between; font-family: var(--ui); font-size: 2.6mm; color: #8a93a0; border-top: .2mm solid var(--rule); padding-top: 1mm; }
.err { color: var(--ansc); }

/* こたえ */
.ans { visibility: hidden; color: var(--ansc); }
.sa .ans { visibility: visible; }
.ring { position: absolute; inset: -1.6mm; border: .6mm solid var(--ansc); border-radius: 50%; pointer-events: none; }

/* 問題グリッド */
.pg { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--c), minmax(0, 1fr)); column-gap: 6mm; counter-reset: q; }
.pg.c1 { --c: 1; } .pg.c2 { --c: 2; } .pg.c3 { --c: 3; } .pg.c4 { --c: 4; } .pg.c5 { --c: 5; }
.pg > li { counter-increment: q; min-height: var(--rh, 18mm); display: flex; align-items: center; gap: 2mm; font-size: var(--fs, 5.2mm); border-bottom: .2mm dotted var(--rule); min-width: 0; }
.pg > li::before { content: "(" counter(q) ")"; font-size: .62em; color: #667; min-width: 7mm; flex: none; font-family: var(--ui); }
.pg.big > li { font-size: 6mm; }
.pg.hsg > li, .pg.ldg > li, .pg.figs > li { align-items: flex-start; padding-top: 2mm; border-bottom: 0; }
.pg.figs > li { border: .2mm dotted var(--rule); border-width: 0 0 .2mm; }
.pg.js > li { font-size: 5.6mm; }
.eq { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 1.5mm; white-space: nowrap; }
.n { font-weight: 400; font-size: 1.15em; }
.bx { display: inline-flex; align-items: center; justify-content: center; min-width: 12mm; height: 10mm; padding: 0 1.5mm; border: .35mm solid #333; border-radius: 1mm; vertical-align: middle; background: #fff; }
.bx.lg { min-width: 16mm; height: 14mm; font-size: 1.3em; }
.bx.sm { min-width: 8mm; height: 8mm; font-size: .85em; }
.bx.w { min-width: 40mm; }
.bx.ww { min-width: 80mm; }
.bx.fr2 { min-width: 14mm; height: 16mm; }
.ul { display: inline-flex; align-items: flex-end; justify-content: center; min-width: 20mm; height: 9mm; border-bottom: .35mm solid #333; padding: 0 1mm; }
.w12 { min-width: 12mm; } .w20 { min-width: 20mm; } .w30 { min-width: 30mm; } .w40 { min-width: 40mm; } .w50 { min-width: 50mm; } .w60 { min-width: 60mm; }
.sec { margin-bottom: 2mm; }
.sec-t { margin: 1mm 0 1.5mm; font-size: 4.4mm; font-weight: 700; padding: .5mm 0 .5mm 2.5mm; border-left: 1mm solid #333; }
.sec-t:empty { display: none; }
.center { display: flex; justify-content: center; }
.note { font-size: 4.2mm; margin: 2mm 0 0; }
.seq { display: inline-flex; align-items: center; gap: 1.5mm; }
.seq i { font-style: normal; color: #889; font-size: .8em; }
.sq { display: inline-flex; min-width: 12mm; justify-content: center; }
.pair { display: inline-flex; gap: 7mm; font-size: 6mm; }
.opt { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 10mm; padding: 0 1.5mm; }
.opt.word { padding: 0 2.5mm; }
.opt.sm { min-width: 7mm; padding: 0 .5mm; }

/* 分数 */
.fr { display: inline-flex; align-items: center; gap: .8mm; vertical-align: middle; }
.fw { font-size: 1.1em; }
.fnd { display: inline-flex; flex-direction: column; align-items: center; font-size: .82em; line-height: 1.05; }
.fnd span:first-child { border-bottom: .3mm solid currentColor; padding: 0 1mm .3mm; }
.fnd span:last-child { padding-top: .3mm; }
.fbq { display: inline-flex; align-items: center; gap: 6mm; }

/* マス（なぞり・書き） */
.ms { width: var(--ms, 18mm); height: var(--ms, 18mm); flex: none; position: relative; display: inline-flex; align-items: center; justify-content: center; border: .3mm solid #444; font-family: var(--kfont); font-size: calc(var(--ms, 18mm) * .76); line-height: 1; background: #fff; vertical-align: middle; }
.ms::before, .ms::after { content: ""; position: absolute; pointer-events: none; }
.ms::before { left: 50%; top: 0; bottom: 0; border-left: .2mm dashed #b8c0cb; }
.ms::after { top: 50%; left: 0; right: 0; border-top: .2mm dashed #b8c0cb; }
.ms i { font-style: normal; position: relative; z-index: 1; }
.ms.t i { color: var(--trace); }
.ms.none { border-color: transparent; background: transparent; }
.ms.none::before, .ms.none::after { display: none; }
.ms.w2 { width: calc(var(--ms, 18mm) * 1.5); }
.ms.w2::before { display: none; }
.ms + .ms { margin-left: -.3mm; }
.tr { display: flex; flex-direction: column; gap: 3mm; }
.tr-row { display: flex; align-items: center; }
.tr-hint { width: 28mm; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .5mm; padding-right: 2mm; font-family: var(--ui); }
.hint-e { font-size: 9mm; line-height: 1; }
.hint-w { font-size: 3.4mm; color: #444; font-family: var(--kfont); }
.hint-w.big { font-size: 6mm; color: #333; }
.dots { color: var(--take); font-size: 3.4mm; letter-spacing: .3mm; text-align: center; line-height: 1.3; max-width: 24mm; word-break: break-all; }
.gojuon { display: flex; justify-content: center; --ms: 15.5mm; margin-top: 2mm; }
.gj-col { display: flex; flex-direction: column; }
.gj-col .ms + .ms { margin-left: 0; margin-top: -.3mm; }
.gj-col + .gj-col { margin-left: -.3mm; }
.pw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm 6mm; margin-top: 2mm; }
.pw-grid.one { grid-template-columns: 1fr; gap: 3mm; }
.pw-grid.one .pw { min-height: 24mm; }
.pw-grid.one .pw-e { font-size: 12mm; }
.pw { display: flex; align-items: center; gap: 2mm; min-height: 44mm; }
.pw-e { font-size: 15mm; line-height: 1; width: 20mm; text-align: center; font-family: var(--ui); }
.pw-b { display: inline-flex; }

/* 絵・かず */
.eg { display: inline-grid; grid-template-columns: repeat(var(--ec), var(--es)); font-size: calc(var(--es) * .8); line-height: 1.18; font-family: var(--ui); justify-items: center; }
.eg .x { position: relative; opacity: .5; }
.eg .x::after { content: "×"; position: absolute; inset: 0; color: #c8453a; font-size: 1.25em; display: flex; align-items: center; justify-content: center; font-weight: 700; opacity: 1; }
.cnt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5mm; }
.cnt { border: .3mm solid var(--rule); border-radius: 2mm; display: flex; align-items: center; justify-content: space-between; padding: 3mm 4mm; min-height: 66mm; gap: 3mm; }
.cnt-f { flex: 1; display: flex; justify-content: center; }
.cmp-list { display: flex; flex-direction: column; gap: 5mm; }
.cmp { display: flex; align-items: center; justify-content: center; gap: 6mm; }
.cmp-b { position: relative; border: .3mm solid var(--rule); border-radius: 2mm; width: 66mm; min-height: 36mm; display: flex; align-items: center; justify-content: center; }
.cmp-b .ring { border-radius: 4mm; inset: -1.5mm; }
.cmp-vs { font-size: 5mm; color: #556; }
.eq-list { display: flex; flex-direction: column; }
.eq-e { display: flex; align-items: center; gap: 3mm; min-height: 36mm; border-bottom: .2mm dotted var(--rule); }
.eq-e b { font-size: 7mm; font-weight: 400; }
.eq-g { border: .3mm solid var(--rule); border-radius: 2mm; padding: 2mm; min-width: 50mm; min-height: 27mm; display: flex; align-items: center; justify-content: center; }
.eq-g.wide { min-width: 70mm; }
.eq-s { font-size: 3.6mm; color: #667; margin-left: 2mm; }
.eq-t { font-size: 6mm; margin-left: 4mm; }
.frame { border: .3mm solid var(--rule); border-radius: 2mm; }
.kq-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4mm 10mm; margin: 6mm auto 0; max-width: 160mm; }
.kq { display: flex; align-items: center; gap: 3mm; font-size: 5.5mm; }
.clk-grid { display: grid; gap: 4mm 6mm; }
.clk-grid.c2 { grid-template-columns: 1fr 1fr; }
.clk-grid.c4 { grid-template-columns: repeat(4, 1fr); row-gap: 14mm; margin-top: 6mm; }
.clk-i { display: flex; flex-direction: column; align-items: center; gap: 2mm; }
.clk-a { display: flex; align-items: center; gap: 1.5mm; font-size: 5mm; white-space: nowrap; }
.clk-grid.c4 .clk-a .bx { min-width: 10mm; height: 9mm; }
.pat-list { display: flex; flex-direction: column; gap: 3mm; }
.pat { border-bottom: .2mm dotted var(--rule); padding-bottom: 2.5mm; }
.pat-seq { display: flex; gap: 1.2mm; font-size: 10mm; line-height: 1.2; font-family: var(--ui); }
.pat-q { display: inline-grid; place-items: center; width: 12mm; height: 12mm; border: .4mm dashed #555; border-radius: 2mm; font-size: 7mm; color: #555; }
.pat-ch { display: flex; gap: 8mm; justify-content: flex-end; font-size: 8mm; font-family: var(--ui); }

/* 筆算 */
.hs { border-collapse: collapse; font-family: var(--kfont); font-size: 6.4mm; }
.hs td { width: 7.6mm; height: 9mm; text-align: center; padding: 0; vertical-align: middle; }
.hs tr.u td { border-bottom: .45mm solid #222; }
.hs .op { font-weight: 400; font-size: .9em; }
.ld { display: inline-grid; grid-template-columns: auto auto; font-family: var(--mono); font-size: 6.2mm; letter-spacing: 1.4mm; line-height: 1; margin-left: 4mm; }
.ld-q { grid-column: 2; text-align: right; padding: 0 1.2mm 1.5mm 0; min-height: 7mm; }
.ld-dv { grid-column: 1; grid-row: 2; padding: 1.5mm 1.5mm 0 0; }
.ld-dd { grid-column: 2; grid-row: 2; border-top: .45mm solid #222; border-left: .45mm solid #222; border-top-left-radius: 2.5mm 6mm; padding: 1.5mm 1.2mm 0 2.5mm; }
.ld-r { font-size: 4mm; margin: 22mm 0 0 4mm; display: flex; align-items: center; gap: 2mm; position: absolute; }
.pg.ldg > li { position: relative; }
.pg.ldg .ld-r { bottom: 3mm; left: 6mm; margin: 0; }

/* 文章題・図 */
.wp { width: 100%; }
.wp p { margin: 0 0 2mm; line-height: 1.6; font-size: 5mm; }
.wp-a { display: flex; align-items: flex-end; gap: 2.5mm; font-size: 4.6mm; }
.figq { display: flex; flex-direction: column; align-items: center; gap: 2mm; width: 100%; font-size: 4.6mm; }
.figq > div { display: flex; align-items: center; gap: 1.5mm; }
.fig text { font-family: Arial, sans-serif; fill: #1b1f24; }
.tbl { border-collapse: collapse; font-size: 4.8mm; }
.tbl th, .tbl td { border: .3mm solid #444; padding: 1.5mm 3mm; text-align: center; min-width: 13mm; height: 10mm; }
.tbl th { background: #f2f4f7; font-weight: 400; }
.pt { display: flex; align-items: center; gap: 8mm; }
.kkh { border-collapse: collapse; font-size: 5.4mm; margin-top: 4mm; }
.kkh th, .kkh td { border: .3mm solid #444; width: 16mm; height: 16mm; text-align: center; }
.kkh th { background: #eef4f2; }
.kkh th.cn { background: #dce9e5; }

/* 国語 */
.bank { display: flex; flex-wrap: wrap; gap: 1.5mm 4mm; align-items: center; border: .3mm solid #888; border-radius: 1.5mm; padding: 1.8mm 3mm; margin-bottom: 3mm; font-size: 4.4mm; }
.bank b { font-family: var(--ui); font-size: 3.2mm; background: var(--ink); color: #fff; padding: .2mm 2mm; border-radius: 1mm; margin-right: 1mm; }
.kj { display: flex; flex-direction: column; gap: 2.4mm; }
.kj.two { display: grid; grid-template-columns: 1fr 1fr; gap: 2.2mm 7mm; }
.kj-row { display: flex; align-items: center; }
.kj-l { width: 24mm; flex: none; display: flex; flex-direction: column; align-items: center; line-height: 1.15; padding-right: 2mm; }
.kj.two .kj-l { width: 17mm; }
.kj-w { font-size: 7mm; }
.kj-w small { font-size: .6em; }
.kj-y { font-size: 3.2mm; color: #444; text-align: center; }
.kj.two .kj-w { font-size: 5.6mm; }
.kj.two .kj-y { font-size: 2.8mm; }
.pg.kyg { column-gap: 3mm; }
.kyg > li { font-size: 5.4mm; gap: 1mm; overflow: hidden; }
.kyg > li::before { min-width: 5mm; }
.ky { display: inline-flex; align-items: flex-end; gap: 1mm; white-space: nowrap; }
.ky-k { font-size: 5.8mm; }
.ky-l { min-width: 15mm; font-size: 3.6mm; height: 8mm; }
.kkg { display: grid; grid-template-columns: repeat(var(--c), minmax(0, 1fr)); gap: 3mm 2mm; }
.kkg.c4 { --c: 4; } .kkg.c5 { --c: 5; }
.kk { display: flex; flex-direction: column; align-items: flex-start; }
.kk-r { font-size: 3.4mm; color: #333; padding-left: 1mm; }
.kk-b { display: inline-flex; align-items: center; gap: .5mm; font-size: calc(var(--ms, 15mm) * .52); white-space: nowrap; }
.wt-list { display: flex; flex-direction: column; gap: 4.5mm; }
.wt { display: grid; grid-template-columns: 24mm auto; grid-template-rows: auto auto; row-gap: 1.5mm; align-items: center; }
.wt-e { grid-row: 1 / 3; font-size: 13mm; text-align: center; font-family: var(--ui); }
.wt-e.hira { font-size: 4.6mm; font-family: var(--kfont); }
.wt-r { display: flex; }
.yq { display: inline-flex; align-items: center; gap: 4mm; font-size: 6mm; }
.yq-e { font-size: 11mm; font-family: var(--ui); }
.ch2 { display: inline-flex; gap: 1mm; border: .3mm solid #888; border-radius: 4mm; padding: 0 1.5mm; margin: 0 .5mm; font-size: .9em; }
.js > li { --ms: 11mm; }
.kc { display: flex; flex-direction: column; gap: 1mm; }
.kc-h { font-size: 4.6mm; }
.kc-b { display: inline-flex; --ms: 11mm; }
.roma { font-family: "Century Gothic", "Segoe UI", Arial, sans-serif; letter-spacing: .05em; }
.rm-tbl { display: flex; flex-direction: column; gap: 4mm; }
.rm-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 3mm; }
.rm { display: grid; grid-template-rows: 8mm 9mm 9mm 9mm; border: .3mm solid var(--rule); border-radius: 1.5mm; padding: 1mm 2mm; }
.rm-h { font-size: 6mm; text-align: center; }
.rm-m, .rm-t { font-family: "Century Gothic", "Segoe UI", Arial, sans-serif; font-size: 6.4mm; border-bottom: .2mm solid #99a; line-height: 9mm; text-align: center; }
.rm-t { color: var(--trace); }
.rm-e { border-bottom: .2mm solid #99a; }
.js-q { display: flex; gap: 6mm; flex-wrap: wrap; }
.js-w { display: inline-flex; align-items: center; gap: 2mm; font-size: 5.6mm; }
.sm-mean { font-size: 3.4mm; color: #555; margin-left: 2mm; }
.pg > li:has(.sm-mean) { flex-wrap: wrap; }
.mean { list-style: none; margin: 3mm 0 0; padding: 3mm 4mm; border: .3mm solid #888; border-radius: 1.5mm; font-size: 4.3mm; line-height: 1.9; }
.bs-k { font-size: 7mm; letter-spacing: 1mm; }
.bs-n { font-size: 4mm; padding: .5mm 2mm; background: #f2f4f7; border-radius: 1mm; margin-right: 3mm; }
.nk { display: inline-flex; gap: 4mm; align-items: center; font-size: 6mm; }
.keigo { width: 100%; font-size: 4.2mm; }
.keigo td, .keigo th { height: 17mm; }
.yj { display: inline-flex; align-items: center; --ms: 13mm; }
.yj-c { display: inline-grid; place-items: center; width: 13mm; height: 13mm; font-size: 9.5mm; }

/* ---------- 画面の幅がせまいとき ---------- */
@media (max-width: 900px) {
  .top-in { grid-template-columns: 1fr; gap: 14px; }
  .cols { grid-template-columns: 1fr; }
  .snav { justify-content: flex-start; }
}
@media screen and (max-width: 860px) {
  .sheets { align-items: flex-start; }
  .sheet { zoom: .46; }
}

/* ---------- 印刷 ---------- */
@page { size: A4 portrait; margin: 0; }
@media print {
  body { background: #fff; }
  .bar, .snav, .stats .btn { display: none !important; }
  .v-unit .sheets { padding: 0; gap: 0; display: block; }
  .v-unit .sheet { box-shadow: none; break-after: page; page-break-after: always; margin: 0; zoom: 1; }
  .v-unit .sheet:last-child { break-after: auto; page-break-after: auto; }
  .v-index { font-size: 11px; }
  .v-index .top { padding: 8mm 10mm 4mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .v-index .cov-main { padding: 0 10mm; }
  .v-index .col h3, .sh-cat, .mark, .seg, .kkh th, .tbl th, .rm-t, .ms.t i, .eg .x::after { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sheet * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .v-index .stage { break-inside: avoid-page; }
  .v-index .col { break-inside: avoid; }
}

/* HPに置くときに足したもの（創心館出版の棚へ戻るリンク） */
.top-txt .back { margin: 0 0 4px; font-size: 13px; }
.top-txt .back a { color: inherit; text-decoration: underline; }
@media print { .top-txt .back { display: none; } }
/* HPに置くときに足したもの：創心館出版の棚と色をそろえる（藍→墨・白地に赤の線）。元のドリルのファイルは変えていない */
:root { --ai: #1f2328; --ai-soft: #f6f4f1; --desk: #f6f4f1; --rule: #e3e0dc; }
.top { background: #fff; color: var(--ink); border-top: 3px solid #E60012; border-bottom: 1px solid #e3e0dc; }
.top-txt p { opacity: 1; color: #6b7076; }
.mark { background: #E60012; box-shadow: inset 0 0 0 2px #E60012, inset 0 0 0 3px #fff; }
/* 中学数学の紫（units-chugaku-sugaku.js が足す色）も墨に */
.col.sj-sugaku h3 { background: #1f2328 !important; }
.sj-sugaku .u-t { color: #1f2328 !important; }
.sj-sugaku .sh-cat { background: #1f2328 !important; }
.sj-sugaku .sh-lead { border-left-color: #1f2328 !important; }
