/* おなじ・ちがう プリント */
.sansu-sd-page {
    padding-bottom: 2.5rem;
}
.sansu-sd-title-bar {
    background: #d8efd0;
    color: #1f6b2c;
    text-align: center;
    font-weight: 800;
    font-size: 1.5rem;
    padding: 0.85rem 1rem;
    margin: 0 0 0.75rem;
    border-radius: 4px;
}
.sansu-sd-toolbar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}
@media (min-width: 768px) {
    .sansu-sd-toolbar {
        flex-direction: row;
        align-items: stretch;
    }
    .sansu-sd-pages-panel {
        flex: 1 1 0;
        min-width: 0;
    }
    .sansu-sd-reload-panel {
        flex: 0 1 280px;
        max-width: 320px;
        display: flex;
        flex-direction: column;
    }
    .sansu-sd-reload-btn {
        margin-top: auto;
        align-self: flex-start;
    }
}
.sansu-sd-pages-panel {
    background: #fff8e8;
    border: 2px solid #f0a000;
    border-radius: 12px;
    padding: 0.85rem 1rem 1rem;
}
.sansu-sd-pages-panel-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.75rem;
    margin-bottom: 0.35rem;
    color: #8a5a00;
}
.sansu-sd-pages-panel-head .bi {
    font-size: 1.25rem;
    color: #f0a000;
}
.sansu-sd-pages-panel-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #5c3d00;
}
.sansu-sd-pages-panel-current {
    margin-left: auto;
    font-size: 0.9rem;
    font-weight: 700;
    background: #fff;
    border: 1px solid #f0c56a;
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
    color: #8a5a00;
}
.sansu-sd-pages-panel-note {
    margin: 0 0 0.65rem;
    font-size: 0.85rem;
    color: #8a5a00;
}
.sansu-sd-pages-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}
.sansu-sd-pages-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.sansu-sd-pages-row .sansu-sd-print-btn {
    margin-left: 0.65rem;
    height: 2.5rem;
    padding: 0 1.15rem;
    font-size: 0.95rem;
    border-radius: 8px;
    white-space: nowrap;
}
.sansu-sd-pages-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.55rem;
    border: 2px solid #e0b84a;
    border-radius: 8px;
    background: #fff;
    color: #5c3d00;
    font-weight: 800;
    font-size: 1.05rem;
    text-decoration: none;
    line-height: 1;
}
.sansu-sd-pages-btn:hover {
    background: #fff3d1;
    border-color: #f0a000;
    color: #5c3d00;
}
.sansu-sd-pages-btn.is-active {
    background: #f0a000;
    border-color: #d99000;
    color: #fff;
}
.sansu-sd-reload-panel {
    background: #f4f7fb;
    border: 1px solid #c5d4e8;
    border-radius: 12px;
    padding: 0.85rem 1rem;
}
.sansu-sd-reload-panel-head {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.3rem;
    color: #2b4a6f;
}
.sansu-sd-reload-panel-head .bi {
    font-size: 1.1rem;
    color: #4A90D9;
}
.sansu-sd-reload-panel-title {
    font-size: 1rem;
    font-weight: 800;
}
.sansu-sd-reload-panel-note {
    margin: 0 0 0.65rem;
    font-size: 0.85rem;
    color: #5a6b7d;
}
.sansu-sd-reload-btn {
    font-weight: 700;
}
.sansu-sd-page-banner {
    background: #fff3d1;
    border: 1px solid #f0c56a;
    border-radius: 8px;
    color: #5c3d00;
    font-weight: 800;
    text-align: center;
    padding: 0.45rem 0.75rem;
    margin: 0 0 0.55rem;
}
.sansu-sd-sheet-page {
    background: #fff;
}
.sansu-sd-page-banner + .sansu-sd-sheet-page {
    margin-bottom: 0;
}
.sansu-sd-sheet-page + .page-break + .sansu-sd-page-banner,
.page-break + .sansu-sd-page-banner {
    margin-top: 1.75rem;
}
.page-break {
    display: none;
}
.sansu-sd-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.85rem;
}
.sansu-sd-card {
    background: #fff;
    border: 1px solid #cfd6de;
    border-radius: 10px;
    padding: 0.85rem 0.9rem 0.7rem;
    min-height: 220px;
    display: flex;
    flex-direction: column;
}
.sansu-sd-card-head {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.45rem;
    font-size: 0.8rem;
    color: #666;
}
.sansu-sd-star {
    color: #f0a000;
    font-size: 0.95rem;
}
.sansu-sd-q {
    font-size: 18px;
    line-height: 1.55;
    margin-bottom: 0.75rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem 0.15rem;
}
.sansu-sd-q-num {
    font-size: 24px;
    line-height: 1;
    margin-right: 0.35rem;
    flex-shrink: 0;
}
.sansu-sd-q-inline-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    object-fit: contain;
    flex-shrink: 0;
    vertical-align: middle;
}
/* 基準イラスト（おおきい・ちいさい②）— md 相当 */
.sansu-sd-q-ref-icon {
    width: 2.55rem;
    height: 2.55rem;
    object-fit: contain;
    flex-shrink: 0;
    vertical-align: middle;
    margin-right: 0.15rem;
}
.sansu-sd-q-ref-icon.is-size-md {
    width: 2.55rem;
    height: 2.55rem;
}
.sansu-sd-kw-same {
    color: #2b6cb0;
    font-weight: 800;
}
.sansu-sd-kw-diff {
    color: #d94848;
    font-weight: 800;
}
.sansu-sd-kw-big {
    color: #2b6cb0;
    font-weight: 800;
}
.sansu-sd-kw-small {
    color: #d94848;
    font-weight: 800;
}
.sansu-sd-hint {
    font-size: 0.85rem;
    color: #555;
}
.sansu-sd-choices {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    gap: 0.35rem;
    flex: 1;
    margin-top: 0.25rem;
}
.sansu-sd-choice {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    flex: 1;
    max-width: 6.5rem;
}
.sansu-sd-mark {
    width: 1.05rem;
    height: 1.05rem;
    border: 2px solid #b8c0cc;
    border-radius: 50%;
    background: #f3f5f8;
}
.sansu-sd-choice-img {
    width: 3.4rem;
    height: 3.4rem;
    object-fit: contain;
}
.sansu-sd-choice-img-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 5.3rem;
    height: 5.3rem;
}
.sansu-sd-choice-img.is-size-xs {
    width: 1.35rem;
    height: 1.35rem;
}
.sansu-sd-choice-img.is-size-sm {
    width: 1.85rem;
    height: 1.85rem;
}
.sansu-sd-choice-img.is-size-md {
    width: 2.55rem;
    height: 2.55rem;
}
.sansu-sd-choice-img.is-size-lg {
    width: 5.1rem;
    height: 5.1rem;
}

/* おおい・すくない（個数グループ） */
.sansu-mf-card .sansu-sd-card-head {
    font-size: 0.95rem;
}
.sansu-mf-choices {
    align-items: flex-start;
    gap: 0.5rem;
}
.sansu-mf-choice {
    max-width: none;
    flex: 1 1 0;
}
.sansu-mf-group {
    width: 100%;
    min-height: 6.2rem;
    border: 2px dashed #b0b8c4;
    border-radius: 10px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem;
}
.sansu-mf-icons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.3rem;
    max-width: 100%;
}
.sansu-mf-icons img {
    width: 2.35rem;
    height: 2.35rem;
    object-fit: contain;
}
.sansu-mf-same-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.55rem;
}
.sansu-mf-same-num {
    flex-shrink: 0;
    align-self: center;
}
.sansu-mf-same-head .sansu-mf-choice.is-target {
    flex: 0 0 auto;
    width: 6.2rem;
}
.sansu-mf-same-head .sansu-mf-group {
    min-height: 5.8rem;
}
.sansu-mf-same-q {
    flex: 1 1 auto;
    margin-bottom: 0;
    align-self: center;
}
.sansu-mf-card.is-same-count .sansu-mf-choices .sansu-mf-choice {
    max-width: 33%;
}

/* おおい・すくない①（量の多い／少ない PNG） */
.sansu-lm-choices {
    align-items: flex-start;
    gap: 0.65rem;
}
.sansu-lm-choice {
    max-width: none;
    flex: 1 1 0;
}
.sansu-lm-choice-img {
    width: 100%;
    max-width: 7.5rem;
    height: auto;
    max-height: 6.5rem;
    object-fit: contain;
}

/* ながい・みじかい（基準画像） */
.sansu-sl-same-head .sansu-sl-target {
    flex: 0 0 auto;
    width: auto;
    max-width: 7.5rem;
}
.sansu-sl-ref-img {
    max-width: 7rem;
    max-height: 5.5rem;
}

.sansu-sd-card-foot {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}
.sansu-sd-answer-btn {
    border: none;
    background: #5cb85c;
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.2rem 0.7rem;
    border-radius: 999px;
    cursor: pointer;
}
.sansu-sd-answer-btn[aria-pressed="true"] {
    background: #3d8b3d;
}
.sansu-sd-card.is-revealed .sansu-sd-choice.is-correct .sansu-sd-mark {
    border-color: #2b6cb0;
    background: #2b6cb0;
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.25);
}
.sansu-sd-print-wrap {
    text-align: center;
    margin-top: 1.5rem;
}
.sansu-sd-print-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: #f0a000;
    border: none;
    color: #fff;
    font-weight: 800;
    font-size: 1.05rem;
    padding: 0.75rem 1.6rem;
    border-radius: 999px;
    cursor: pointer;
}
.sansu-sd-print-btn:hover {
    background: #d99000;
    color: #fff;
}
.sansu-sd-print-sp-note {
    color: #5a6a7a;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.5rem 0;
}
.sansu-sd-note {
    color: #c45a8a;
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

/* 算数ロゴは英語より縦があるので画面プレビュー用に調整しない（印刷時に指定） */

@media (max-width: 767.98px) {
    .sansu-sd-grid {
        grid-template-columns: 1fr;
    }
}

/* 印刷: 英語シートと同様に print-header / print-footer を表示し、問題は画面と同じ2×3 */
@media print {
    @page {
        size: A4 portrait;
        margin: 8mm;
    }

    html, body.sansu-same-diff-sheet {
        background: #fff !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }

    body.sansu-same-diff-sheet .sansu-sd-screen-only,
    body.sansu-same-diff-sheet .sansu-sd-back,
    body.sansu-same-diff-sheet .sansu-sd-toolbar,
    body.sansu-same-diff-sheet .sansu-sd-note,
    body.sansu-same-diff-sheet .sansu-sd-card-foot,
    body.sansu-same-diff-sheet .sansu-sd-print-wrap,
    body.sansu-same-diff-sheet .footer-about,
    body.sansu-same-diff-sheet .container-fluid.footer-about,
    body.sansu-same-diff-sheet .breadcrumb,
    body.sansu-same-diff-sheet nav.breadcrumb,
    body.sansu-same-diff-sheet .site-header,
    body.sansu-same-diff-sheet header {
        display: none !important;
    }

    body.sansu-same-diff-sheet .sansu-sd-page {
        padding: 0 !important;
        margin: 0 !important;
        max-width: none !important;
        width: 100% !important;
    }

    body.sansu-same-diff-sheet .sheet.sansu-sd-sheet,
    body.sansu-same-diff-sheet .sansu-sd-sheet-page {
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    body.sansu-same-diff-sheet .page-break {
        display: block !important;
        height: 0;
        margin: 0;
        padding: 0;
        border: 0;
        break-before: page;
        page-break-before: always;
    }

    body.sansu-same-diff-sheet .print-header {
        display: block !important;
        margin-bottom: 3mm !important;
    }

    body.sansu-same-diff-sheet .print-header .logo {
        margin-bottom: 2mm !important;
        text-align: right;
    }

    body.sansu-same-diff-sheet .print-header .logo img {
        width: 42mm !important;
        height: auto !important;
        max-height: 10mm;
        object-fit: contain;
        filter: none;
    }

    body.sansu-same-diff-sheet .print-header .title {
        font-size: 12pt !important;
    }

    body.sansu-same-diff-sheet .print-footer {
        display: block !important;
        margin-top: 2.5mm !important;
    }

    body.sansu-same-diff-sheet .print-footer .qr img {
        width: 12mm !important;
    }

    body.sansu-same-diff-sheet .sansu-sd-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: 1fr 1fr 1fr !important;
        gap: 2.8mm;
        height: 220mm;
        width: 100%;
    }

    body.sansu-same-diff-sheet .sansu-sd-card {
        min-height: 0 !important;
        height: 100%;
        border: 0.35mm solid #cfd6de;
        border-radius: 2mm;
        padding: 2.5mm 3mm 2mm;
        background: #fff !important;
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none;
    }

    body.sansu-same-diff-sheet .sansu-sd-card-head {
        margin-bottom: 1mm;
        font-size: 7.5pt;
    }

    body.sansu-same-diff-sheet .sansu-sd-star {
        color: #f0a000 !important;
    }

    body.sansu-same-diff-sheet .sansu-sd-q {
        font-size: 18px;
        line-height: 1.4;
        margin-bottom: 2mm;
    }

    body.sansu-same-diff-sheet .sansu-sd-q-num {
        font-size: 24px;
        line-height: 1;
        margin-right: 0.35rem;
    }

    body.sansu-same-diff-sheet .sansu-sd-kw-same {
        color: #2b6cb0 !important;
    }

    body.sansu-same-diff-sheet .sansu-sd-kw-diff {
        color: #d94848 !important;
    }

    body.sansu-same-diff-sheet .sansu-sd-kw-big {
        color: #2b6cb0 !important;
    }

    body.sansu-same-diff-sheet .sansu-sd-kw-small {
        color: #d94848 !important;
    }

    body.sansu-same-diff-sheet .sansu-sd-hint {
        font-size: 8pt;
    }

    body.sansu-same-diff-sheet .sansu-sd-q-inline-icon {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        max-width: 40px;
        max-height: 40px;
        object-fit: contain;
        flex-shrink: 0;
    }

    body.sansu-same-diff-sheet .sansu-sd-q-ref-icon,
    body.sansu-same-diff-sheet .sansu-sd-q-ref-icon.is-size-md {
        width: 10.5mm;
        height: 10.5mm;
        object-fit: contain;
        flex-shrink: 0;
        margin-right: 0.5mm;
    }

    body.sansu-same-diff-sheet .sansu-sd-choices {
        flex: 1;
        align-items: center;
        margin-top: 0;
    }

    body.sansu-same-diff-sheet .sansu-sd-choice {
        max-width: none;
    }

    body.sansu-same-diff-sheet .sansu-sd-choice-img {
        width: 14mm;
        height: 14mm;
    }

    body.sansu-same-diff-sheet .sansu-sd-choice-img-wrap {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 22mm;
        height: 22mm;
    }

    body.sansu-same-diff-sheet .sansu-sd-choice-img.is-size-xs {
        width: 5.5mm;
        height: 5.5mm;
    }

    body.sansu-same-diff-sheet .sansu-sd-choice-img.is-size-sm {
        width: 7.5mm;
        height: 7.5mm;
    }

    body.sansu-same-diff-sheet .sansu-sd-choice-img.is-size-md {
        width: 10.5mm;
        height: 10.5mm;
    }

    body.sansu-same-diff-sheet .sansu-sd-choice-img.is-size-lg {
        width: 21mm;
        height: 21mm;
    }

    body.sansu-same-diff-sheet .sansu-mf-group {
        min-height: 24mm;
        border: 0.35mm dashed #b0b8c4;
        border-radius: 2mm;
        padding: 1.2mm;
    }

    body.sansu-same-diff-sheet .sansu-mf-icons {
        gap: 1mm;
    }

    body.sansu-same-diff-sheet .sansu-mf-icons img {
        width: 9.5mm;
        height: 9.5mm;
    }

    body.sansu-same-diff-sheet .sansu-mf-same-head {
        gap: 2mm;
        margin-bottom: 1.5mm;
    }

    body.sansu-same-diff-sheet .sansu-mf-same-head .sansu-mf-choice.is-target {
        width: 24mm;
    }

    body.sansu-same-diff-sheet .sansu-mf-same-head .sansu-mf-group {
        min-height: 22mm;
    }

    body.sansu-same-diff-sheet .sansu-lm-choices {
        gap: 3mm;
        align-items: flex-start;
    }

    body.sansu-same-diff-sheet .sansu-lm-choice-img {
        max-width: 32mm;
        max-height: 28mm;
        width: 100%;
        height: auto;
        object-fit: contain;
    }

    body.sansu-same-diff-sheet .sansu-sl-ref-img {
        max-width: 28mm;
        max-height: 24mm;
    }

    body.sansu-same-diff-sheet .sansu-sd-mark {
        width: 3.8mm;
        height: 3.8mm;
        border: 0.35mm solid #b8c0cc;
        background: #fff !important;
    }

    body.sansu-same-diff-sheet .sansu-sd-card.is-revealed .sansu-sd-choice.is-correct .sansu-sd-mark {
        background: #fff !important;
        border-color: #b8c0cc !important;
        box-shadow: none !important;
    }
}
