* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.pp-page { background: #1f2a37; font-family: 'SolaimanLipi', sans-serif; color: #111; padding: 24px 12px 150px; }

.pp-stage { max-width: 794px; margin: 0 auto; }
.pp-scale { width: 794px; transform-origin: top left; }

/* ---------- paper ---------- */
.pp-paper {
    --pp-accent: #1f6f43;
    --pp-red: #c8102e;
    --pp-rule: #d9d9d9;
    width: 794px;
    background: #ffffff;
    padding: 26px 30px 18px;
    border: 2px solid var(--pp-accent);
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,.35);
}

.pp-mast { text-align: center; margin-bottom: 14px; }
.pp-mast-top { display: flex; justify-content: space-between; font-size: 13px; padding: 4px 10px; background: var(--pp-accent); color: #fff; border-radius: 3px; }
.pp-logo { padding: 12px 0 4px; }
.pp-logo img { max-height: 62px; max-width: 320px; display: inline-block; }
.pp-logo-text { font-size: 34px; font-weight: bold; }

.pp-head { text-align: center; border-top: 1px solid var(--pp-rule); padding-top: 12px; }
.pp-kicker { display: inline-block; background: var(--pp-red); color: #fff; font-size: 14px; padding: 3px 12px 2px; border-radius: 12px; margin-bottom: 8px; }
.pp-title { font-size: 30px; line-height: 1.35; font-weight: bold; margin: 0 0 6px; }
.pp-subtitle { font-size: 17px; line-height: 1.5; color: #444; margin: 0 0 6px; }
.pp-meta { font-size: 13px; color: #555; margin-bottom: 12px; }

.pp-figure { margin: 0 0 10px; }
.pp-figure img { display: block; width: 100%; height: auto; }
.pp-figure figcaption { font-size: 13px; color: #555; padding: 4px 2px 0; text-align: center; }

.pp-author { position: relative; font-weight: bold; font-size: 15px; padding: 5px 10px 4px 22px; background: #f1f3f5; border-left: 4px solid var(--pp-accent); margin-bottom: 10px; border-bottom: 1px solid var(--pp-rule); }
.pp-author::before { content: ''; position: absolute; left: 8px; top: 50%; margin-top: -5px; border: 5px solid transparent; border-left: 7px solid #333; }

/* ---------- body columns ---------- */
.pp-body {
    column-count: 3;
    column-gap: 15px;
    column-rule: 1px solid var(--pp-rule);
    text-align: justify;
    line-height: 1.5;
    font-size: 15px;
    orphans: 2;
    widows: 2;
}
.pp-cols-2 .pp-body { column-count: 2; column-gap: 20px; }
.pp-body,
.pp-body p, .pp-body div, .pp-body span, .pp-body li { font-family: 'SolaimanLipi', sans-serif !important; font-size: 15px !important; line-height: 1.5 !important; text-align: justify; }
.pp-body p, .pp-body div { margin: 0; }
.pp-body > p + p, .pp-body > div + div, .pp-body > p + div, .pp-body > div + p { text-indent: 1.2em; }
.pp-body p:empty, .pp-body div:empty { display: none; }
.pp-body img { display: block; max-width: 100%; height: auto; margin: 4px auto; break-inside: avoid; }
.pp-body iframe, .pp-body video, .pp-body audio, .pp-body script, .pp-body embed, .pp-body object { display: none !important; }
.pp-body a { color: inherit; text-decoration: none; }
.pp-body h1, .pp-body h2, .pp-body h3, .pp-body h4 { font-size: 16px; margin: 4px 0; break-after: avoid; }

/* ---------- footer ---------- */
.pp-foot { margin-top: 16px; border-top: 2px solid var(--pp-accent); padding-top: 8px; text-align: center; font-size: 13px; line-height: 1.6; }
.pp-editorial { color: var(--pp-red); font-size: 14.5px; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 18px; }
.pp-editorial b { font-weight: bold; }
.pp-contact p { margin: 2px 0; color: #333; }
.pp-contact span + span::before { content: '|'; margin: 0 8px; color: #999; }
.pp-copy { border-top: 1px solid var(--pp-rule); margin-top: 6px; padding-top: 4px; color: #333; }
.pp-dev { margin-top: 12px; padding-top: 6px; border-top: 1px dashed var(--pp-rule); font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #555; }
.pp-dev a { color: #111; font-weight: bold; text-decoration: none; }
.pp-dev a:hover { text-decoration: underline; }
.pp-dev .pp-dev-wa { margin-left: 10px; color: #128c3e; white-space: nowrap; }
.pp-dev .pp-dev-wa i { color: #25d366; }

/* ---------- classic theme ---------- */
.pp-theme-classic { --pp-accent: #111111; --pp-red: #8b0000; --pp-rule: #444; background: #fffdf6; border: 1px solid #111; border-radius: 0; }
.pp-theme-classic .pp-mast { border-top: 4px double #111; border-bottom: 4px double #111; padding: 4px 0 2px; }
.pp-theme-classic .pp-mast-top { background: transparent; color: #222; padding: 2px 0; border-radius: 0; font-style: italic; }
.pp-theme-classic .pp-head { border-top: 0; padding-top: 2px; }
.pp-theme-classic .pp-kicker { background: transparent; color: #111; border-bottom: 2px solid #111; border-radius: 0; padding: 0 2px; font-weight: bold; }
.pp-theme-classic .pp-title { font-size: 33px; letter-spacing: 0; }
.pp-theme-classic .pp-figure img { filter: grayscale(.15) contrast(1.05); border: 1px solid #111; }
.pp-theme-classic .pp-author { background: transparent; border-left: 0; border-top: 1px solid #111; border-bottom: 1px solid #111; }
.pp-theme-classic .pp-foot { border-top: 4px double #111; }

/* ---------- control dock ---------- */
.pp-dock { position: fixed; right: 18px; bottom: 18px; z-index: 50; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; max-width: calc(100vw - 24px); }
.pp-menu { background: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.3); padding: 8px 0; min-width: 190px; align-self: flex-start; }
.pp-menu[hidden] { display: none; }
.pp-menu-title { font-family: Arial, sans-serif; font-size: 11px; letter-spacing: 1px; color: #5b6b7f; padding: 8px 16px 4px; font-weight: bold; }
.pp-menu-title + .pp-menu-item { margin-top: 2px; }
.pp-menu .pp-menu-title:not(:first-child) { border-top: 1px solid #e5e7eb; margin-top: 6px; }
.pp-menu-item { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 9px 16px; font: 15px Arial, sans-serif; color: #1f2937; cursor: pointer; text-align: left; }
.pp-menu-item i { width: 18px; color: #475569; text-align: center; }
.pp-menu-item:hover { background: #f1f5f9; }
.pp-menu-item.is-active { background: #e8f0fe; color: #1a56db; font-weight: bold; }
.pp-menu-item.is-active i { color: #1a56db; }

.pp-dock-btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.pp-btn { display: inline-flex; align-items: center; gap: 7px; height: 42px; padding: 0 16px; border: 0; border-radius: 6px; color: #fff; font: 15px 'SolaimanLipi', Arial, sans-serif; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,.25); transition: filter .15s, transform .1s; }
.pp-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.pp-btn:disabled { opacity: .6; cursor: wait; transform: none; }
.pp-btn:focus-visible, .pp-menu-item:focus-visible { outline: 2px solid #93c5fd; outline-offset: 2px; }
.pp-btn-design { background: #3b82f6; }
.pp-btn-print { background: #dc2626; }
.pp-btn-dl { background: #15803d; }
.pp-btn-pdf { background: #b45309; }
.pp-btn-wa { background: #25d366; color: #063d1d; }
.pp-btn-ms { background: linear-gradient(135deg, #0695ff, #a334fa); }
.pp-msg { margin: 0; min-height: 0; font: 13px Arial, 'SolaimanLipi', sans-serif; color: #fff; background: rgba(0,0,0,.65); border-radius: 4px; padding: 0 8px; }
.pp-msg:empty { display: none; }
.pp-msg:not(:empty) { padding: 5px 10px; }

@media (max-width: 720px) {
    body.pp-page { padding: 12px 8px 130px; }
    .pp-dock { right: 8px; left: 8px; bottom: 8px; align-items: stretch; }
    .pp-dock-btns { justify-content: center; gap: 6px; }
    .pp-btn { height: 40px; padding: 0 12px; }
    .pp-btn-wa span, .pp-btn-ms span, .pp-btn-pdf span { display: none; }
}

/* ---------- print ---------- */
@page { size: A4; margin: 10mm; }
@media print {
    body.pp-page { background: #fff; padding: 0; }
    .pp-dock { display: none !important; }
    .pp-stage { max-width: none; height: auto !important; }
    .pp-scale { width: auto; transform: none !important; }
    .pp-paper { width: auto; box-shadow: none; padding: 0; border: 0; }
    .pp-paper, .pp-paper * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .pp-figure { break-inside: avoid; }
    .pp-foot { break-inside: avoid; }
    .pp-dev a { text-decoration: none; }
}
