.bookshelf-page { width:min(1180px,100%); min-height:100svh; margin-inline:auto; padding:30px 36px 22px; display:flex; flex-direction:column; }
.bookshelf-header { padding-bottom:28px; border-bottom:1px solid var(--offline-line); }
.bookshelf-page main { flex:1; }
.bookshelf-intro { padding-block:54px 28px; max-width:700px; }
.bookshelf-intro h1 { font-size:clamp(32px,4vw,48px); margin-block:14px; }
.bookshelf-intro p { color:var(--offline-muted); margin:0; }
.bookshelf-connection { display:inline-flex; align-items:center; gap:8px; color:#f0c578; font-size:14px; }
.bookshelf-connection::before { content:''; width:7px; height:7px; border-radius:50%; background:currentColor; }
.bookshelf-toolbar { display:flex; justify-content:space-between; align-items:center; flex-wrap:wrap; gap:16px; padding-block:16px; border-block:1px solid var(--offline-line); font-size:15px; color:var(--offline-muted); }
.bookshelf-secondary, .offline-reader-header button { min-height:44px; padding:9px 14px; border:1px solid #496875; border-radius:8px; background:#103a48; color:#e8eeeb; font:inherit; font-size:14px; cursor:pointer; }
.bookshelf-secondary:hover, .offline-reader-header button:hover { background:#215260; }
.bookshelf-secondary:disabled, .offline-reader-header button:disabled { opacity:.5; cursor:default; }
.bookshelf-feedback { min-height:1.8em; margin-block:16px; font-size:15px; color:#f0c578; }
.bookshelf-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:24px; }
.bookshelf-card { min-width:0; padding:26px; border:1px solid #365763; border-radius:14px; background:#07313e; border-top:3px solid #c59036; }
.bookshelf-card::before { content:'PDF'; display:grid; place-items:center; width:54px; height:68px; margin-bottom:24px; border:1px solid #826e46; border-inline-start:5px solid #e6a530; border-radius:3px 7px 7px 3px; color:#f0c578; font:800 14px/1 system-ui,sans-serif; }
.bookshelf-card h2 { font-size:23px; line-height:1.6; margin:0 0 12px; overflow-wrap:anywhere; }
.bookshelf-card p { font-size:14px; color:var(--offline-muted); margin:0 0 24px; }
.bookshelf-card-actions { display:flex; flex-wrap:wrap; align-items:center; gap:12px; }
.bookshelf-card .offline-retry { min-width:0; min-height:46px; font-size:15px; padding:10px 18px; }
.bookshelf-card .bookshelf-secondary { background:none; }
.bookshelf-empty { margin-block:10px 40px; padding:40px 20px; text-align:center; border:1px dashed #365763; border-radius:14px; }
.bookshelf-empty[hidden] { display:none; }
.bookshelf-empty h2 { font-size:25px; margin:20px 0 12px; }
.bookshelf-empty p { max-width:560px; margin:0 auto 24px; color:var(--offline-muted); font-size:16px; }
.bookshelf-empty .offline-retry { font-size:16px; min-height:48px; text-decoration:none; }
.bookshelf-policy { margin-block:34px; padding-inline-start:16px; border-inline-start:2px solid #826e46; color:var(--offline-muted); font-size:14px; }
.bookshelf-policy p { margin:4px 0; }
.offline-book-reader { position:fixed; inset:0; width:100%; max-width:none; height:100%; height:100dvh; max-height:none; margin:0; padding:0; border:0; background:#071b24; color:#f4f5ee; font:inherit; }
.offline-book-reader[open] { display:flex; flex-direction:column; }
body.offline-reader-open { overflow:hidden; }
.offline-book-reader::backdrop { background:#00151d; }
.offline-reader-header { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:12px; padding:12px 18px; background:#002633; border-bottom:1px solid #365763; }
.offline-reader-header h2 { flex:1; min-width:120px; margin:0; font-size:16px; overflow-wrap:anywhere; }
.offline-reader-navigation, .offline-reader-zoom { display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:8px; }
.offline-reader-navigation label { display:flex; align-items:center; gap:6px; font-size:14px; }
.offline-reader-navigation input { width:64px; min-height:44px; border:1px solid #496875; border-radius:7px; background:#103a48; color:#fff; font:inherit; font-size:16px; text-align:center; }
.offline-reader-status { margin:0; min-height:28px; padding:2px 18px; color:#f0c578; font-size:14px; }
.offline-reader-viewport { flex:1; min-height:80px; overflow:auto; padding:12px; text-align:center; direction:ltr; }
.offline-reader-viewport canvas { display:block; margin-inline:auto; background:#fff; }
.offline-reader-text { flex:none; max-height:30vh; overflow:auto; padding:10px 20px; border-top:1px solid #365763; background:#002633; font-size:16px; }
.offline-reader-text summary { min-height:44px; padding-block:8px; }
.offline-reader-text div { white-space:pre-wrap; padding-block:12px; color:#e8eeeb; }
@media (max-width:900px) { .bookshelf-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width:600px) {
    .bookshelf-page { padding:22px 20px; }
    .bookshelf-intro { padding-top:36px; }
    .bookshelf-grid { grid-template-columns:minmax(0,1fr); gap:16px; }
    .bookshelf-card { padding:22px; }
    .bookshelf-card::before { float:inline-end; margin-inline-start:20px; margin-bottom:14px; }
    .bookshelf-card h2 { font-size:22px; }
    .bookshelf-card-actions { clear:both; }
    .offline-reader-header { gap:10px; padding:10px; }
    .offline-reader-navigation { width:100%; order:3; }
    .offline-reader-header button { font-size:12px; padding-inline:10px; }
    .offline-reader-header h2 { font-size:14px; }
    .offline-reader-zoom { width:100%; order:4; }
    .offline-reader-text { padding-inline:12px; }
}
/* Account library: all essential colours work without fetching decorative assets. */
.bookshelf-page { width:min(1280px,100%); padding:28px 32px; }
.bookshelf-page main { margin-top:28px; padding:30px; background:#faf9f5; color:#003642; border:1px solid #cba55b; border-radius:22px; --offline-muted:#48636e; --offline-line:#ded5c3; }
.bookshelf-intro { padding:0 0 24px; max-width:none; }
.bookshelf-intro h1 { color:#003642; font-size:clamp(28px,4vw,40px); }
.bookshelf-intro h1::after { content:''; display:block; width:60px; height:4px; border-radius:4px; margin-top:12px; background:#d6a03c; }
.bookshelf-connection { color:#8d651f; }
.bookshelf-page .bookshelf-profile { display:inline-flex; align-items:center; min-height:44px; padding:9px 18px; border:1px solid #cba55b; background:#eab84f; border-radius:10px; color:#003642; font-weight:800; text-decoration:none; }
.bookshelf-toolbar .bookshelf-secondary { background:#fffdfa; color:#8f3830; border-color:#cda89e; border-radius:10px; }
.bookshelf-feedback { color:#815f23; }
.bookshelf-card { background:#fffdfa; border:1px solid #ded5c3; border-top:3px solid #c59036; border-radius:16px; }
.bookshelf-card::before { background:#003642; color:#eab84f; }
.bookshelf-card h2 { color:#003642; }
.bookshelf-card .bookshelf-secondary { color:#8f3830; border-color:#cda89e; }
.bookshelf-empty { background:linear-gradient(120deg,#fffdfa,#f4eedf); border-color:#c7ad78; border-radius:18px; }
.bookshelf-empty h2 { color:#003642; }
.bookshelf-empty .offline-retry,.bookshelf-card .offline-retry { background:#003642; color:#fff; border-radius:10px; border:1px solid #003642; }
.bookshelf-page .offline-footer { gap:14px; flex-wrap:wrap; }
@media(max-width:600px) { .bookshelf-page { padding:20px 14px; } .bookshelf-page main { padding:22px 16px; } .bookshelf-header { flex-wrap:wrap; gap:16px; } .bookshelf-empty { padding:28px 16px; } }
