.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.main-content.reader-route { padding-top: calc(var(--header) + 18px); padding-right: 20px; padding-bottom: 16px; padding-left: calc(var(--sidebar) + 20px); }
.akhri-reader { --reader-surface: #0b1118; --reader-paper-surround: #101820; --reader-toolbar: rgba(12, 19, 27, .88); position: relative; display: flex; flex-direction: column; height: calc(100vh - var(--header) - 34px); min-height: 620px; max-width: 1440px; margin: 0 auto; overflow: hidden; color: var(--text); background: var(--reader-surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .24); }
.akhri-reader[data-appearance="light"] { --reader-surface: #e7ebef; --reader-paper-surround: #f3f5f7; --reader-toolbar: rgba(255,255,255,.9); color: #1b2530; }
.akhri-reader[data-appearance="sepia"] { --reader-surface: #d8ceba; --reader-paper-surround: #e8deca; --reader-toolbar: rgba(244,237,221,.92); color: #342d24; }
.akhri-reader:fullscreen, .akhri-reader.is-focus-mode { position: fixed; z-index: 100; inset: 0; width: 100vw; height: 100vh; max-width: none; border: 0; border-radius: 0; }
.akhri-reader-header { position: relative; z-index: 7; display: grid; grid-template-columns: minmax(130px,1fr) auto minmax(130px,1fr); align-items: center; min-height: 66px; padding: 9px 14px; background: var(--reader-toolbar); border-bottom: 1px solid var(--line); backdrop-filter: blur(18px); transition: opacity .25s ease, transform .25s ease; }
.reader-back { display: inline-flex; align-items: center; gap: 8px; width: max-content; padding: 9px 10px; border-radius: 10px; color: currentColor; font-size: 14px; }
.reader-back:hover { background: rgba(128,150,175,.12); }
.reader-back svg { width: 20px; }
.reader-book-heading { min-width: 0; text-align: center; }
.reader-book-heading h1 { overflow: hidden; margin: 0; font-size: 17px; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.reader-book-heading span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.reader-actions { display: flex; justify-content: flex-end; gap: 4px; }
.reader-icon-button { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 10px; color: currentColor; background: transparent; }
.reader-icon-button:hover, .reader-icon-button:focus-visible, .reader-icon-button.is-active { color: var(--blue-bright); background: rgba(75, 133, 229, .13); outline: 0; }
.reader-icon-button svg { width: 20px; height: 20px; }
.reader-search { position: absolute; z-index: 12; top: 74px; right: 18px; display: flex; align-items: center; gap: 7px; width: min(520px, calc(100% - 36px)); min-height: 48px; padding: 5px 7px 5px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 13px; box-shadow: 0 18px 50px rgba(0,0,0,.3); }
.reader-search[hidden], .reader-settings[hidden], .reader-side-panel[hidden] { display: none; }
.reader-search > svg { flex: 0 0 auto; width: 18px; color: var(--muted); }
.reader-search input { min-width: 0; flex: 1; padding: 8px 4px; border: 0; outline: 0; color: var(--text); background: transparent; }
.reader-search [data-search-count] { color: var(--muted); font-size: 12px; white-space: nowrap; }
.reader-settings { position: absolute; z-index: 13; top: 74px; right: 18px; width: min(370px, calc(100% - 36px)); max-height: calc(100% - 94px); overflow: auto; padding: 15px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 24px 70px rgba(0,0,0,.4); animation: reader-pop .18s ease both; }
.reader-popover-heading, .reader-side-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.reader-settings fieldset { padding: 0; margin: 17px 0 0; border: 0; }
.reader-settings legend { margin-bottom: 8px; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.reader-segmented, .reader-themes { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: rgba(125,145,165,.1); border-radius: 11px; }
.reader-segmented button, .reader-themes button { min-height: 37px; padding: 6px 8px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 12px; }
.reader-segmented button.is-selected, .reader-themes button.is-selected { color: var(--text); background: var(--panel-soft); box-shadow: 0 2px 8px rgba(0,0,0,.13); }
.reader-themes button { display: grid; grid-template-columns: 14px auto; align-items: center; justify-content: center; gap: 6px; }
.reader-themes i { width: 14px; height: 14px; border: 1px solid rgba(120,130,140,.3); border-radius: 50%; }
.theme-light { background: #f4f5f6; }.theme-sepia { background: #d8c7a6; }.theme-dark { background: #111820; }
.reader-stepper { display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; }
.reader-stepper button { display: grid; place-items: center; height: 40px; border: 0; color: currentColor; background: transparent; }
.reader-stepper button:hover { background: rgba(125,145,165,.12); }
.reader-stepper output { text-align: center; color: var(--muted); font-size: 13px; }
.reader-side-panel { position: absolute; z-index: 10; top: 66px; bottom: 0; left: 0; width: min(300px, 82vw); display: flex; flex-direction: column; background: rgba(11, 18, 25, .97); border-right: 1px solid var(--line); box-shadow: 18px 0 40px rgba(0,0,0,.2); animation: reader-drawer .22s ease both; }
.reader-side-heading { min-height: 58px; padding: 8px 12px 8px 17px; border-bottom: 1px solid var(--line); }
.reader-side-content { min-height: 0; flex: 1; overflow: auto; padding: 14px; }
.thumbnail-list { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.thumbnail-list button { display: grid; gap: 6px; padding: 8px; border: 1px solid transparent; border-radius: 10px; color: var(--muted); background: #121b24; font-size: 11px; }
.thumbnail-list button:hover { border-color: rgba(73,139,255,.45); color: white; }
.thumbnail-list canvas { width: 100%; min-height: 120px; background: white; border-radius: 3px; }
.bookmark-list { display: grid; gap: 7px; }
.bookmark-list button { display: flex; align-items: center; gap: 10px; min-height: 45px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; color: currentColor; background: #121b24; }
.bookmark-list svg { width: 18px; }
.reader-panel-empty { color: var(--muted); text-align: center; }
.reader-workspace { min-height: 0; flex: 1; position: relative; }
.reader-document-scroll { position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain; background: var(--reader-paper-surround); scrollbar-color: rgba(120,140,160,.45) transparent; }
.akhri-reader.has-audio .reader-document-scroll { padding-bottom: 112px; }
.reader-pages { display: flex; min-height: 100%; align-items: flex-start; justify-content: center; padding: 28px; }
.reader-pages[data-mode="continuous"] { flex-direction: column; align-items: center; }
.reader-pages[data-mode="single"], .reader-pages[data-mode="spread"] { height: 100%; align-items: center; gap: 24px; }
.reader-pages[data-spacing="compact"] { gap: 18px; }.reader-pages[data-spacing="normal"] { gap: 32px; }.reader-pages[data-spacing="comfortable"] { gap: 52px; }
.pdf-page-slot { position: relative; flex: 0 0 auto; max-width: 100%; min-height: min(70vh, 720px); aspect-ratio: var(--page-ratio); overflow: hidden; background: white; border-radius: 3px; box-shadow: 0 15px 38px rgba(0,0,0,.24); }
.reader-pages[data-mode="continuous"] .pdf-page-slot { margin-inline: auto; }
.pdf-page-slot canvas { position: relative; z-index: 2; display: block; max-width: 100%; height: auto; background: white; opacity: 0; transition: opacity .2s ease; }
.akhri-reader[data-appearance="dark"] .pdf-page-slot[data-text-only="true"] canvas { filter: invert(1) hue-rotate(180deg); }
.akhri-reader[data-appearance="sepia"] .pdf-page-slot[data-text-only="true"] canvas { filter: sepia(.35) saturate(.88) brightness(.96); }
.pdf-page-slot.is-rendered canvas { opacity: 1; }
.pdf-page-slot .textLayer { position: absolute; inset: 0; z-index: 3; overflow: hidden; opacity: 1; line-height: 1; user-select: text; pointer-events: none; }
.pdf-page-slot .textLayer span { position: absolute; color: transparent; white-space: pre; transform-origin: 0 0; cursor: text; }
.pdf-page-slot .textLayer .search-hit { color: #122033; background: rgba(255, 214, 54, .72); opacity: 1; border-radius: 2px; }
.pdf-page-slot .textLayer .search-hit-current { color: #122033; background: #ff9f1c; opacity: 1; border-radius: 2px; box-shadow: 0 0 0 2px rgba(255,159,28,.35); }
.akhri-reader[data-appearance="dark"] .pdf-page-slot .textLayer .search-hit, .akhri-reader[data-appearance="dark"] .pdf-page-slot .textLayer .search-hit-current { color: #fff; }
.pdf-page-number { position: absolute; z-index: 3; right: 10px; bottom: 8px; color: rgba(20,30,40,.45); font-size: 10px; }
.pdf-page-loading { position: absolute; z-index: 1; inset: 0; display: grid; place-items: center; background: #f7f7f6; }
.pdf-page-loading span { width: 28px; height: 28px; border: 2px solid #d6dbe0; border-top-color: #2d78ff; border-radius: 50%; animation: reader-spin .8s linear infinite; }
.pdf-page-slot.is-rendered .pdf-page-loading { display: none; }
.pdf-page-slot.has-render-error::after { content: "Page could not be rendered"; position: absolute; inset: 0; display: grid; place-items: center; color: #712b2b; background: #f9e7e7; }
.reader-loading, .reader-error, .reader-audio-only { position: absolute; z-index: 5; inset: 0; display: grid; place-items: center; align-content: center; gap: 12px; padding: 30px; text-align: center; background: var(--reader-paper-surround); }
.reader-loading[hidden], .reader-error[hidden] { display: none; }
.reader-loading img { width: 58px; height: 58px; border-radius: 15px; box-shadow: 0 8px 28px rgba(190,30,140,.23); }
.reader-loading span, .reader-audio-only p { color: var(--muted); }
.reader-loading i { width: 110px; height: 3px; overflow: hidden; border-radius: 4px; background: rgba(125,145,165,.18); }
.reader-loading i::after { content: ""; display: block; width: 45%; height: 100%; background: var(--blue); animation: reader-loading 1.2s ease-in-out infinite alternate; }
.reader-error strong { font-size: 18px; }
.audio-only-cover { width: min(270px, 55vw); aspect-ratio: .76; background: linear-gradient(145deg,#31475e,#111820), var(--audio-only-cover) center/cover; border-radius: 14px; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.reader-audio-only h2 { margin: 7px 0 0; font-size: 28px; }
.reader-navigation { position: relative; z-index: 6; display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 50px; background: var(--reader-toolbar); border-top: 1px solid var(--line); transition: opacity .25s ease, transform .25s ease; }
.reader-navigation label { width: 48px; }
.reader-navigation input { width: 100%; height: 32px; border: 1px solid var(--line); border-radius: 8px; color: currentColor; text-align: center; background: rgba(125,145,165,.08); }
.reader-percentage { margin-left: 8px; padding-left: 12px; border-left: 1px solid var(--line); color: var(--muted); font-size: 12px; }
.reader-audio-mount { position: absolute; z-index: 9; right: 16px; bottom: 62px; left: 16px; }
.akhri-audio-player { display: grid; grid-template-columns: minmax(160px, .8fr) auto minmax(240px, 1.4fr) auto; align-items: center; gap: 14px; min-height: 82px; padding: 10px 12px; background: rgba(13, 21, 29, .94); border: 1px solid rgba(145,170,195,.16); border-radius: 16px; box-shadow: 0 16px 45px rgba(0,0,0,.4); backdrop-filter: blur(20px); transition: .22s ease; }
.akhri-audio-player audio { display: none; }
.audio-book-meta { display: flex; align-items: center; gap: 10px; min-width: 0; }
.audio-book-meta > span:last-child { min-width: 0; }
.audio-book-meta strong, .audio-book-meta small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.audio-book-meta strong { font-size: 13px; }.audio-book-meta small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.audio-cover { flex: 0 0 auto; width: 43px; height: 53px; background: linear-gradient(145deg,#34495f,#131b25), var(--audio-cover) center/cover; border-radius: 6px; }
.audio-primary-controls, .audio-secondary-controls, .audio-timeline { display: flex; align-items: center; gap: 6px; }
.audio-play-button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; color: white; background: var(--blue); box-shadow: 0 5px 16px rgba(45,120,255,.35); }
.audio-play-button svg { width: 20px; fill: currentColor; stroke: currentColor; }
.audio-timeline { min-width: 0; }
.audio-timeline span { width: 42px; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 10px; }
.audio-timeline span:last-child { text-align: right; }
.audio-timeline input, .audio-volume { accent-color: var(--blue); }
.audio-timeline input { min-width: 80px; flex: 1; }
.audio-speed select { height: 34px; padding: 0 6px; border: 1px solid var(--line); border-radius: 8px; color: white; background: #18222d; }
.audio-volume { width: 65px; }
.audio-status { position: absolute; right: 18px; bottom: 4px; color: #d38888; font-size: 10px; }
.audio-chapters { position: absolute; right: 12px; bottom: calc(100% + 8px); display: grid; width: min(330px, calc(100vw - 40px)); max-height: 320px; overflow: auto; padding: 12px; background: #121b24; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 50px rgba(0,0,0,.4); }
.audio-chapters[hidden] { display: none; }
.audio-chapters > strong { padding: 4px 8px 10px; }
.audio-chapters button { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 42px; padding: 0 9px; border: 0; border-radius: 9px; color: var(--muted); text-align: left; background: transparent; }
.audio-chapters button:hover, .audio-chapters button.is-current { color: white; background: rgba(70,130,220,.15); }
.audio-chapters small { white-space: nowrap; }
.akhri-audio-player.is-minimized { grid-template-columns: minmax(160px,1fr) auto auto; min-height: 60px; }
.akhri-audio-player.is-minimized .audio-timeline, .akhri-audio-player.is-minimized .audio-secondary-controls > :not(.audio-collapse), .akhri-audio-player.is-minimized .audio-cover { display: none; }
.akhri-audio-player.is-minimized .audio-secondary-controls { display: flex; }
.akhri-reader.controls-hidden .akhri-reader-header, .akhri-reader.controls-hidden .reader-navigation { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.akhri-reader.controls-hidden .reader-navigation { transform: translateY(8px); }

@keyframes reader-spin { to { transform: rotate(360deg); } }
@keyframes reader-loading { from { transform: translateX(-25%); } to { transform: translateX(140%); } }
@keyframes reader-pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
@keyframes reader-drawer { from { opacity: 0; transform: translateX(-18px); } }

@media (max-width: 1050px) {
  .akhri-audio-player { grid-template-columns: minmax(130px,.8fr) auto minmax(180px,1.2fr); }
  .audio-secondary-controls { display: none; }
}
@media (max-width: 760px) {
  .main-content.reader-route { padding: calc(var(--header) + 74px) 0 0; }
  .akhri-reader { height: calc(100vh - var(--header) - 74px); min-height: 520px; border-radius: 0; border-right: 0; border-left: 0; }
  .akhri-reader-header { grid-template-columns: auto minmax(0,1fr) auto; min-height: 58px; padding: 6px 8px; }
  .reader-back span { display: none; }
  .reader-actions { gap: 0; }
  .reader-actions .reader-icon-button { width: 40px; height: 40px; }
  .reader-book-heading h1 { font-size: 14px; }
  .reader-search { top: 64px; right: 8px; left: 8px; width: auto; }
  .reader-settings { top: auto; right: 8px; bottom: 8px; left: 8px; width: auto; max-height: 75%; border-radius: 20px; }
  .reader-settings [data-reader-set="mode"][data-value="spread"] { display: none; }
  .reader-side-panel { top: auto; right: 0; bottom: 0; width: 100%; height: 70%; border-top: 1px solid var(--line); border-right: 0; border-radius: 20px 20px 0 0; animation-name: reader-sheet; }
  .reader-pages { padding: 14px 8px; }
  .reader-pages[data-mode="spread"] { grid-template-columns: 1fr; }
  .reader-pages[data-spacing="compact"] { gap: 12px; }.reader-pages[data-spacing="normal"] { gap: 20px; }.reader-pages[data-spacing="comfortable"] { gap: 30px; }
  .pdf-page-slot { box-shadow: 0 8px 24px rgba(0,0,0,.22); }
  .reader-navigation { min-height: 46px; }
  .reader-audio-mount { right: 8px; bottom: 54px; left: 8px; }
  .akhri-audio-player { grid-template-columns: minmax(110px,1fr) auto; gap: 8px; min-height: 64px; padding: 7px 8px; border-radius: 13px; }
  .audio-book-meta small, .audio-timeline, .audio-secondary-controls { display: none; }
  .audio-cover { width: 35px; height: 44px; }
  .audio-primary-controls .reader-icon-button { width: 34px; height: 34px; }
  .audio-play-button { width: 40px; height: 40px; }
  .akhri-reader.has-audio .reader-document-scroll { padding-bottom: 88px; }
}
@media (max-width: 420px) {
  .reader-book-heading { max-width: 86px; }
  .reader-book-heading span { font-size: 10px; }
  .audio-primary-controls [data-audio-action="back"], .audio-primary-controls [data-audio-action="forward"] { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .akhri-reader *, .akhri-reader *::before, .akhri-reader *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@keyframes reader-sheet { from { opacity: 0; transform: translateY(30px); } }
