/* Learning Hub app: the Bookshelf look (design direction 4) over the hub's tokens.
   Hub views only: inside a course the course's own colours and type still apply (:root[data-course]). */
:root{
  --bg:#DCE3DA; --surface:#F4F6F1; --surface-2:#E4EAE1; --ink:#1F2A26; --muted:#4A5A52; --rule:#C3CEC0;
  --civic:#A4442A; --civic-ink:#FFFFFF; --civic-soft:#F2DED6;
  --shelf:#7A5C3E; --shelf-edge:#5E4630; --label:#F4F6F1; --label-ink:#1F2A26;
  --f-ui:"Inter",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --f-read:"Inter",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --f-disp:"Newsreader",Georgia,"Times New Roman",serif;
  --shadow:0 1px 0 #B9C4B6;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  --bg:#1A211E; --surface:#222B27; --surface-2:#2B3530; --ink:#E7EDE6; --muted:#A3B2AA; --rule:#36423C;
  --civic:#E58A6C; --civic-ink:#1E0E08; --civic-soft:#3B261E;
  --shelf:#4A3826; --shelf-edge:#2E2217; --label:#E9EDE6; --label-ink:#1F2A26;
  --shadow:0 1px 0 #111613;
}}
:root[data-theme="dark"]{
  --bg:#1A211E; --surface:#222B27; --surface-2:#2B3530; --ink:#E7EDE6; --muted:#A3B2AA; --rule:#36423C;
  --civic:#E58A6C; --civic-ink:#1E0E08; --civic-soft:#3B261E;
  --shelf:#4A3826; --shelf-edge:#2E2217; --label:#E9EDE6; --label-ink:#1F2A26;
  --shadow:0 1px 0 #111613;
}
:root:not([data-course]) .panel{border-radius:8px}
:root:not([data-course]) h1{font-family:var(--f-disp);font-weight:700}

/* Today */
.rr-head{display:flex;justify-content:space-between;align-items:baseline;gap:12px;flex-wrap:wrap}
.rr-head h1{margin:0}
.rr-week{font-size:13.5px;font-weight:600;color:var(--muted)}
.bookmark{display:flex;gap:14px;align-items:center;text-decoration:none;color:var(--ink);background:var(--surface);border-radius:8px;padding:16px;box-shadow:var(--shadow)}
.bookmark .bm-book{width:54px;height:76px;flex:none;border-radius:3px;background:var(--sp);display:flex;align-items:flex-end;justify-content:center;padding-bottom:9px;box-sizing:border-box}
.bookmark .bm-book i{width:30px;height:4px;border-radius:2px;background:var(--label)}
.bookmark .bm-txt{display:flex;flex-direction:column;gap:3px;min-width:0}
.bookmark .bm-eb{font-size:12px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.bookmark .bm-t{font-family:var(--f-disp);font-size:21px;font-weight:700;line-height:1.2}
.bookmark .bm-go{font-size:14px;font-weight:600;color:var(--civic)}
.rr-btns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.rr-btn{display:flex;flex-direction:column;justify-content:center;min-height:64px;border-radius:8px;padding:10px 14px;text-decoration:none;background:var(--surface);color:var(--ink);box-shadow:var(--shadow)}
.rr-btn.dark{background:var(--ink);color:var(--bg)}
.rr-btn b{font-family:var(--f-disp);font-size:19px}
.rr-btn span{font-size:13px}

/* shelves */
.shelf-eb{font-size:12px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin:0 0 10px}
.shelf{display:flex;flex-direction:column}
.shelf-row{display:flex;align-items:flex-end;gap:6px;padding:0 4px;min-height:200px;overflow-x:auto;scrollbar-width:none}
.shelf-row::-webkit-scrollbar{display:none}
.shelf-board{height:10px;border-radius:2px;background:var(--shelf);box-shadow:0 3px 0 var(--shelf-edge)}
.spine{position:relative;flex:none;width:40px;border-radius:3px 3px 0 0;text-decoration:none;display:flex;align-items:center;justify-content:center;
  background:linear-gradient(to top,var(--sp) var(--pct),color-mix(in srgb,var(--sp) 38%,var(--surface)) var(--pct))}
.spine .lab{writing-mode:vertical-rl;transform:rotate(180deg);background:var(--label);color:var(--label-ink);font-family:var(--f-disp);font-weight:700;font-size:14px;
  padding:8px 3px;border-radius:2px;max-height:78%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.1}
.spine:focus-visible{outline:3px solid var(--civic);outline-offset:2px}
.spine-more{flex:none;align-self:center;padding:0 10px;font-size:13px;font-weight:600;color:var(--muted);text-decoration:none;min-height:44px;display:flex;align-items:center}
.shelf-legend{font-size:12.5px;color:var(--muted);margin:8px 0 0}
.shelves{display:flex;flex-direction:column;gap:22px}

/* app panels (settings, offline, sync, self-check) */
.app-panel .row{flex-wrap:wrap}
.app-panel input[type=text]{font:inherit;min-height:44px;padding:8px 12px;border-radius:8px;border:1px solid var(--rule);background:var(--surface);color:var(--ink);flex:1;min-width:160px}
.code-box{font-family:var(--f-mono);font-size:18px;letter-spacing:.06em;background:var(--surface-2);border-radius:8px;padding:10px 12px;user-select:all}
.sync-dot{display:inline-block;width:9px;height:9px;border-radius:50%;background:var(--muted);margin-right:6px}
.sync-dot.idle{background:var(--ok)}.sync-dot.syncing{background:var(--warn)}.sync-dot.error{background:var(--stamp)}
.bar-meter{height:8px;border-radius:4px;background:var(--surface-2);overflow:hidden}
.bar-meter i{display:block;height:8px;background:var(--civic)}
.kp{display:flex;flex-direction:column;gap:10px;margin-top:8px}
.kp-list{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:2px}
.kp-list label{display:flex;gap:10px;align-items:flex-start;min-height:44px;padding:8px 6px;border-radius:6px;cursor:pointer;line-height:1.35}
.kp-list label:hover{background:var(--surface-2)}
.kp-list input{width:20px;height:20px;margin:1px 0 0;flex:none;accent-color:var(--civic)}
.kp-h{font-size:12px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin:4px 0 0}
.kp-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.update-note{position:fixed;left:12px;right:12px;top:calc(8px + env(safe-area-inset-top,0px));z-index:30;max-width:560px;margin:0 auto;background:var(--ink);color:var(--bg);border:0;border-radius:10px;
  padding:12px 14px;font:600 14px var(--f-ui);text-align:left;min-height:44px;cursor:pointer;box-shadow:0 6px 18px rgba(0,0,0,.2)}
.read-aloud{display:inline-flex;align-items:center;gap:8px}
.read-aloud[aria-pressed="true"]{background:var(--civic);color:var(--civic-ink);border-color:var(--civic)}
.tts-on{background:color-mix(in srgb,var(--civic) 14%,transparent);border-radius:4px}
