.epaper-page {
  --library-bg: var(--pk-bg, #f6f6f6);
  --library-surface: var(--pk-surface, #fff);
  --library-text: var(--pk-text, #202020);
  --library-muted: var(--pk-muted, #606060);
  --library-line: var(--pk-line, #dedede);
  --library-accent: var(--pk-accent, #c51624);
  margin: 0;
  color: var(--library-text);
  background: var(--library-bg);
  letter-spacing: 0;
}
html[data-theme="dark"] .epaper-page {
  --library-bg: var(--pk-bg, #171717);
  --library-surface: var(--pk-surface, #222);
  --library-text: var(--pk-text, #f2f2f2);
  --library-muted: var(--pk-muted, #b9b9b9);
  --library-line: var(--pk-line, #414141);
}
.epaper-page *, .epaper-page *::before, .epaper-page *::after { box-sizing: border-box; }
.epaper-page [hidden] { display: none !important; }
/* Match the shared shell's current attribute-based markup on this page. */
.epaper-page .pk-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.epaper-page .pk-skip { position: fixed; left: 16px; top: -100px; z-index: 1000; padding: 12px; background: var(--library-surface); color: var(--library-text); }
.epaper-page .pk-skip:focus { top: 12px; }
.epaper-page [data-pk-category] { display: inline-flex; align-items: center; gap: 7px; flex: none; height: 46px; padding: 0 12px; font-size: 13px; font-weight: 700; white-space: nowrap; text-decoration: none; border: 0; border-bottom: 2px solid transparent; color: var(--library-text); background: transparent; }
.epaper-page [data-pk-category] svg { width: 16px; height: 16px; flex: none; }
.epaper-page [data-pk-category]:hover { background: var(--pk-subtle); }
.epaper-page [data-pk-category][aria-current="page"] { color: var(--library-accent); border-bottom-color: var(--library-accent); background: var(--pk-soft); }
.epaper-page .pk-category-overflow [data-pk-category] { min-height: 43px; height: auto; white-space: normal; padding: 8px; }
.epaper-page .site-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 32px; font-size: 18px; }
.epaper-page .library-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.epaper-page h1 { margin: 0; font-size: 32px; line-height: 1.35; letter-spacing: 0; }
.epaper-page h2 { margin: 0; font-size: 22px; line-height: 1.4; letter-spacing: 0; }
.epaper-page .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 8px 14px; border: 1px solid var(--library-line); border-radius: 5px; background: var(--library-surface); color: var(--library-text); font: inherit; font-size: 16px; font-weight: 700; line-height: 1.4; cursor: pointer; text-decoration: none; white-space: normal; box-shadow: none; overflow-wrap: anywhere; }
.epaper-page .btn.primary { background: var(--library-accent); border-color: var(--library-accent); color: var(--pk-on-accent, #fff); }
html[data-theme="dark"] .epaper-page .btn.primary { color: var(--pk-on-accent, #17191b); }
.epaper-page .btn:hover { filter: brightness(.94); }
.epaper-page .btn:disabled { opacity: .55; cursor: default; }
.epaper-page :is(button, input, select, [role="button"]):focus-visible { outline: 3px solid var(--library-accent); outline-offset: 3px; }
.epaper-page .finder { display: grid; grid-template-columns: 180px minmax(160px, 1fr) minmax(220px, 2fr) auto; align-items: end; gap: 12px; padding: 16px 0; border-top: 1px solid var(--library-line); border-bottom: 1px solid var(--library-line); }
.epaper-page .field { display: grid; gap: 6px; min-width: 0; }
.epaper-page .field label { font-size: 14px; font-weight: 700; color: var(--library-text); }
.epaper-page .control { display: block; width: 100%; min-width: 0; height: 42px; padding: 8px 10px; border: 1px solid var(--library-line); border-radius: 5px; font: inherit; font-size: 16px; color: var(--library-text); background: var(--library-surface); }
.epaper-page .control::placeholder { color: var(--library-muted); opacity: 1; }
.epaper-page .section-head { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 20px 0 12px; }
.epaper-page #resultSummary { margin: 0; color: var(--library-muted); font-size: 14px; }
.epaper-page .archive-layout { display: block; }
.epaper-page .grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.epaper-page .issue-card { min-width: 0; overflow: hidden; border: 1px solid var(--library-line); border-radius: 6px; background: var(--library-surface); box-shadow: none; }
.epaper-page .issue-cover-wrap { padding: 0; }
.epaper-page .issue-cover { position: relative; display: grid; place-items: center; height: 154px; padding: 16px; cursor: pointer; border-bottom: 1px solid var(--library-line); background: var(--library-bg); }
.epaper-page .epaper-icon-fallback { display: grid; place-items: center; gap: 4px; width: 100%; }
.epaper-page .epaper-paper-icon { display: grid; gap: 7px; width: 150px; height: 112px; padding: 12px; background: #fff; border: 1px solid #ccc; border-radius: 2px; box-shadow: 3px 3px 0 #ddd; }
.epaper-page .epaper-paper-icon img { display: block; width: 124px; height: 25px; object-fit: contain; }
.epaper-page .epaper-icon-mast, .epaper-page .epaper-icon-edition, .epaper-page .epaper-icon-date { display: none; }
.epaper-page .epaper-icon-headline { height: 7px; background: #444; }
.epaper-page .epaper-icon-line { height: 4px; background: #aaa; }
.epaper-page .epaper-icon-line.short { width: 66%; }
.epaper-page .status-badge { position: absolute; top: 10px; left: 10px; color: var(--library-accent); font-size: 14px; font-weight: 700; }
.epaper-page .read-hint { position: absolute; right: 10px; bottom: 10px; color: var(--library-muted); font-size: 14px; }
.epaper-page .issue-body { padding: 14px; }
.epaper-page .issue-body h3 { margin: 0 0 4px; font-size: 22px; line-height: 1.4; overflow-wrap: anywhere; letter-spacing: 0; }
.epaper-page .issue-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.epaper-page .issue-meta .pill { display: inline; padding: 0; border: 0; background: none; color: var(--library-muted); font-size: 14px; font-weight: 400; }
.epaper-page .issue-body .muted { margin: 8px 0; color: var(--library-muted); font-size: 18px; line-height: 1.6; overflow-wrap: anywhere; }
.epaper-page .issue-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.epaper-page .empty { grid-column: 1 / -1; padding: 32px 16px; margin: 0; text-align: center; color: var(--library-muted); font-size: 18px; line-height: 1.6; overflow-wrap: anywhere; }
.epaper-page .load-more-wrap { display: flex; justify-content: center; margin: 20px 0; }
.epaper-page .library-ad { width: min(100%, 728px); min-height: 100px; margin: 28px auto 0; padding: 12px; border: 1px solid var(--library-line); border-radius: 0; background: var(--library-surface); color: var(--library-muted); text-align: center; font-size: 14px; }
.epaper-page.reader-open { overflow: hidden; }
.epaper-page .reader-modal { position: fixed; inset: 0; z-index: 1000; display: none; padding: 16px; background: rgba(0,0,0,.7); }
.epaper-page .reader-modal.open { display: grid; place-items: center; }
.epaper-page .reader-shell { display: grid; grid-template-rows: auto minmax(0,1fr); width: min(1440px,100%); height: calc(100dvh - 32px); overflow: hidden; border-radius: 6px; background: var(--library-surface); color: var(--library-text); }
.epaper-page .reader-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--library-line); }
.epaper-page .reader-title { display: grid; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.epaper-page .reader-title strong { font-size: 20px; }
.epaper-page .reader-title span { color: var(--library-muted); font-size: 14px; }
.epaper-page .reader-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.epaper-page .reader-body { position: relative; min-height: 0; }
.epaper-page .reader-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.epaper-page .reader-loading { position: absolute; inset: 0; display: grid; place-items: center; background: var(--library-surface); color: var(--library-muted); font-size: 18px; }
.epaper-page .reader-loading.hidden { display: none; }
.epaper-page .toast { position: fixed; left: 50%; bottom: 24px; z-index: 1100; transform: translateX(-50%); max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 6px; color: var(--library-text); background: var(--library-surface); border: 1px solid var(--library-line); opacity: 0; pointer-events: none; }
.epaper-page .toast.show { opacity: 1; }
@media (max-width: 900px) {
  .epaper-page .grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .epaper-page .finder { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 540px) {
  .epaper-page [data-pk-category] { height: 42px; padding-inline: 10px; gap: 5px; font-size: 12px; }
  .epaper-page .site-shell { width: calc(100% - 24px); padding-top: 16px; }
  .epaper-page .library-heading { flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
  .epaper-page h1 { font-size: 28px; }
  .epaper-page .library-heading .btn { font-size: 16px; min-height: 36px; }
  .epaper-page .finder { gap: 10px; padding: 12px 0; }
  .epaper-page .grid { grid-template-columns: minmax(0,1fr); gap: 12px; }
  .epaper-page .issue-card { display: grid; grid-template-columns: 112px minmax(0,1fr); }
  .epaper-page .issue-cover { height: 100%; min-height: 154px; padding: 28px 8px; border-bottom: 0; border-right: 1px solid var(--library-line); }
  .epaper-page .epaper-paper-icon { width: 88px; height: 92px; padding: 8px; gap: 6px; }
  .epaper-page .epaper-paper-icon img { width: 70px; height: 18px; }
  .epaper-page .issue-body { padding: 12px; }
  .epaper-page .issue-body h3 { font-size: 20px; }
  .epaper-page .issue-actions { gap: 6px; }
  .epaper-page .issue-actions .btn { padding: 8px; min-height: 38px; font-size: 16px; }
  .epaper-page .reader-modal { padding: 6px; }
  .epaper-page .reader-shell { height: calc(100dvh - 12px); }
  .epaper-page .reader-head { flex-wrap: wrap; padding: 10px; }
}
