/* Public Mood — ePaper PDF reader */
.ep-bar { background: #fff; border-bottom: 1px solid var(--line); }
.ep-choose summary { cursor: pointer; padding: 10px 0; font-weight: 600; color: var(--brand); list-style: none; }
.ep-choose summary::-webkit-details-marker { display: none; }
.ep-choose summary::before { content: '▸ '; }
.ep-choose[open] summary::before { content: '▾ '; }
.ep-picker-wrap { padding: 4px 0 16px; }

.ep-app { max-width: 1400px; margin: 0 auto; padding: 16px; }
.ep-state { min-height: 50vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; color: var(--muted); }
.ep-progress { width: min(320px, 80vw); height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.ep-progress > i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .2s; }

/* ---------- missing edition ---------- */
.ep-missing { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; max-width: 860px; margin: 24px auto; }
.ep-missing h1 { margin: 0 0 4px; font-size: 24px; color: var(--danger); }
.ep-missing .sub { color: var(--muted); margin: 0 0 20px; }
.ep-missing h3 { font-size: 15px; margin: 22px 0 10px; }
.ep-missing .latest { display: flex; gap: 16px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); }

/* ---------- reader shell ---------- */
.rd { background: #3a3f47; border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; height: calc(100vh - 140px); min-height: 480px; position: relative; }
.rd.is-fs, .rd.pseudo-fs { border-radius: 0; height: 100vh; height: 100dvh; }
.rd.pseudo-fs { position: fixed; inset: 0; z-index: 1000; }
.rd-head { background: var(--brand); color: #fff; padding: 8px 14px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rd-head h1 { font-size: 16px; margin: 0; font-weight: 700; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rd-head .meta { font-size: 13px; color: #cfe3dd; }
.rd-preview { background: var(--accent); color: #1b1f1e; padding: 6px 14px; font-size: 13px; font-weight: 700; }

.rd-tools { display: flex; align-items: center; gap: 4px; padding: 6px 8px; background: #fff; border-bottom: 1px solid var(--line); flex-wrap: wrap; justify-content: center; }
.rd-tools .grp { display: flex; align-items: center; gap: 2px; padding: 0 6px; border-right: 1px solid var(--line); }
.rd-tools .grp:last-child { border-right: 0; }
.tb { width: 38px; height: 38px; border: 0; background: transparent; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); }
.tb:hover:not(:disabled) { background: var(--brand-tint); color: var(--brand); }
.tb.on { background: var(--brand); color: #fff; }
.tb:disabled { opacity: .35; cursor: default; }
.tb svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tb-text { width: auto; padding: 0 10px; font-size: 13px; font-weight: 700; }
.pg-input { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.pg-input input { width: 52px; text-align: center; border: 1px solid var(--line); border-radius: 6px; height: 32px; font-weight: 700; }
.pg-input select { height: 32px; border: 1px solid var(--line); border-radius: 6px; max-width: 120px; }
.zoom-val { min-width: 54px; text-align: center; font-size: 13px; font-weight: 700; }

.rd-body { flex: 1; display: flex; min-height: 0; position: relative; }
.rd-side { width: 168px; flex: 0 0 168px; background: #2a2e35; overflow-y: auto; padding: 12px 10px; display: flex; flex-direction: column; gap: 12px; }
.rd-side[hidden] { display: none; }
.th { display: block; border: 0; padding: 0; background: none; cursor: pointer; text-align: center; color: #cfd8d6; font-size: 12px; }
.th .im { background: #fff; width: 100%; aspect-ratio: var(--ar, .707); display: flex; align-items: center; justify-content: center; outline: 3px solid transparent; border-radius: 2px; overflow: hidden; }
.th img, .th canvas { width: 100%; height: 100%; display: block; }
.th.cur .im { outline-color: var(--accent); }
.th.cur { color: #fff; font-weight: 700; }

.rd-scroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-x pan-y; position: relative; outline: none; }
.rd-pages { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 16px; width: max-content; min-width: 100%; transform-origin: 0 0; }
.pg { background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.35); position: relative; flex: 0 0 auto; }
.pg canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pg .pg-load { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.pg .pg-num { position: absolute; left: 50%; bottom: -14px; transform: translate(-50%, 100%); font-size: 12px; color: #cfd8d6; }

/* page grid overlay */
.rd-grid { position: absolute; inset: 0; background: rgba(30,36,35,.97); z-index: 5; overflow: auto; padding: 20px; }
.rd-grid[hidden] { display: none; }
.rd-grid-head { display: flex; justify-content: space-between; align-items: center; color: #fff; margin-bottom: 14px; }
.rd-grid-head h2 { margin: 0; font-size: 18px; }
.rd-grid-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; }

.rd-err { color: #fff; padding: 40px 20px; text-align: center; margin: auto; }
.rd-toast { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); background: rgba(0,0,0,.75); color: #fff; padding: 6px 14px; border-radius: 999px; font-size: 13px; pointer-events: none; opacity: 0; transition: opacity .25s; z-index: 6; }
.rd-toast.show { opacity: 1; }

@media (max-width: 900px) {
  .rd-side { position: absolute; left: 0; top: 0; bottom: 0; z-index: 4; box-shadow: 4px 0 18px rgba(0,0,0,.4); }
}
@media (max-width: 640px) {
  .ep-app { padding: 0; }
  .rd { border-radius: 0; height: calc(100vh - 96px); height: calc(100dvh - 96px); }
  .ep-choose summary { padding: 8px 0; font-size: 14px; }
  .rd-tools .grp { padding: 0 2px; }
  .tb { width: 36px; height: 36px; }
  .hide-sm { display: none !important; }
  .rd-pages { padding: 10px 6px; gap: 12px; }
  .rd-head .meta { display: none; }
}
body.reader-page .site-footer { margin-top: 16px; }

/* ---------- Clip tool ---------- */
.tb.tb-pdf { width: auto; padding: 0 12px; gap: 6px; background: #053CA0; color: #fff; font-weight: 700; font-size: 14px; text-decoration: none; }
.tb.tb-pdf:hover { background: #032A72; color: #fff; }
.tb.tb-clip { width: auto; padding: 0 12px; gap: 6px; background: #d92d20; color: #fff; font-weight: 700; font-size: 14px; }
.tb.tb-clip:hover:not(:disabled) { background: #b42318; color: #fff; }
.tb.tb-clip.on { background: #fff; color: #d92d20; box-shadow: inset 0 0 0 2px #d92d20; }
.rd.clipping .pg { cursor: crosshair; user-select: none; -webkit-user-select: none; }
.clip-box { position: absolute; z-index: 3; border: 2px dashed #fff; outline: 2px solid #2f6fdd; box-shadow: 0 0 0 99999px rgba(0,0,0,.5); cursor: move; touch-action: none; }
.clip-box.drawing .clip-bar { display: none; }
.clip-h { position: absolute; width: 16px; height: 16px; background: #2f6fdd; border: 2px solid #fff; border-radius: 3px; touch-action: none; }
.clip-h.h-nw { left: -9px; top: -9px; cursor: nwse-resize; }
.clip-h.h-n  { left: calc(50% - 8px); top: -9px; cursor: ns-resize; }
.clip-h.h-ne { right: -9px; top: -9px; cursor: nesw-resize; }
.clip-h.h-e  { right: -9px; top: calc(50% - 8px); cursor: ew-resize; }
.clip-h.h-se { right: -9px; bottom: -9px; cursor: nwse-resize; }
.clip-h.h-s  { left: calc(50% - 8px); bottom: -9px; cursor: ns-resize; }
.clip-h.h-sw { left: -9px; bottom: -9px; cursor: nesw-resize; }
.clip-h.h-w  { left: -9px; top: calc(50% - 8px); cursor: ew-resize; }
@media (pointer: coarse) { .clip-h { width: 24px; height: 24px; } .clip-h.h-nw, .clip-h.h-sw, .clip-h.h-w { left: -13px; } .clip-h.h-ne, .clip-h.h-se, .clip-h.h-e { right: -13px; } .clip-h.h-nw, .clip-h.h-n, .clip-h.h-ne { top: -13px; } .clip-h.h-sw, .clip-h.h-s, .clip-h.h-se { bottom: -13px; } }
.clip-bar { position: absolute; left: -2px; bottom: calc(100% + 8px); display: flex; gap: 0; box-shadow: 0 4px 14px rgba(0,0,0,.35); border-radius: 6px; overflow: hidden; cursor: default; white-space: nowrap; }
.clip-box.bar-inside .clip-bar { bottom: auto; top: 8px; left: 8px; }
.cb { display: inline-flex; align-items: center; gap: 6px; border: 0; padding: 8px 14px; font: 600 15px/1 system-ui, -apple-system, "Segoe UI", sans-serif; cursor: pointer; min-height: 38px; }
.cb svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cb-share { background: #fff; color: #1b1f1e; }
.cb-dl { background: var(--brand); color: #fff; }
.cb-x { background: #d92d20; color: #fff; }
.cb:hover { filter: brightness(.94); }
.cb:disabled { opacity: .7; cursor: wait; }
.spinner.sm { width: 16px; height: 16px; border-width: 2px; display: inline-block; }

.clip-modal { position: absolute; inset: 0; z-index: 20; background: rgba(10,20,18,.6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.clip-card { background: #fff; border-radius: 14px; width: min(520px, 100%); max-height: 100%; overflow: auto; padding: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.4); }
.clip-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.clip-preview { background: #eef1f0; border-radius: 8px; padding: 8px; margin-bottom: 12px; text-align: center; }
.clip-preview img { max-width: 100%; max-height: 42vh; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.share-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.sh { display: flex; align-items: center; justify-content: center; padding: 10px 6px; border-radius: 8px; color: #fff; text-decoration: none; font-weight: 700; font-size: 14px; }
.sh-wa { background: #25D366; } .sh-fb { background: #1877F2; } .sh-x { background: #111; } .sh-tg { background: #229ED9; }
.share-link { display: flex; gap: 8px; }
.share-link input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 13px; }
.clip-actions { display: flex; gap: 8px; justify-content: space-between; margin-top: 12px; flex-wrap: wrap; }
@media (max-width: 640px) { .share-row { grid-template-columns: repeat(2, 1fr); } .tb.tb-clip, .tb.tb-pdf { padding: 0 10px; } }

/* ---------- Click-to-zoom popup ---------- */
.rd:not(.clipping) .pg { cursor: zoom-in; }
.zoom-modal { position: fixed; inset: 0; z-index: 2000; background: rgba(8,14,30,.72); display: flex; align-items: center; justify-content: center; padding: 18px; }
.rd.is-fs .zoom-modal, .rd.pseudo-fs .zoom-modal { padding: 10px; }
.zoom-box { background: #fff; width: 100%; height: 100%; max-width: 1400px; border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.zoom-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px 8px 16px; border-bottom: 1px solid var(--line); background: #f7f8fa; }
.zoom-title { font-weight: 700; font-size: 14px; color: var(--ink); }
.zoom-tools { display: flex; gap: 6px; }
.zb { min-width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 20px; font-weight: 700; cursor: pointer; color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.zb:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.zb:disabled { opacity: .35; cursor: default; }
.zb-clip { border-radius: 19px; padding: 0 12px; font-size: 14px; background: #d92d20; border-color: #d92d20; color: #fff; }
.zb-clip:hover:not(:disabled) { background: #b42318; color: #fff; border-color: #b42318; }
.zb-x { background: #1b1f1e; color: #fff; border-color: #1b1f1e; font-size: 16px; }
.zb-x:hover:not(:disabled) { background: #000; color: #fff; border-color: #000; }
.zoom-scroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; cursor: grab; background: #e9ecf1; }
.zoom-scroll.dragging { cursor: grabbing; user-select: none; }
.zoom-stage { min-width: 100%; min-height: 100%; display: flex; align-items: flex-start; justify-content: center; padding: 12px; width: max-content; }
.zoom-stage canvas { display: block; background: #fff; box-shadow: 0 2px 12px rgba(0,0,0,.25); }
.zoom-stage .spinner { margin: 30vh auto; }
@media (max-width: 640px) { .zoom-modal { padding: 0; } .zoom-box { border-radius: 0; } .zb-clip { display: none; } }

/* =====================================================================
   Mahanadi-style layout: logo header, one page at a time, side arrows,
   bottom bar (Page ▾ · ‹ › · PDF · Clip · Calendar)
   ===================================================================== */
body.reader-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; background: #eef0f3; }
body.reader-page .ep-app { flex: 1 1 auto; min-height: 0; max-width: none; width: 100%; padding: 0; overflow: auto; display: flex; flex-direction: column; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* header */
.ep-top { background: var(--brand); position: relative; z-index: 30; flex: 0 0 auto; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.ep-top-in { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; }
.ep-logo { background: #fff; border-radius: 12px; padding: 6px 14px; display: inline-flex; align-items: center; line-height: 0; }
.ep-logo img { height: 44px; width: auto; display: block; }
.ep-menu-btn { width: 52px; height: 46px; border: 1.5px solid rgba(255,255,255,.75); background: rgba(255,255,255,.08); border-radius: 4px; display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; cursor: pointer; }
.ep-menu-btn span { width: 26px; height: 3px; background: #fff; border-radius: 2px; transition: transform .2s, opacity .2s; }
.ep-menu-btn.open span:nth-child(1) { transform: translateY(9px) rotate(45deg); }
.ep-menu-btn.open span:nth-child(2) { opacity: 0; }
.ep-menu-btn.open span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }
.ep-menu { position: absolute; right: 10px; top: 100%; margin-top: 4px; background: #fff; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); min-width: 260px; overflow: hidden; }
.ep-menu[hidden] { display: none; }
.ep-menu a, .ep-menu button { display: block; width: 100%; text-align: left; padding: 14px 18px; border: 0; border-bottom: 1px solid var(--line); background: #fff; color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; }
.ep-menu a:hover, .ep-menu button:hover { background: var(--brand-tint); color: var(--brand); }
.ep-menu > :last-child { border-bottom: 0; }

/* calendar dialog */
.ep-cal { position: fixed; inset: 0; z-index: 2500; background: rgba(8,14,30,.55); display: flex; align-items: flex-start; justify-content: center; padding: 70px 14px 14px; }
.ep-cal[hidden] { display: none; }
.ep-cal-box { background: #fff; border-radius: 12px; width: min(560px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.4); overflow: hidden; }
.ep-cal-head { display: flex; align-items: center; justify-content: space-between; background: var(--brand); color: #fff; padding: 12px 16px; }
.ep-cal-x { border: 0; background: transparent; color: #fff; font-size: 20px; cursor: pointer; width: 36px; height: 36px; }
.ep-cal .ep-picker-wrap { padding: 16px; }
.ep-cal .ep-picker { display: grid; grid-template-columns: 1fr; gap: 12px; }
.ep-cal .ep-picker .field { display: flex; flex-direction: column; gap: 4px; }
.ep-cal .ep-picker input, .ep-cal .ep-picker select { height: 44px; font-size: 16px; }
.ep-cal .ep-picker .btn { height: 46px; font-size: 16px; }

/* reader shell */
.rd.single { background: #eef0f3; border-radius: 0; height: auto; min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; max-width: 1200px; width: 100%; margin: 0 auto; }
.rd.single .rd-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px 10px; }
.rd.single .rd-title h1 { margin: 0; display: inline-flex; min-width: 0; font-size: 22px; font-weight: 500; letter-spacing: .3px; }
.rd.single .rd-t { background: var(--brand); color: #fff; border-left: 10px solid #D71920; padding: 8px 22px 8px 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: Georgia, 'Times New Roman', 'Noto Sans Telugu', serif; }
.rd.single .rd-date { color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; }
.rd.single .rd-body { flex: 1 1 auto; min-height: 0; background: #eef0f3; }
.rd.single .rd-scroll { background: #eef0f3; }
.rd.single .rd-pages { gap: 0; padding: 4px 6px 20px; }
.rd.single .pg { display: none; box-shadow: 0 1px 8px rgba(0,0,0,.18); }
.rd.single .pg.cur { display: block; }
.rd.single .pg .pg-num { display: none; }
.rd.single:not(.clipping) .pg { cursor: zoom-in; }

/* page-turn animation */
@keyframes pm-turn-next { from { transform: perspective(1600px) rotateY(-24deg) translateX(18%); opacity: .25; transform-origin: left center; } to { transform: none; opacity: 1; transform-origin: left center; } }
@keyframes pm-turn-prev { from { transform: perspective(1600px) rotateY(24deg) translateX(-18%); opacity: .25; transform-origin: right center; } to { transform: none; opacity: 1; transform-origin: right center; } }
.rd.single .pg.turn-next { animation: pm-turn-next .42s cubic-bezier(.2,.7,.2,1); }
.rd.single .pg.turn-prev { animation: pm-turn-prev .42s cubic-bezier(.2,.7,.2,1); }

/* side arrows (like Mahanadi's » tab) */
.rd-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 4; width: 44px; height: 110px; border: 0; background: rgba(70,74,82,.55); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.rd-arrow svg { width: 30px; height: 30px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.rd-arrow:hover { background: rgba(5,60,160,.85); }
.rd-arrow.rd-next { right: 0; border-radius: 8px 0 0 8px; }
.rd-arrow.rd-prev { left: 0; border-radius: 0 8px 8px 0; }
.rd-arrow:disabled { opacity: .3; cursor: default; background: rgba(70,74,82,.35); }
.rd.clipping .rd-arrow { display: none; }

/* bottom bar */
.rd-bottom { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 8px 12px; padding-bottom: calc(8px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -2px 8px rgba(0,0,0,.06); }
.rd-pgsel select { height: 48px; min-width: 120px; padding: 0 34px 0 14px; font-size: 18px; border: 1px solid #c9ced6; border-radius: 4px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='20' viewBox='0 0 14 20'%3E%3Cpath d='M3 8l4-4 4 4M3 12l4 4 4-4' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 10px center; -webkit-appearance: none; appearance: none; color: var(--ink); font-family: inherit; }
.rb { width: 52px; height: 48px; flex: 0 0 auto; border: 1px solid #c9ced6; background: #fff; color: var(--brand); border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none; padding: 0; }
.rb svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.rb:disabled { opacity: .35; cursor: default; }
.rb-gap { flex: 1 1 auto; }
.rb-red, .rb-blue { border: 0; color: #fff; width: 60px; height: 52px; border-radius: 2px; }
.rb-red { background: #D71920; }
.rb-red:hover { background: #b0141a; color: #fff; }
.rb-blue { background: #2f6fdd; }
.rb-blue:hover { background: var(--brand); color: #fff; }
.rb-red + .rb-red, .rb-red + .rb-blue { margin-left: -6px; }
.rb.on { background: #fff; color: #D71920; box-shadow: inset 0 0 0 2px #D71920; }

.rd.single .rd-toast { bottom: 14px; }
.rd.single.is-fs .rd-title, .rd.single.pseudo-fs .rd-title { display: none; }
.rd.single.pseudo-fs, .rd.single.is-fs { background: #eef0f3; max-width: none; }

@media (max-width: 640px) {
  .ep-top-in { padding: 8px 10px; }
  .ep-logo { padding: 5px 10px; border-radius: 10px; }
  .ep-logo img { height: 36px; }
  .ep-menu-btn { width: 46px; height: 40px; }
  .rd.single .rd-title { padding: 10px 10px 8px; }
  .rd.single .rd-title h1 { font-size: 19px; }
  .rd.single .rd-t { padding: 7px 14px 7px 12px; border-left-width: 8px; }
  .rd.single .rd-date { display: none; }
  .rd.single .rd-pages { padding: 2px 6px 14px; }
  .rd-arrow { width: 34px; height: 92px; }
  .rd-arrow svg { width: 24px; height: 24px; }
  .rd-bottom { gap: 6px; padding: 8px; }
  .rd-pgsel select { min-width: 0; width: 96px; height: 44px; font-size: 16px; padding: 0 26px 0 10px; background-position: right 7px center; }
  .rb { width: 42px; height: 44px; }
  .rb svg { width: 24px; height: 24px; }
  .rb-red, .rb-blue { width: 50px; height: 48px; }
  .rb-red + .rb-red, .rb-red + .rb-blue { margin-left: -4px; }
}
@media (max-width: 360px) {
  .rb-nav[data-act="prev"] { display: none; }
}

/* hidden on phones, used on desktop */
.ep-strip, .rd-nums, .rb-lbl, .rb-gap2 { display: none; }
.rd.single .rd-preview { margin-top: 8px; width: 100%; }
.rd.single .rd-title { flex-wrap: wrap; }

/* =====================  Desktop / laptop (≥ 900px)  ===================== */
@media (min-width: 900px) {
  .ep-top { background: #f2f3f5 linear-gradient(180deg, #f7f8fa, #eceef1); box-shadow: none; }
  .ep-top-in { justify-content: center; padding: 14px 20px; }
  .ep-logo { background: transparent; padding: 0; border-radius: 0; }
  .ep-logo img { height: 84px; }
  .ep-menu-btn { display: none; }
  .ep-menu { display: none !important; }
  .ep-strip { display: block; background: #2f6fdd; background: var(--brand); }
  .ep-strip-in { max-width: 1500px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; height: 48px; color: #fff; }
  .ep-home { color: #fff; display: inline-flex; padding: 8px; border-radius: 6px; }
  .ep-home:hover { background: rgba(255,255,255,.15); }
  .ep-home svg { width: 24px; height: 24px; stroke: currentColor; fill: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
  .ep-strip-date { font-size: 15px; font-weight: 600; opacity: .95; }

  .rd.single { max-width: 1500px; display: grid; grid-template-columns: 220px minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas: "bar bar" "side title" "side body"; }
  .rd.single .rd-bottom { grid-area: bar; border-top: 0; border-bottom: 1px solid var(--line); box-shadow: 0 2px 8px rgba(0,0,0,.06); padding: 10px 24px; gap: 0; }
  .rd.single .rd-title { grid-area: title; padding: 16px 24px 10px; }
  .rd.single .rd-body { grid-area: body; }
  .rd.single .rd-side { grid-area: side; width: auto; background: #fff; border-right: 1px solid var(--line); padding: 16px 22px; gap: 18px; margin: 12px 0 0 12px; border-radius: 4px 4px 0 0; }
  .rd.single .rd-side .th { color: var(--ink); font-size: 16px; }
  .rd.single .rd-side .th span { display: block; margin-top: 8px; }
  .rd.single .rd-side .th .im { outline: 1px solid #d6dae0; outline-offset: 0; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
  .rd.single .rd-side .th.cur .im { outline: 3px solid #4a86e8; outline-offset: 3px; }
  .rd.single .rd-side .th.cur { color: var(--ink); font-weight: 700; }

  .rd-pgsel select { min-width: 220px; height: 46px; font-size: 17px; margin-right: 20px; }
  .rd-nums { display: flex; max-width: 46vw; overflow-x: auto; scrollbar-width: thin; border: 1px solid #d6dae0; border-radius: 4px; }
  .rnum { min-width: 46px; height: 44px; border: 0; border-right: 1px solid #d6dae0; background: #fff; color: #2f6fdd; font-size: 17px; cursor: pointer; flex: 0 0 auto; }
  .rnum:hover { background: #eef3fd; }
  .rnum.on { background: #2f6fdd; color: #fff; }
  .rd.single .rb-nav[data-act="prev"] { display: none; }
  .rd.single .rb-nav[data-act="next"] { border-left: 0; border-radius: 0 4px 4px 0; height: 46px; margin-left: -1px; }
  .rd.single .rb-nav[data-act="next"] svg { width: 22px; height: 22px; }
  .rb-gap2 { display: block; flex: 1 1 auto; }
  .rb-lbl { display: inline; margin-left: 8px; font-size: 19px; font-family: Georgia, 'Times New Roman', serif; }
  .rd.single .rb-red, .rd.single .rb-blue { width: auto; height: 50px; padding: 0 20px; }
  .rd.single .tb-pdf svg { display: none; }
  .rd.single .tb-pdf .rb-lbl { margin-left: 0; }
  .rd.single .rb-red + .rb-red, .rd.single .rb-red + .rb-blue { margin-left: 0; }
  .rd.single .rb svg { width: 22px; height: 22px; }

  .rd.single .rd-pages { padding: 4px 24px 30px; }
  .rd-arrow { width: 52px; height: 130px; }
  .rd-arrow.rd-next { right: 6px; }
  .rd-arrow.rd-prev { left: 6px; }
}

/* ---- desktop: compact header (logo + home + date in one slim row) ---- */
@media (min-width: 900px) {
  .ep-top { position: relative; border-bottom: 4px solid var(--brand); }
  .ep-top-in { padding: 6px 20px; max-width: none; }
  .ep-logo img { height: 50px; }
  .ep-strip { display: block; position: absolute; inset: 0 0 4px 0; background: transparent; pointer-events: none; }
  .ep-strip-in { max-width: none; height: 100%; color: var(--brand); padding: 0 24px; }
  .ep-strip-in > * { pointer-events: auto; }
  .ep-home { color: var(--brand); }
  .ep-home:hover { background: var(--brand-tint); }
  .ep-strip-date { color: #3d4a5c; font-size: 14px; }
  .rd.single .rd-bottom { padding: 6px 20px; }
  .rd-pgsel select { height: 40px; font-size: 16px; min-width: 170px; }
  .rnum { height: 38px; min-width: 40px; font-size: 16px; }
  .rd.single .rb-nav[data-act="next"] { height: 40px; }
  .rd.single .rb-red, .rd.single .rb-blue { height: 42px; padding: 0 16px; }
  .rb-lbl { font-size: 17px; }
  .rd.single .rd-title { padding: 8px 24px 6px; }
  .rd.single .rd-title h1 { font-size: 18px; }
  .rd.single .rd-t { padding: 5px 18px 5px 14px; border-left-width: 8px; }
  .rd.single .rd-side { margin-top: 8px; }
}
