/* ===========================================================================
   PocketMod printable sheet.
   One sheet, single-sided: a 4-column x 2-row grid; the bottom row is rotated
   180 degrees so the booklet reads correctly after the zine fold. The .no-print
   helpers hide editor chrome (page badges, cut guide) on the physical printout.
   =========================================================================== */

.pocketmod-print-root {
    background: #fff;
}

.pocketmod-sheet {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: 1fr 1fr;
    width: 297mm;
    height: 210mm;
    background: #fff;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    page-break-after: avoid;
    break-after: avoid;
    page-break-inside: avoid;
    break-inside: avoid;
}

.pocketmod-sheet.letter {
    width: 11in;
    height: 8.5in;
}

.pocketmod-panel {
    box-sizing: border-box;
    padding: 5mm;
    overflow: hidden;
    border: 1px dashed #d0d0d0;
    position: relative;
    background: #fff;
}

.pocketmod-panel.rotated {
    transform: rotate(180deg);
}

.pocketmod-cut-guide {
    position: absolute;
    left: 25%;
    width: 50%;
    top: 50%;
    border-top: 2px dashed #999;
    pointer-events: none;
}

.pm-page-badge {
    position: absolute;
    top: 1mm;
    right: 2mm;
    font-size: 6pt;
    color: #bbb;
}

/* Cover ------------------------------------------------------------------- */
.pm-cover {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
}

.pm-cover-title {
    font-size: 14pt;
    font-weight: 700;
    word-break: break-word;
}

.pm-cover-subtitle {
    font-size: 9pt;
    color: #666;
    margin-top: 2mm;
}

/* ActionList -------------------------------------------------------------- */
.pm-actionlist {
    font-size: 7.5pt;
    line-height: 1.25;
}

.pm-heading {
    font-weight: 700;
    margin-bottom: 1mm;
    border-bottom: 1px solid #999;
    padding-bottom: 0.5mm;
}

.pm-group {
    margin-bottom: 1.5mm;
}

.pm-group-heading {
    font-weight: 700;
    font-size: 7pt;
    text-transform: uppercase;
    color: #444;
    margin-top: 1mm;
}

.pm-line {
    display: flex;
    align-items: center;
    gap: 1mm;
    white-space: nowrap;
    overflow: hidden;
}

.pm-line-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pm-checkbox {
    display: inline-block;
    width: 2.6mm;
    height: 2.6mm;
    border: 0.6pt solid #333;
    flex: none;
}

.pm-color-dot {
    display: inline-block;
    width: 2mm;
    height: 2mm;
    border-radius: 50%;
    flex: none;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.pm-overflow {
    font-style: italic;
    color: #777;
    margin-top: 1mm;
}

.pm-unavailable {
    font-size: 8pt;
    color: #a00;
    font-style: italic;
}

/* NoteLines --------------------------------------------------------------- */
.pm-notes {
    height: 100%;
}

.pm-note-line {
    border-bottom: 0.5pt solid #bbb;
    height: 1.7em;
    display: flex;
    align-items: center;
}

.pm-note-line .pm-checkbox {
    margin-right: 1mm;
}

.pm-notes.style-grid .pm-note-line {
    border-bottom: none;
    background-image:
        linear-gradient(#eee 1px, transparent 1px),
        linear-gradient(90deg, #eee 1px, transparent 1px);
    background-size: 4mm 4mm;
}

.pm-notes.style-dots .pm-note-line {
    border-bottom: none;
    background-image: radial-gradient(#bbb 0.5pt, transparent 0.6pt);
    background-size: 3mm 3mm;
}

.pm-notes.style-blank .pm-note-line {
    border-bottom: none;
}

/* Builder preview scaling -------------------------------------------------- */
.pocketmod-preview-wrap {
    flex: 1;
    overflow: auto;
    background: #f5f5f5;
    padding: 16px;
}

/* Scaled with CSS `zoom` (set inline via ScaleStyle). Unlike transform:scale(),
   zoom reflows layout, so the wrap's scroll area always matches the visible sheet
   at every zoom level. margin:auto centers it when narrower than the wrap. */
.pocketmod-preview-scale {
    margin: 0 auto;
}

/* Print ------------------------------------------------------------------- */
@media print {
    @page { size: A4 landscape; margin: 0; }

    html, body {
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }

    .pocketmod-print-root {
        margin: 0;
        padding: 0;
    }

    .no-print {
        display: none !important;
    }

    .pocketmod-panel {
        border-color: transparent;
    }

    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}
