/* 単語テストメーカー */
.tg-samples { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; border: 2px dashed var(--line); border-radius: 14px; background: color-mix(in srgb, var(--yellow) 22%, var(--card)); margin-bottom: 14px; }
.tg-sl { font-weight: 900; display: inline-flex; align-items: center; gap: 6px; margin-right: 4px; }
.tg-wrap { display: grid; grid-template-columns: minmax(0, 410px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .tg-wrap { grid-template-columns: minmax(0, 1fr); } }
.tg-side { display: grid; gap: 12px; min-width: 0; }
.tg-card { display: grid; gap: 10px; padding: 14px; }
.tg-h { font-size: 15.5px; margin: 0; }
.tg-ta { font-family: var(--mono); font-size: 13.5px; min-height: 180px; tab-size: 12; white-space: pre; overflow-x: auto; }
.tg-info { display: flex; flex-wrap: wrap; gap: 6px; }
.tg-more summary { cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--ink2); }
.tg-instbox { margin-top: 8px; }
.tg-pvcol { position: sticky; top: 74px; min-width: 0; display: grid; gap: 8px; }
@media (max-width: 960px) { .tg-pvcol { position: static; } }
.tg-tb { margin-bottom: 0; }
.tg-sum { color: var(--ink2); font-weight: 700; }
.tg-pvtabs { overflow-x: auto; max-width: 100%; }
.tg-notes p { margin: 0; }
.tg-stage { overflow: hidden; border: 2px solid var(--line); border-radius: 14px; background: repeating-linear-gradient(45deg, var(--bg2), var(--bg2) 10px, var(--bg) 10px, var(--bg) 20px); padding: 8px; position: relative; }
.tg-sheets { transform-origin: 0 0; width: 210mm; }
.tg-sheets .tg-page { box-shadow: 0 2px 14px rgba(0, 0, 0, .18); margin-bottom: 6mm; }
.tg-empty { width: 210mm; padding: 40mm 20mm; text-align: center; font-size: 18pt; color: var(--ink2); }
.tg-measure { position: absolute; left: -12000px; top: 0; width: 210mm; visibility: hidden; pointer-events: none; }
.tg-formopt { margin-top: 12px; padding-top: 12px; border-top: 2px dashed var(--line-soft); align-items: flex-end; }

/* ---- 紙（画面のプレビューと印刷で共通） ---- */
.tg-page { width: 210mm; height: 296mm; padding: 11mm 13mm 0; background: #fff; color: #161616; font-size: var(--fs, 12pt); line-height: 1.38; position: relative; overflow: hidden; box-sizing: border-box; font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', Meiryo, sans-serif; }
.tg-measure .tg-page { height: auto; }
.tg-body { display: flow-root; }
.tg-head { display: flex; align-items: center; gap: 4mm; border-bottom: 0.6mm solid #161616; padding-bottom: 2mm; }
.tg-tt { flex: 1; min-width: 0; }
.tg-ttl { font-size: 1.55em; font-weight: 900; letter-spacing: .04em; line-height: 1.2; display: flex; align-items: center; gap: 3mm; }
.tg-sub { font-size: .9em; color: #444; margin-top: .5mm; }
.tg-key { font-size: .55em; color: #fff; background: #d6332a; border-radius: 1.2mm; padding: .4mm 2.2mm; letter-spacing: .1em; }
.tg-ver { width: 12mm; height: 12mm; border: 0.6mm solid #161616; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 15pt; flex: none; }
.tg-meta { display: flex; align-items: stretch; gap: 2mm; margin: 2.4mm 0 3mm; font-size: max(9pt, .82em); }
.tg-f { border-bottom: 0.3mm solid #161616; padding: 1.4mm 1mm .6mm; white-space: nowrap; display: flex; align-items: flex-end; }
.tg-fn { flex: 1; min-width: 40mm; }
.tg-score { margin-left: auto; border: 0.5mm solid #161616; border-radius: 2mm; min-width: 30mm; display: flex; align-items: flex-end; justify-content: flex-end; gap: 1mm; padding: 1mm 2mm; min-height: 11mm; }
.tg-score > span { flex: 1; text-align: center; font-size: 15pt; font-weight: 900; }
.tg-score small { font-size: 9pt; white-space: nowrap; }
.tg-sec { margin-top: 2.6mm; }
.tg-inst { display: flex; gap: 2mm; align-items: flex-start; font-weight: 700; margin-bottom: 1.6mm; }
.tg-no { flex: none; min-width: 1.5em; height: 1.5em; border: 0.45mm solid #161616; display: grid; place-items: center; font-weight: 900; font-size: .9em; background: #161616; color: #fff; border-radius: .9mm; padding: 0 .3em; }
.tg-grid { display: grid; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); column-gap: 7mm; row-gap: .55em; padding-left: 1mm; }
.tg-q { display: flex; align-items: flex-end; gap: 1.6mm; min-height: max(2.1em, 7.5mm); break-inside: avoid; }
.tg-n { flex: none; font-weight: 700; color: #333; min-width: 2.1em; }
.tg-p { flex: none; max-width: 62%; font-weight: 600; }
.tg-line { flex: 1; min-width: 18mm; border-bottom: 0.3mm solid #222; min-height: 1.6em; display: flex; align-items: flex-end; padding: 0 1mm; }
.tg-red { color: #d6332a; font-weight: 700; font-family: inherit; }
.tg-qc { flex-wrap: wrap; align-items: baseline; }
.tg-qc .tg-p { max-width: 45%; min-width: 5.5em; }
.tg-paren { flex: none; white-space: nowrap; margin-left: auto; }
.tg-pb { display: inline-block; min-width: 2.4em; text-align: center; }
.tg-opts { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; column-gap: 1em; row-gap: .1em; font-size: .94em; }
.tg-opts span { white-space: nowrap; }
.tg-opts b { margin-right: .35em; }
.tg-qs { flex-wrap: wrap; }
.tg-let { display: inline-flex; flex-wrap: wrap; gap: .25em; align-items: center; }
.tg-let i { font-style: normal; border: 0.25mm solid #777; border-radius: 1mm; min-width: 1.35em; text-align: center; padding: 0 .15em; font-size: .92em; background: #f4f4f4; }
.tg-let small { font-size: .8em; color: #555; }
.tg-qs .tg-line { min-width: 28mm; }
.tg-qi { flex-wrap: wrap; }
.tg-boxes { display: inline-flex; flex-wrap: wrap; gap: .7em; align-items: flex-end; }
.tg-wd { display: inline-flex; }
.tg-wd i { font-style: normal; width: 1.45em; height: 1.65em; border: 0.25mm solid #444; border-right-width: 0; display: grid; place-items: center; }
.tg-wd i:last-child { border-right-width: 0.25mm; }
.tg-wd i.f { font-weight: 800; background: #f1f1f1; }
.tg-qz { align-items: baseline; line-height: 1.9; }
.tg-s { flex: 1; }
.tg-sp { display: inline-block; border-bottom: 0.3mm solid #222; height: 1em; vertical-align: -0.1em; }
.tg-m { margin-left: .6em; color: #444; font-size: .88em; white-space: nowrap; }
.tg-match { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) 26mm minmax(0, 1fr); }
.tg-mcol > div { display: flex; align-items: center; gap: 1.6mm; height: 2.2em; }
.tg-mcol.l > div { justify-content: flex-end; }
.tg-mcol.l .tg-mt { flex: 1; text-align: right; }
.tg-mt { font-weight: 600; }
.tg-dot { width: 2.4mm; height: 2.4mm; border-radius: 50%; background: #161616; flex: none; }
.tg-mgap { position: relative; }
.tg-mlines { position: absolute; inset: 0; width: 100%; height: 100%; }
.tg-ksec .tg-grid { row-gap: .25em; }
.tg-k { display: flex; gap: 1.5mm; align-items: baseline; border-bottom: 0.2mm dotted #bbb; padding-bottom: .3mm; }
.tg-k small { color: #555; font-size: .85em; }
.tg-foot { position: absolute; left: 13mm; right: 13mm; bottom: 5mm; display: flex; justify-content: space-between; font-size: 7pt; color: #888; border-top: 0.2mm solid #ddd; padding-top: 1mm; }

/* ---- フラッシュカード ---- */
.tg-fc { position: fixed; inset: 0; z-index: 9999; background: #183a33; color: #f6f2e7; display: grid; grid-template-rows: auto 1fr auto auto; gap: 12px; padding: 14px; }
.tg-fc-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tg-fc-top .sp { flex: 1; }
.tg-fc-top .seg { box-shadow: none; }
.tg-fc-cnt { font-weight: 900; font-size: 18px; }
.tg-fc-card { display: grid; place-items: center; align-content: center; gap: 3vh; border: 3px solid #f6f2e7; border-radius: 26px; cursor: pointer; text-align: center; padding: 20px; user-select: none; min-height: 0; }
.tg-fc-front { font-size: clamp(36px, 10vw, 120px); font-weight: 900; line-height: 1.15; word-break: break-word; }
.tg-fc-back { font-size: clamp(24px, 6vw, 72px); font-weight: 800; color: #ffd23f; min-height: 1.2em; opacity: 0; transform: translateY(8px); transition: .25s; }
.tg-fc-back.on { opacity: 1; transform: none; }
.tg-fc-nav { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.tg-fc-nav .btn { color: #1d2433; }
.tg-fc-help { text-align: center; margin: 0; font-size: 13px; opacity: .75; }

/* 長いページで「なめらかスクロール」中に押すとボタンの位置がずれるため、このアプリのページだけ即時スクロールにする */
html { scroll-behavior: auto; }
