.pst { padding: 22px 0 10px; }
.pst-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 22px; align-items: start; }
.pst label, .pst .pst-lbl { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.pst input, .pst select, .pst textarea { width: 100%; font: inherit; font-size: 15px; border: 1px solid #ddd6cb; border-radius: 10px; padding: 8px 10px; background: #fff; color: var(--text); min-height: 42px; box-sizing: border-box; }
.pst textarea { min-height: 64px; resize: vertical; }
.pst input:focus, .pst select:focus, .pst textarea:focus { outline: 3px solid rgba(245, 158, 11, .35); border-color: var(--gold); }
.pst input[type=color] { padding: 3px; height: 42px; }
.pst input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: #d97706; }
.pst-sec { border: 1px solid var(--line); border-radius: 14px; background: var(--card); margin-bottom: 12px; padding: 0 16px; }
.pst-sec > summary { cursor: pointer; font-weight: 800; padding: 14px 0; display: flex; align-items: center; gap: 10px; list-style: none; }
.pst-sec > summary::-webkit-details-marker { display: none; }
.pst-sec > summary .pst-n { width: 24px; height: 24px; border-radius: 50%; background: var(--gold); color: #1f1d1a; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.pst-sec > summary .pst-s { margin-left: auto; color: var(--muted); font-weight: 600; font-size: 13px; }
.pst-sec > summary::after { content: "▾"; color: var(--muted); }
.pst-sec[open] > summary::after { content: "▴"; }
.pst-in { padding: 0 0 16px; }
.pst-g2, .pst-g3, .pst-g4 { display: grid; gap: 10px; }
.pst-g2 { grid-template-columns: 1fr 1fr; }
.pst-g3 { grid-template-columns: repeat(3, 1fr); }
.pst-g4 { grid-template-columns: repeat(4, 1fr); }
.pst-g2 > *, .pst-g3 > *, .pst-g4 > * { min-width: 0; }
.pst-mt { margin-top: 10px; }
.pst-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.pst-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.pst-seg button { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; color: var(--text); }
.pst-seg button[aria-pressed="true"] { border-color: var(--gold); background: var(--gold-soft); }
.pst-tpls { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.pst-tpls button { border: 2px solid var(--line); border-radius: 12px; background: #fff; padding: 6px; cursor: pointer; font: inherit; font-weight: 800; font-size: 12px; text-align: center; min-width: 0; }
.pst-tpls button[aria-pressed="true"] { border-color: var(--gold); box-shadow: 0 6px 16px rgba(245, 158, 11, .25); }
.pst-tpls i { display: block; height: 40px; border-radius: 6px; margin-bottom: 5px; border: 1px solid #eee; }
.pst-tpls .pst-i1 { background: linear-gradient(#fff 0 8px, #111 8px 13px, #fff 13px 18px, #f3f4f6 18px 23px, #fff 23px 28px, #f3f4f6 28px); }
.pst-tpls .pst-i2 { background: linear-gradient(var(--acc, #0f766e) 0 14px, #fff 14px 30px, var(--acc, #0f766e) 30px); }
.pst-tpls .pst-i3 { background: linear-gradient(90deg, #eef2ff 0 47%, #fff 47% 53%, #eef2ff 53%); }
.pst-tpls .pst-i4 { background: repeating-linear-gradient(#fff 0 8px, #d1d5db 8px 9px); }
.pst-tpls .pst-i5 { background: linear-gradient(#e5e7eb 0 8px, #fff 8px 20px, #e5e7eb 20px 26px, #fff 26px); outline: 1px solid #9ca3af; outline-offset: -3px; }
.pst-toggles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.pst-toggles label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); font-weight: 600; margin: 0; cursor: pointer; }
.pst-rows { display: flex; flex-direction: column; gap: 8px; }
.pst-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 110px 36px; gap: 8px; align-items: center; }
.pst-row.pst-e { grid-template-columns: minmax(0, 1fr) 66px 84px 104px 104px 36px; }
.pst-rhead { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.pst-x { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--muted); font-size: 15px; display: inline-flex; align-items: center; justify-content: center; }
.pst-x:hover { color: #b42318; border-color: #f0c4be; }
.pst-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pst-chips button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 12.5px; cursor: pointer; color: var(--muted); }
.pst-chips button:hover { border-color: var(--gold); color: var(--text); }
.pst-chips .pst-auto { border-color: #d9c8a5; background: var(--gold-soft); color: var(--gold-text); font-weight: 800; }
.pst-upl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pst-upl img { width: 42px; height: 42px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.pst-upl .pst-ph { width: 42px; height: 42px; border: 1px dashed #cfc6b8; border-radius: 8px; display: flex; align-items: center; justify-content: center; color: #a9a196; font-size: 12px; flex: none; }
.pst .pst-upbtn { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid #ddd6cb; border-radius: 10px; background: var(--soft); font-weight: 700; font-size: 14px; color: var(--text); cursor: pointer; margin: 0; white-space: nowrap; font-family: inherit; }
.pst .pst-upbtn[hidden] { display: none; }
.pst-warn { margin-top: 10px; border: 1px solid #f3d9a4; background: #fff8e8; border-radius: 10px; padding: 9px 12px; font-size: 13px; color: #6b4e12; }
.pst-side { position: sticky; top: 12px; }
.pst-pv { background: #e9e6e0; border-radius: 16px; padding: 14px; }
.pst-pvbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 12.5px; font-weight: 800; color: var(--muted); letter-spacing: .4px; }
.pst-pvwrap { overflow: hidden; border-radius: 4px; }
.pst-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pst-acts .btn { padding: 10px 14px; font-size: 14px; }
.pst-acts .btn.soft { color: var(--text); }
.pst-msg { min-height: 20px; font-size: 13px; font-weight: 700; color: var(--ok); margin-top: 8px; }
.pst-msg.pst-err { color: #b42318; }
.pst-saved { margin-top: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 12px 14px; }
.pst-saved .pst-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; max-height: 220px; overflow: auto; }
.pst-saved .pst-it { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; font-size: 14px; }
.pst-saved .pst-it span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pst-saved .pst-it button { border: 1px solid var(--line); background: var(--soft); border-radius: 8px; padding: 4px 9px; font: inherit; font-size: 12.5px; cursor: pointer; }
.pst-empty { color: var(--muted); font-size: 13px; }
.pst-mbar { display: none; }

/* ===== the stub paper ===== */
.pst-paper { --acc: #0f766e; width: 816px; min-height: 1056px; background: #fff; color: #1f2937; font: 13px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; padding: 44px 48px 36px; position: relative; transform-origin: top left; box-shadow: 0 1px 3px rgba(0,0,0,.08); box-sizing: border-box; }
.pst-paper.pst-a4 { width: 794px; min-height: 1123px; }
.pst-paper * { box-sizing: border-box; }
.pst-paper table { width: 100%; border-collapse: collapse; }
.pst-paper td, .pst-paper th { padding: 6px 8px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.pst-paper .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pst-paper .mu { color: #6b7280; }
.pst-paper .b { font-weight: 800; }
.pst-co { display: flex; gap: 14px; align-items: flex-start; min-width: 0; }
.pst-co img { max-width: 110px; max-height: 60px; object-fit: contain; }
.pst-co .nm { font-size: 19px; font-weight: 900; line-height: 1.2; overflow-wrap: anywhere; }
.pst-co .ad { font-size: 12px; color: #6b7280; white-space: pre-line; overflow-wrap: anywhere; }
.pst-kv { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 28px; }
.pst-kv div { display: flex; gap: 6px; font-size: 12.5px; min-width: 0; }
.pst-kv span { color: #6b7280; flex: none; }
.pst-kv b { overflow-wrap: anywhere; }
.pst-notes { margin-top: 16px; border: 1px solid #e5e7eb; border-radius: 8px; padding: 9px 12px; font-size: 12px; white-space: pre-line; overflow-wrap: anywhere; }
.pst-foot { margin-top: 26px; text-align: center; font-size: 10.5px; color: #9ca3af; }
/* A — classic */
.pst-t-classic .pst-top { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid #111; padding-bottom: 12px; }
.pst-t-classic .pst-tt { font-size: 21px; font-weight: 900; letter-spacing: 1px; text-align: right; }
.pst-t-classic .pst-kv { margin: 14px 0; }
.pst-t-classic th { background: #111; color: #fff; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; }
.pst-t-classic tbody tr:nth-child(even) td { background: #f3f4f6; }
.pst-t-classic table + table { margin-top: 12px; }
.pst-t-classic .pst-netw { margin-top: 14px; display: flex; justify-content: flex-end; gap: 14px; align-items: stretch; }
.pst-t-classic .pst-netw div { border: 2px solid #111; padding: 10px 16px; font-size: 17px; font-weight: 900; }
.pst-t-classic .pst-netw .pst-ytdn { font-size: 13px; font-weight: 700; border-color: #d1d5db; }
/* B — modern */
.pst-t-modern { padding-top: 0; }
.pst-t-modern .pst-head { margin: 0 -48px; padding: 24px 48px; background: var(--acc); color: var(--acc-ink, #fff); display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.pst-t-modern .pst-head .ad { color: var(--acc-ink2, rgba(255,255,255,.85)); }
.pst-t-modern .pst-head .pst-tt { font-size: 18px; font-weight: 900; text-align: right; }
.pst-t-modern .pst-chipsum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0; }
.pst-t-modern .pst-chipsum div { background: var(--acc-tint, #f0fdfa); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.pst-t-modern .pst-chipsum small { display: block; color: var(--acc-txt, #0f766e); font-weight: 800; font-size: 10.5px; text-transform: uppercase; }
.pst-t-modern .pst-chipsum b { overflow-wrap: anywhere; }
.pst-t-modern h4 { margin: 14px 0 4px; color: var(--acc-txt, #0f766e); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.pst-t-modern td { border-bottom: 1px solid #e5e7eb; }
.pst-t-modern .pst-kv { margin-bottom: 4px; }
.pst-t-modern .pst-net { margin-top: 16px; background: var(--acc); color: var(--acc-ink, #fff); border-radius: 12px; padding: 14px 18px; display: flex; justify-content: space-between; font-size: 18px; font-weight: 900; }
/* C — side by side */
.pst-t-split .pst-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.pst-t-split .nm { color: var(--acc-txt, #1e3a8a); }
.pst-t-split .pst-tt { background: var(--acc-txt, #1e3a8a); color: #fff; padding: 6px 12px; border-radius: 6px; font-weight: 800; white-space: nowrap; }
.pst-t-split .pst-info { margin: 14px 0; padding: 10px 12px; border: 1px solid var(--acc-line, #c7d2fe); border-radius: 8px; }
.pst-t-split .pst-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.pst-t-split .pst-box { border: 1px solid var(--acc-line, #c7d2fe); border-radius: 8px; overflow: hidden; }
.pst-t-split .pst-box h4 { margin: 0; background: var(--acc-tint, #eef2ff); color: var(--acc-txt, #1e3a8a); padding: 7px 10px; font-size: 12px; }
.pst-t-split .pst-tot td { border-top: 2px solid var(--acc-txt, #1e3a8a); font-weight: 800; }
.pst-t-split .pst-sum { margin-top: 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; }
.pst-t-split .pst-sum div { border-radius: 8px; padding: 10px; background: var(--acc-tint, #eef2ff); }
.pst-t-split .pst-sum .pst-nn { background: var(--acc-txt, #1e3a8a); color: #fff; }
.pst-t-split .pst-sum b { display: block; font-size: 16px; }
/* D — minimal */
.pst-t-minimal { font-family: Georgia, "Times New Roman", serif; color: #111; }
.pst-t-minimal .pst-ctr { text-align: center; }
.pst-t-minimal .pst-ctr .nm { font-size: 21px; letter-spacing: 1px; font-weight: 700; }
.pst-t-minimal .pst-ctr img { max-height: 54px; max-width: 120px; object-fit: contain; display: block; margin: 0 auto 6px; }
.pst-t-minimal .pst-tt { text-align: center; border-top: 1px solid #111; border-bottom: 1px solid #111; padding: 6px; letter-spacing: 3px; font-weight: 700; margin-top: 12px; }
.pst-t-minimal .pst-kv { margin: 12px 0; }
.pst-t-minimal th { border-bottom: 1px solid #111; font-weight: 700; }
.pst-t-minimal .pst-net { margin-top: 12px; border-top: 3px double #111; padding-top: 8px; display: flex; justify-content: space-between; font-size: 17px; font-weight: 700; }
/* E — statement */
.pst-t-statement .pst-top { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.pst-t-statement .pst-tt { font-size: 15px; font-weight: 900; letter-spacing: 1px; border: 2px solid #374151; padding: 6px 12px; text-align: right; }
.pst-t-statement .pst-tt small { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0; color: #6b7280; }
.pst-t-statement .pst-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.pst-t-statement .pst-bx { border: 1px solid #9ca3af; }
.pst-t-statement .pst-bx h4, .pst-t-statement .pst-bh { margin: 0; background: #e5e7eb; padding: 5px 10px; font-size: 11px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: #374151; }
.pst-t-statement .pst-bx .pst-bi { padding: 8px 10px; font-size: 12.5px; }
.pst-t-statement .pst-bx .pst-bi div { display: flex; justify-content: space-between; gap: 10px; }
.pst-t-statement .pst-bx .pst-bi span { color: #6b7280; }
.pst-t-statement table { border: 1px solid #9ca3af; }
.pst-t-statement th { background: #f3f4f6; font-size: 11px; text-transform: uppercase; border-bottom: 1px solid #9ca3af; }
.pst-t-statement td { border-bottom: 1px solid #e5e7eb; }
.pst-t-statement .pst-band td { background: #e5e7eb; font-weight: 800; font-size: 11px; letter-spacing: .6px; text-transform: uppercase; color: #374151; }
.pst-t-statement .pst-net td { background: var(--acc-tint, #ecfdf5); font-size: 15px; font-weight: 900; border-top: 2px solid #374151; }

@media (max-width: 960px) {
  .pst-grid { grid-template-columns: minmax(0, 1fr); }
  .pst-side { position: static; }
  .pst-mbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #1f1d1a; color: #fff; padding: 10px 16px; align-items: center; gap: 12px; box-shadow: 0 -6px 20px rgba(0,0,0,.2); }
  .pst-mbar small { opacity: .75; display: block; font-size: 11.5px; }
  .pst-mbar b { font-size: 18px; color: var(--gold-hi); }
  .pst-mbar .btn { margin-left: auto; padding: 9px 14px; font-size: 14px; }
  body { padding-bottom: 64px; }
}
@media (max-width: 600px) {
  .pst-g3, .pst-g4 { grid-template-columns: 1fr 1fr; }
  .pst-tpls { grid-template-columns: repeat(3, 1fr); }
  .pst-toggles { grid-template-columns: 1fr; }
  .pst-sec { padding: 0 12px; }
  .pst-row, .pst-row.pst-e { grid-template-columns: 1fr 1fr 36px; }
  .pst-row .pst-nm { grid-column: 1 / -1; }
  .pst-rhead { display: none !important; }
}
@media print {
  @page { margin: 0; }
  body { padding: 0 !important; background: #fff; }
  body > *:not(main), main > *:not(.pst), .pst-form, .pst-pvbar, .pst-acts, .pst-msg, .pst-saved, .pst-mbar, .pagehead { display: none !important; }
  .pst, .pst-grid, .pst-side, .pst-pv, .pst-pvwrap { display: block !important; padding: 0 !important; margin: 0 !important; background: #fff !important; overflow: visible !important; height: auto !important; }
  .pst-paper { transform: none !important; box-shadow: none; margin: 0 auto; }
  .pst-paper, .pst-paper * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
/* html2canvas measures text with a hidden div on <body>; site.css makes img a block */
body > div[style*="hidden"] > img { display: inline !important; }
