body {
    font-family: 'M PLUS Rounded 1c', sans-serif;
    -webkit-print-color-adjust: exact;
    color-adjust: exact;
}
.printable-area {
    max-width: 800px;
    margin: auto;
}
.speech-bubble {
    position: relative;
    background: #f0fdf4; /* green-50 */
    border: 2px solid #22c55e; /* green-500 */
    border-radius: .8rem;
}
.speech-bubble:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 15%;
    width: 0;
    height: 0;
    border: 20px solid transparent;
    border-top-color: #22c55e;
    border-bottom: 0;
    border-left: 0;
    margin-left: -10px;
    margin-bottom: -20px;
}
/* Hide the triangle for specific bubbles */
.speech-bubble.no-triangle:after {
    display: none;
}
.memo-box {
    background-color: #fefce8; /* yellow-50 */
    border-left: 6px solid #facc15; /* yellow-400 */
    padding: 1rem;
    border-radius: 0.5rem;
}
.title-gradient {
    background: linear-gradient(45deg, #f97316, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
/* Larger writing area for pages 1 & 3 */
.writing-area-large {
    background-color: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 0.5rem;
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.75rem;
    min-height: 160px; /* Larger */
    line-height: 1.8;
    color: #334155;
}
/* Smaller writing area for page 2 */
.writing-area-small {
    background-color: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: 0.5rem;
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.75rem;
    min-height: 120px; /* Smaller */
    line-height: 1.8;
    color: #334155;
}
.writing-area-large:focus, .writing-area-small:focus {
    outline: none;
    border-color: #fb923c; /* orange-400 */
    box-shadow: 0 0 0 3px rgba(251, 146, 60, 0.3);
}
.final-draft-area {
    background-image:
        linear-gradient(#e2e8f0 1px, transparent 1px),
        linear-gradient(to right, #e2e8f0 1px, transparent 1px);
    background-size: 2rem 2rem;
    border: 2px solid #94a3b8;
    padding: 1rem;
    line-height: 2rem;
    letter-spacing: 0.9rem; /* To center characters in squares */
    font-size: 1.25rem;
    color: #1e293b;
    width: 100%;
    /* Reduced height to fit on one page */
    height: 520px;
}
.print-button {
    display: inline-block;
    background-color: #2563eb;
    color: white;
    font-weight: bold;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    margin-top: 20px;
    transition: background-color 0.3s;
}
.print-button:hover {
    background-color: #1d4ed8;
}

@media print {
    .no-print { display: none !important; }
    /* Individual page printing rules */
    body.printing-page1 #page2, body.printing-page1 #page3, body.printing-page1 #page4 { display: none; }
    body.printing-page2 #page1, body.printing-page2 #page3, body.printing-page2 #page4 { display: none; }
    body.printing-page3 #page1, body.printing-page3 #page2, body.printing-page3 #page4 { display: none; }
    body.printing-page4 #page1, body.printing-page4 #page2, body.printing-page4 #page3 { display: none; }
    
    /* "Print All" rules */
    body.printing-all .printable-area {
        display: block !important;
        page-break-after: always;
        border: none;
        box-shadow: none;
        margin-bottom: 2rem;
    }
    body.printing-all .printable-area:last-of-type {
        page-break-after: avoid;
    }
}
