/* Scoped to the online reader; encrypted offline reading keeps its own layout. */
body.online-reading { height:100vh; height:100dvh; min-height:0; overflow:hidden; display:grid; grid-template-rows:auto minmax(0,1fr); }
.online-reading .site-header .header-inner { width:calc(100% - 32px); min-height:48px; padding:0; flex-wrap:nowrap; }
.online-reading .brand img { width:78px; height:31px; }
.online-reading .site-footer { display:none; }
.online-reading main.shell { width:auto; min-width:0; min-height:0; margin:0; padding:0 16px 12px; }
.online-reader { height:100%; min-width:0; min-height:0; display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:auto minmax(0,1fr); background:#f4f7fb; }
.online-reader-header { display:flex; min-width:0; align-items:center; gap:16px; min-height:60px; padding:6px 0; }
.online-reader-header h1 { flex:1; min-width:0; font-size:1rem; font-weight:650; letter-spacing:-.015em; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.online-reader button { min-width:44px; min-height:44px; border:1px solid #d8e3ee; border-radius:10px; background:white; color:#244a67; display:inline-flex; align-items:center; justify-content:center; gap:7px; font-size:.875rem; font-weight:600; padding:8px 11px; }
.online-reader button:hover:not(:disabled) { background:#e8f3fd; border-color:#a8cce7; }
.online-reader button:disabled { cursor:default; opacity:.35; }
.online-reader svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; flex:none; }
.online-reader-stage { position:relative; min-width:0; min-height:0; display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr) 76px; border:1px solid #dce5ef; border-radius:12px; overflow:hidden; background:#e9eef4; }
.online-pages { min-height:0; min-width:0; overflow:auto; overscroll-behavior:contain; scrollbar-gutter:stable both-edges; touch-action:pan-x pan-y; }
.online-paper { width:max-content; min-width:100%; min-height:100%; display:flex; padding:12px; }
.online-sheet { position:relative; flex:none; margin:auto; line-height:0; }
.online-paper canvas { display:block; margin:0; background:white; box-shadow:0 2px 12px #17334d1a; }
.online-links { position:absolute; inset:0; pointer-events:none; }
.online-document-link { position:absolute; display:block; pointer-events:auto; cursor:pointer; background:transparent; border-radius:3px; box-shadow:0 0 0 1px #1263a660; }
.online-document-link:hover,.online-document-link:focus-visible { outline:2px solid #1263a6; outline-offset:2px; background:#1263a60a; }
.online-toolbar { position:absolute; bottom:12px; left:50%; transform:translateX(-50%); max-width:calc(100% - 16px); display:flex; align-items:center; gap:10px; padding:6px 10px; border:1px solid #d4e0ec; border-radius:18px; background:rgba(255,255,255,.96); box-shadow:0 4px 18px #17334d1c; backdrop-filter:blur(12px); }
.online-toolbar-group { display:flex; align-items:center; gap:3px; }
.online-toolbar button { background:transparent; border-color:transparent; padding:8px; }
.online-page-form { display:flex; align-items:center; gap:5px; color:#546980; font-size:.875rem; white-space:nowrap; }
.online-page-form input { width:46px; min-height:44px; padding:5px; text-align:center; border:1px solid #dce5ef; border-radius:8px; background:#f7faff; color:#172d43; font:inherit; font-weight:650; appearance:textfield; -moz-appearance:textfield; }
.online-page-form input::-webkit-inner-spin-button,.online-page-form input::-webkit-outer-spin-button { appearance:none; margin:0; }
.online-toolbar-divider { width:1px; height:26px; background:#e1e8ef; }
.online-zoom { min-width:52px; text-align:center; font-size:.875rem; font-variant-numeric:tabular-nums; }
.online-fit { font:inherit; font-size:.875rem; min-height:44px; width:112px; color:#244a67; border:1px solid #dce5ef; border-radius:9px; background:white; padding:6px; }
.online-status { position:absolute; z-index:1; top:12px; left:50%; transform:translateX(-50%); max-width:calc(100% - 24px); padding:9px 15px; border:1px solid #dce5ef; border-radius:12px; background:#ffffffed; color:#244a67; box-shadow:0 2px 8px #17334d12; font-size:.875rem; text-align:center; }
.online-reader[aria-busy="true"] .online-status::before { content:""; display:inline-block; width:12px; height:12px; border:2px solid #c6deef; border-top-color:#1263a6; border-radius:50%; margin-right:8px; vertical-align:-2px; animation:online-spin 1s linear infinite; }
.online-reader:fullscreen,.online-reader.online-immersive { width:100%; height:100vh; height:100dvh; padding:0 16px 12px; }
.online-reader.online-immersive { position:fixed; inset:0; z-index:1000; }
.online-reader:fullscreen .online-reader-header,.online-reader.online-immersive .online-reader-header { min-height:54px; }
.online-sr-only { position:absolute; width:1px; height:1px; padding:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; border:0; }
@keyframes online-spin { to { transform:rotate(360deg); } }
@media(max-width:600px) {
  .online-reading .site-header .header-inner { width:calc(100% - 24px); min-height:44px; }
  .online-reading .brand>span { display:none; }
  .online-reading main.shell { padding:0 8px 8px; }
  .online-reader-header { gap:8px; min-height:56px; }
  .online-reader-header h1 { font-size:.875rem; }
  .online-reader-header .online-back { font-size:.8125rem; padding:6px 8px; }
  .online-reader-stage { grid-template-rows:minmax(0,1fr) 120px; border-radius:10px; }
  .online-toolbar { flex-wrap:wrap; justify-content:center; gap:3px 6px; padding:5px 8px; width:max-content; border-radius:16px; bottom:8px; }
  .online-toolbar-divider { display:none; }
  .online-fit { width:100%; min-height:44px; text-align:center; }
  .online-page-form input { width:38px; }
  .online-paper { padding:8px; }
  .online-reader:fullscreen,.online-reader.online-immersive { padding:0 8px 8px; }
}
@media(prefers-reduced-motion:reduce) { .online-reader[aria-busy="true"] .online-status::before { animation:none; } }
