.print-page { background: #f3f4f6; }
.print-wrap { max-width: 1180px; margin: 28px auto 0; padding: 0 16px; }
.print-screen h1 { margin: 0 0 8px; font-size: 2rem; font-weight: 800; text-align: center; }
.print-lead { margin: 0 auto 22px; max-width: 720px; text-align: center; color: #374151; line-height: 1.6; }
.print-layout { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }
.print-controls {
    flex: 1 1 300px;
    max-width: 360px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px #0001;
    padding: 20px;
}
.print-controls fieldset { border: 0; margin: 0 0 20px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.print-controls legend { font-size: 17px; font-weight: 800; margin-bottom: 8px; }
.print-check { display: flex; align-items: center; gap: 10px; font-size: 15px; min-height: 24px; cursor: pointer; }
.print-check.is-all { font-weight: 700; }
.print-check input { width: 18px; height: 18px; margin: 0; accent-color: #111; flex: none; }
.style-options { display: grid; gap: 8px; }
.style-option {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    text-align: right;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 14px;
    min-height: 44px;
    cursor: pointer;
    background: #fff;
}
.style-option input { position: absolute; opacity: 0; pointer-events: none; }
.style-option:has(input:checked) { border: 2px solid #111; }
.style-option strong, .style-option span { display: block; }
.style-option strong { font-size: 15px; font-weight: 800; color: #111; }
.style-option span { color: #4b5563; font-size: 13px; }
.print-actions { display: flex; flex-direction: column; gap: 8px; }
.print-go {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 8px;
    background: #111;
    color: #fff;
    font: inherit;
    font-size: 17px;
    font-weight: 800;
    line-height: 1;
    min-height: 52px;
    padding: 0 16px;
    cursor: pointer;
}
.print-tip { margin: 8px 0 0; color: #4b5563; font-size: 13px; }
.print-faq { max-width: 760px; margin: 28px auto 40px; padding: 0 16px; }
.print-faq h2 { font-size: 1.4rem; }
.print-faq h3 { font-size: 1.05rem; margin: 16px 0 4px; }
.print-stage { flex: 1 1 460px; min-width: 0; }
.print-sheet-frame {
    width: min(100%, 210mm);
    margin: 0 auto 22px;
    position: relative;
    overflow: hidden;
    aspect-ratio: 210 / 297;
}
.print-sheet {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: top left;
    width: 210mm;
    min-height: 297mm;
    box-sizing: border-box;
    padding: 12mm 12mm 10mm;
    background: #fff;
    color: #111;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .14);
    display: flex;
    flex-direction: column;
    font-family: 'Open Sans', Arial, sans-serif;
}
.sheet-head {
    display: grid;
    grid-template-columns: 148px minmax(0, 1fr) 148px;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    margin-bottom: 8px;
    padding: 0 12px;
    background: #000;
    color: #fff;
}
.sheet-logo-link { justify-self: start; align-self: center; display: flex; align-items: center; line-height: 0; text-decoration: none; }
.sheet-logo { height: 26px; width: auto; display: block; }
.sheet-title {
    margin: 0;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
}
.sheet-page {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    justify-self: end;
    align-self: center;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}
.sheet-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.sheet-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    min-height: 36px;
    margin-top: 10px;
    padding: 0;
    background: #000;
    color: #fff;
    line-height: 1;
    border: 0;
}
.sheet-foot-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 36px;
    padding: 0 12px;
    box-sizing: border-box;
    color: #fff;
    text-decoration: none;
}
.sheet-credit,
.sheet-source {
    display: flex;
    align-items: center;
    min-height: 36px;
    color: #fff;
    text-decoration: none;
}
.sheet-credit { font-size: 14px; font-weight: 800; }
.sheet-source { font-size: 10px; font-weight: 600; }
.sheet-note { margin: 0 0 8px; font-size: 12px; color: #374151; text-align: center; }
.print-grid, .print-explained, .print-cards { flex: 1; min-height: 0; }
.print-grid { display: grid; gap: 3px; }
.print-grid--named { grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: repeat(6, minmax(0, 1fr)); }
.print-grid--plain { grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(8, minmax(0, 1fr)); }
.print-grid--named img { width: 56px; height: 56px; }
.print-grid--plain img { width: 64px; height: 64px; }
.print-cell, .explain-card {
    border: 1px solid #d1d5db;
    border-radius: 4px;
    overflow: hidden;
    min-width: 0;
    min-height: 0;
}
a.sheet-sign-link { color: inherit; text-decoration: none; }
.print-cell { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 4px; }
.print-cell img { object-fit: contain; }
.grid-num { font-weight: 800; font-size: 11px; line-height: 1.15; }
.print-grid--plain .grid-num { font-size: 10px; }
.grid-name, .card-name, .explain-desc { overflow-wrap: anywhere; }
.grid-name { font-size: 10px; line-height: 1.2; max-height: 2.4em; overflow: hidden; }
.print-explained { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(7, minmax(0, 1fr)); gap: 4px; }
.explain-card { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; text-align: center; gap: 2px; padding: 4px; }
.explain-card img { width: 52px; height: 52px; object-fit: contain; flex: none; }
.explain-title { font-weight: 800; font-size: 13px; line-height: 1.1; }
.explain-desc { margin: 0; color: #111; font-size: 12px; font-weight: 600; line-height: 1.3; overflow: hidden; }
.print-pdf-source { position: fixed; left: 0; top: 0; width: 210mm; height: 297mm; overflow: hidden; z-index: 1; pointer-events: none; background: #fff; }
body.print-pdf-busy { overflow: hidden; }
.print-pdf-modal { position: fixed; inset: 0; z-index: 200000; display: flex; align-items: center; justify-content: center; padding: 16px; background: #f3f4f6; }
.print-pdf-dialog { width: min(420px, 100%); background: #fff; color: #111; border-radius: 12px; padding: 28px 24px 24px; text-align: center; box-shadow: 0 16px 40px rgba(0, 0, 0, .2); }
.print-pdf-dialog h2 { margin: 0 0 8px; font-size: 22px; font-weight: 800; }
.print-pdf-status { margin: 0 0 16px; color: #374151; font-size: 15px; }
.print-pdf-bar { height: 10px; background: #e5e7eb; border-radius: 99px; overflow: hidden; }
.print-pdf-bar span { display: block; height: 100%; width: 0; background: #111; border-radius: 99px; }
.print-go:disabled { opacity: .65; cursor: wait; }
.print-cards { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cut-card { height: auto; min-height: 0; border: 1px dashed #111; display: flex; overflow: hidden; background: #fff; }
.cut-face { width: 50%; min-width: 0; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 3px; padding: 6px; box-sizing: border-box; overflow: hidden; }
.cut-sign { border-left: 1px dotted #111; }
.cut-sign img { width: 64px; height: 64px; object-fit: contain; }
.card-num { font-size: 13px; font-weight: 800; line-height: 1.15; }
.card-desc { margin: 0; color: #111; font-size: 10px; font-weight: 600; line-height: 1.25; overflow: hidden; }
.print-bw .print-sheet img { filter: grayscale(1); }
.print-empty { background: #fff; border-radius: 12px; padding: 24px; text-align: center; }

@page { size: A4; margin: 0; }
@media print {
    body > header,
    body > footer,
    .site-breadcrumb,
    .print-screen,
    .print-controls,
    .print-actions,
    .print-pdf-source,
    .print-pdf-modal,
    .print-tip,
    .menu-toggle,
    .adsbygoogle,
    ins.adsbygoogle,
    .google-auto-placed,
    iframe[id^="google_ads"],
    iframe[id^="aswift"],
    iframe[name^="google_ads"],
    div[id^="google_ads"],
    div[id^="aswift"],
    .enable-toolbar,
    #enable-toolbar {
        display: none !important;
    }
    body, .print-page { background: #fff !important; margin: 0; }
    .print-wrap { max-width: none; margin: 0; padding: 0; }
    .print-layout, .print-stage { display: block; }
    .print-sheet-frame {
        display: block !important;
        position: static !important;
        overflow: visible !important;
        width: auto !important;
        height: auto !important;
        aspect-ratio: auto !important;
        margin: 0 !important;
    }
    .print-sheet {
        display: flex !important;
        flex-direction: column;
        position: static !important;
        left: auto !important;
        top: auto !important;
        transform: none !important;
        box-shadow: none !important;
        width: 210mm !important;
        height: 297mm !important;
        min-height: 0 !important;
        box-sizing: border-box;
        margin: 0 !important;
        padding: 12mm 12mm 10mm;
        overflow: hidden;
        break-after: page;
        page-break-after: always;
    }
    .print-sheet-frame:last-child .print-sheet { break-after: auto; page-break-after: auto; }
    .sheet-head, .sheet-body, .sheet-foot { display: flex; }
    .sheet-head { display: grid; }
    .sheet-body { display: flex; flex-direction: column; }
    .print-grid, .print-explained, .print-cards { display: grid; }
    * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (max-width: 860px) {
    .print-page, .print-wrap { overflow-x: hidden; }
    .print-layout { flex-direction: column; }
    .print-controls, .print-stage { max-width: none; width: 100%; flex: 1 1 auto; box-sizing: border-box; }
    .print-screen h1 { font-size: 1.55rem; }
    .print-check { align-items: flex-start; }
    .print-check span { line-height: 1.35; }
    .style-option { width: 100%; box-sizing: border-box; }
    .print-sheet-frame { width: 100%; }
}
