.hdp-wrap{--hdp-bg:#fff;--hdp-fg:#1f2937;--hdp-bar:#f3f4f6;--hdp-bd:#e5e7eb;
	position:relative;display:flex;flex-direction:column;margin:1.5em 0;border:1px solid var(--hdp-bd);border-radius:14px;overflow:hidden;
	background:var(--hdp-bg);color:var(--hdp-fg);box-shadow:0 6px 24px rgba(0,0,0,.08);box-sizing:border-box;max-width:100%}
.hdp-wrap *{box-sizing:border-box}
.hdp-wrap[data-theme="dark"]{--hdp-bg:#111827;--hdp-fg:#f3f4f6;--hdp-bar:#1f2937;--hdp-bd:#374151}
@media (prefers-color-scheme:dark){.hdp-wrap[data-theme="auto"]{--hdp-bg:#111827;--hdp-fg:#f3f4f6;--hdp-bar:#1f2937;--hdp-bd:#374151}}

.hdp-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;padding:10px 14px;background:var(--hdp-bar);border-bottom:1px solid var(--hdp-bd)}
.hdp-title{display:flex;align-items:center;gap:8px;font-weight:700;font-size:16px;min-width:0;flex:1 1 200px}
.hdp-ico{color:var(--hdp-accent);display:flex}
.hdp-title-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hdp-actions{display:flex;gap:8px;flex-wrap:wrap}
.hdp-btn{display:inline-flex;align-items:center;gap:6px;padding:7px 12px;border-radius:8px;border:1px solid var(--hdp-bd);background:var(--hdp-bg);color:var(--hdp-fg)!important;
	font-size:13px;font-weight:600;line-height:1;text-decoration:none!important;cursor:pointer;transition:.15s}
.hdp-btn:hover{background:var(--hdp-accent);border-color:var(--hdp-accent);color:#fff!important}

.hdp-stage{position:relative;height:var(--hdp-h);background:#525659}
.hdp-frame{position:absolute;inset:0;width:100%;height:100%;border:0;background:#fff}
.hdp-frame[hidden],.hdp-loader[hidden],.hdp-cover[hidden]{display:none!important}

.hdp-cover{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;text-align:center;
	background:linear-gradient(135deg,var(--hdp-accent),#111827) center/cover no-repeat;z-index:2}
.hdp-cover::before{content:"";position:absolute;inset:0;background:rgba(0,0,0,.45)}
.hdp-cover-in{position:relative;padding:20px;color:#fff;max-width:90%}
.hdp-cover-ico{display:inline-flex;width:64px;height:64px;align-items:center;justify-content:center;border-radius:50%;background:rgba(255,255,255,.18);margin-bottom:12px}
.hdp-cover-ico svg{width:30px;height:30px}
.hdp-cover-title{font-size:clamp(18px,3.5vw,28px);font-weight:800;margin-bottom:16px;text-shadow:0 2px 8px rgba(0,0,0,.4)}
.hdp-read{border:0;border-radius:999px;padding:12px 28px;font-size:16px;font-weight:700;background:#fff;color:var(--hdp-accent);cursor:pointer;box-shadow:0 6px 18px rgba(0,0,0,.3);transition:transform .15s}
.hdp-read:hover{transform:scale(1.05)}

.hdp-loader{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;z-index:1;background:#525659}
.hdp-loader span{width:42px;height:42px;border:4px solid rgba(255,255,255,.3);border-top-color:#fff;border-radius:50%;animation:hdpspin .8s linear infinite}
@keyframes hdpspin{to{transform:rotate(360deg)}}

.hdp-foot{padding:8px 14px;font-size:12px;text-align:center;background:var(--hdp-bar);border-top:1px solid var(--hdp-bd);color:var(--hdp-fg);opacity:.85}
.hdp-foot a{color:var(--hdp-accent);font-weight:600}

/* Fullscreen (API + iPhone fallback) */
.hdp-wrap.hdp-is-full{position:fixed;inset:0;z-index:999999;margin:0;border-radius:0;height:100vh;height:100dvh;max-width:none;width:100%}
.hdp-wrap.hdp-is-full .hdp-stage{flex:1;height:auto}
.hdp-wrap:fullscreen{border-radius:0;margin:0;height:100%}
.hdp-wrap:fullscreen .hdp-stage{flex:1;height:auto}
html.hdp-lock,html.hdp-lock body{overflow:hidden!important}

.hdp-notice{padding:12px;border:1px dashed #c00;color:#c00;border-radius:8px}

@media (max-width:640px){
	.hdp-stage{height:var(--hdp-hm)}
	.hdp-wrap{border-radius:10px;margin:1em 0}
	.hdp-btn span{display:none}
	.hdp-btn{padding:9px 11px}
	.hdp-head{padding:8px 10px}
}

/* ---------- PDF.js reader ---------- */
.hdp-viewer{position:absolute;inset:0;display:flex;flex-direction:column;background:#525659;z-index:1}
.hdp-viewer[hidden]{display:none!important}
.hdp-tools{display:flex;align-items:center;justify-content:center;gap:6px;flex-wrap:wrap;padding:6px 10px;background:var(--hdp-bar);border-bottom:1px solid var(--hdp-bd);color:var(--hdp-fg)}
.hdp-t{min-width:36px;height:34px;padding:0 10px;border:1px solid var(--hdp-bd);border-radius:8px;background:var(--hdp-bg);color:var(--hdp-fg);font-size:18px;line-height:1;cursor:pointer;transition:.15s}
.hdp-t:hover{background:var(--hdp-accent);border-color:var(--hdp-accent);color:#fff}
.hdp-zfit{font-size:13px;font-weight:700;min-width:58px}
.hdp-pg{display:inline-flex;align-items:center;gap:5px;font-size:14px;font-weight:600}
.hdp-cur{width:56px;height:34px;padding:0 4px;text-align:center;border:1px solid var(--hdp-bd);border-radius:8px;background:var(--hdp-bg);color:var(--hdp-fg);font-size:14px;-moz-appearance:textfield}
.hdp-cur::-webkit-outer-spin-button,.hdp-cur::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.hdp-sep{width:1px;height:22px;background:var(--hdp-bd);margin:0 2px}
.hdp-prog{height:3px;background:rgba(0,0,0,.15)}
.hdp-prog i{display:block;height:100%;width:0;background:var(--hdp-accent);transition:width .2s}

.hdp-scroll{position:relative;flex:1;overflow:auto;-webkit-overflow-scrolling:touch;outline:0;background:#525659}
.hdp-pages{display:flex;flex-direction:column;align-items:center;gap:12px;width:max-content;min-width:100%;padding:12px 0}
.hdp-page{background:#fff;box-shadow:0 2px 10px rgba(0,0,0,.35);flex:none;overflow:hidden;position:relative}
.hdp-page canvas{display:block}
.hdp-night-on .hdp-page canvas{filter:invert(1) hue-rotate(180deg)}
.hdp-night-on .hdp-page{background:#1b1b1b}
.hdp-night-on .hdp-scroll,.hdp-night-on .hdp-viewer{background:#111}

.hdp-error{position:absolute;left:50%;top:40%;transform:translateX(-50%);padding:14px 18px;border-radius:10px;background:#fff;color:#b91c1c;text-align:center;font-weight:600;max-width:90%}
.hdp-error a{color:var(--hdp-accent);margin-left:4px}
.hdp-pct{position:absolute;margin-top:78px;color:#fff;font-style:normal;font-weight:700;font-size:14px}

@media (max-width:640px){
	.hdp-t{min-width:34px;padding:0 8px}
	.hdp-sep{display:none}
	.hdp-tools{gap:5px;padding:6px}
}
