/* =========================================================================
   SANKOFA READS — the app shell
   Square corners. Barely-there shadows. Ink, paper and gold.
   ========================================================================= */
.shell, #discover, #seriesView, .add-sheet, .import-tray, .menu, .bindery, .toast, #seriesSheet {
  --bg: #F7F5F0; --panel: #FFFFFF; --soft: #F1EEE7; --line: #E7E2D8;
  --ink: #141311; --ink-2: #4E4A43; --ink-3: #8F8A80;
  --gold: #E3A21A; --gold-ink: #1A1408; --red: #C8402F; --green: #2E7D4F;
  --sh: 0 1px 2px rgba(20, 17, 10, .05);
  --sh-2: 0 2px 10px -4px rgba(20, 17, 10, .10);
  /* map the older tokens used by sheets/overlays */
  --desk: var(--bg); --card: var(--panel); --chip: var(--soft); --btn: var(--panel); --rule: var(--line);
  --accent: var(--ink); --accent-ink: #fff; --accent-2: var(--gold); --accent-soft: var(--soft);
  --shadow: 20, 17, 10; --tooth-o: 0;
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
body[data-theme="night"] :is(.shell, #discover, #seriesView, .add-sheet, .import-tray, .menu, .bindery, .toast, #seriesSheet) {
  --bg: #11110F; --panel: #191917; --soft: #22221F; --line: #2C2B28;
  --ink: #F1ECE2; --ink-2: #B9B2A6; --ink-3: #7D786E;
  --sh: none; --sh-2: 0 2px 12px -4px rgba(0, 0, 0, .5);
  --accent: var(--ink); --accent-ink: #11110F; --shadow: 0, 0, 0;
}
/* no curved corners anywhere in the interface (the avatar stays round) */
.shell *, .shell, #discover *, #seriesView *, .add-sheet, .add-sheet *, .import-tray, .import-tray *, .menu, .menu *, #seriesSheet, #seriesSheet *, .toast, .word-pop, .word-pop *, .pen-bar, .pen-bar *, .pill-btn, .pill-group, .pill-group *, .scrub-pill, .sheet, .sheet *, .drawer, .drawer *, .coach-card, .coach-card *, .next-up, .next-up *, .mini-btn, .bindery * { border-radius: 0 !important; }
.shell .avatar, .ink-dot, .hl-dot, .pen-bar > button, .mini-btn { border-radius: 50% !important; }

/* ---- layout ---- */
#library.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); padding: 0; background: var(--bg); color: var(--ink); overflow-y: auto; overflow-x: hidden; }
.pages { min-width: 0; position: relative; }
.pg { padding: calc(var(--safe-t) + 34px) clamp(20px, 3vw, 44px) calc(var(--safe-b) + 60px); min-height: 100vh; }

/* ---- sidebar ---- */
.sb { position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; padding: calc(var(--safe-t) + 34px) 18px calc(var(--safe-b) + 18px); background: var(--panel); border-right: 1px solid var(--line); }
.sb-logo { display: flex; align-items: center; gap: 12px; padding: 0 8px 34px; color: var(--ink); text-decoration: none; }
.sb-logo svg { width: 42px; height: 34px; fill: none; stroke: var(--gold); stroke-width: 2.2; }
.sb-logo span { font: 500 22px / 1.05 "Fraunces", Georgia, serif; letter-spacing: -.01em; }
.sb-nav { position: relative; display: flex; flex-direction: column; gap: 4px; }
.sb-ind { position: absolute; left: 0; right: 0; top: 0; height: 46px; background: var(--ink); z-index: 0; pointer-events: none; }
.sb-nav button { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; height: 46px; padding: 0 14px; font-size: 15px; font-weight: 600; color: var(--ink-2); transition: color .25s; }
.sb-nav button svg { width: 21px; height: 21px; stroke-width: 1.6; }
.sb-nav button.on { color: var(--panel); }
.sb-nav button:not(.on):hover { color: var(--ink); }
.sb-goal { margin-top: 28px; padding: 22px 14px 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; position: relative; }
.sb-goal b { font-size: 14.5px; font-weight: 700; }
.sb-goal > span:not(.gbar) { font-size: 14px; color: var(--ink-2); }
.sb-goal-step { position: absolute; right: 8px; top: 18px; display: flex; gap: 2px; opacity: 0; transition: opacity .2s; }
.sb-goal:hover .sb-goal-step, .sb-goal:focus-within .sb-goal-step { opacity: 1; }
.sb-goal-step button { width: 26px; height: 26px; border: 1px solid var(--line); font-weight: 700; color: var(--ink-2); }
.gbar { display: block; height: 6px; background: var(--soft); overflow: hidden; }
.gbar i { display: block; height: 100%; width: 0; background: var(--gold); }
.sb-me { margin-top: auto; display: flex; align-items: center; gap: 12px; padding: 16px 10px 0; border-top: 1px solid var(--line); text-align: left; color: var(--ink); }
.sb-me > svg { width: 18px; height: 18px; color: var(--ink-3); margin-left: auto; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; font-weight: 800; font-size: 15px; color: #fff; background: linear-gradient(135deg, #2E7D4F, #1C4E33); }
.sb-me-text { display: flex; flex-direction: column; min-width: 0; }
.sb-me-text b { font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-me-text small { font-size: 12.5px; color: var(--gold); font-weight: 700; }

/* ---- page header ---- */
.ph { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 30px; }
.ph h1 { margin: 0; font: 500 clamp(30px, 3.2vw, 40px) / 1.1 "Fraunces", Georgia, serif; letter-spacing: -.02em; }
.greet-name { font: inherit; color: inherit; letter-spacing: inherit; cursor: text; }
.greet-name.empty { color: var(--ink-3); font-style: italic; }
.gold-rule { display: block; width: 68px; height: 3px; background: var(--gold); margin: 14px 0 14px; transform-origin: left; }
.pg-sub { margin: 0; font-size: 16px; color: var(--ink-2); }
.head-tools { display: flex; align-items: center; gap: 6px; }
.head-tools > button:not(.btn-dark) { width: 44px; height: 44px; display: grid; place-items: center; color: var(--ink); }
.head-tools > button svg { width: 22px; height: 22px; stroke-width: 1.7; }
.head-tools > button:not(.btn-dark):hover { background: var(--soft); }
.sq-search { display: flex; align-items: center; gap: 10px; height: 44px; width: min(320px, 46vw); padding: 0 14px; background: var(--panel); border: 1px solid var(--line); color: var(--ink-3); }
.sq-search:focus-within { border-color: var(--ink); }
.sq-search svg { width: 18px; height: 18px; }
.sq-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font: 500 14.5px "Plus Jakarta Sans", sans-serif; color: var(--ink); }

/* ---- buttons ---- */
.btn-gold, .btn-dark, .btn-line { display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 46px; padding: 0 22px; font: 700 14.5px "Plus Jakarta Sans", sans-serif; white-space: nowrap; transition: background-color .2s, color .2s, transform .15s; }
.btn-gold { background: var(--gold); color: var(--gold-ink); }
.btn-gold:hover { background: #F0B12C; }
.btn-dark { background: var(--ink); color: var(--panel); }
.btn-line { border: 1px solid var(--line); color: var(--ink); background: var(--panel); }
.btn-gold:active, .btn-dark:active, .btn-line:active { transform: scale(.98); }
.btn-gold svg, .btn-dark svg { width: 19px; height: 19px; stroke-width: 1.8; }
.btn-sq { width: 46px; height: 46px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.35); color: #fff; }
.btn-sq svg { width: 20px; height: 20px; }
.btn-sq:hover { background: rgba(255,255,255,.08); }

/* ---- home ---- */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 0 34px; }
.hm { min-width: 0; display: flex; flex-direction: column; gap: 34px; }
.ha { border-left: 1px solid var(--line); padding-left: 28px; display: flex; flex-direction: column; gap: 30px; margin-top: 4px; }
.hm .ph { margin-bottom: -4px; }

/* the continue-reading card with the 3D book */
.cr { position: relative; display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: 230px; background: #1C1A17; color: #F6F1E7; overflow: hidden; box-shadow: var(--sh-2); }
.cr::before { content: ""; position: absolute; inset: 0 0 0 55%; pointer-events: none; opacity: .5;
  background: repeating-linear-gradient(115deg, rgba(255,255,255,.035) 0 2px, transparent 2px 9px), radial-gradient(120% 90% at 100% 40%, #3A2C1E, transparent 60%); }
.cr-stage { position: relative; min-height: 230px; cursor: pointer; }
.cr-stage canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; display: block; }
.cr-text { position: relative; z-index: 1; padding: 30px 32px 28px 6px; display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.cr-text small { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #C9C0AF; }
.cr-text h2 { margin: 8px 0 6px; font: 500 clamp(26px, 2.8vw, 36px) / 1.08 "Fraunces", Georgia, serif; letter-spacing: -.015em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cr-text p { margin: 0; color: #D5CDBE; font-size: 15px; }
.cr-prog { display: flex; align-items: center; gap: 16px; margin: 22px 0 22px; max-width: 360px; }
.cr-prog .gbar { flex: 1; background: rgba(255,255,255,.18); }
.cr-prog b { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cr-actions { display: flex; gap: 12px; }

/* themes */
.sec-h { display: flex; align-items: center; gap: 20px; margin-bottom: 16px; }
.sec-h h2 { margin: 0; font: 600 21px "Plus Jakarta Sans", sans-serif; letter-spacing: -.01em; margin-right: auto; }
.see { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none; }
.see svg { width: 16px; height: 16px; transition: transform .2s; }
.see:hover svg { transform: translateX(3px); }
.themes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.theme { position: relative; height: 120px; overflow: hidden; color: #fff; text-align: right; padding: 14px 16px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; box-shadow: var(--sh); }
.theme svg.art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; transition: transform .6s cubic-bezier(.3,.7,.2,1); }
.theme:hover svg.art { transform: scale(1.06); }
.theme b { position: relative; z-index: 1; font-size: 15px; font-weight: 700; line-height: 1.25; max-width: 9em; text-shadow: 0 1px 8px rgba(0,0,0,.35); }
.theme .go { position: relative; z-index: 1; width: 20px; height: 20px; stroke: #fff; }

/* library preview + tabs */
.tabs2 { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs2 button, .tabs2 .tab { height: 34px; padding: 0 14px; font: 600 14px "Plus Jakarta Sans", sans-serif; color: var(--ink-2); background: none; box-shadow: none; }
.tabs2 button.on, .tabs2 .tab.is-on { background: var(--ink); color: var(--panel); }
.prev { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 22px 18px; }
.prev-empty { grid-column: 1 / -1; color: var(--ink-3); font-size: 14.5px; padding: 26px 0; border-top: 1px solid var(--line); }

/* covers: square, crisp, barely lifted */
.shell .cv { border-radius: 0 !important; box-shadow: 0 1px 2px rgba(20,17,10,.08), 0 6px 14px -10px rgba(20,17,10,.25); transform-style: preserve-3d; will-change: transform; }
.shell .cv::after { background: linear-gradient(90deg, rgba(0,0,0,.16) 0, rgba(255,255,255,.12) 2%, transparent 6%); }
.shell .card { gap: 8px; }
.shell .card-t { font: 600 14px / 1.3 "Plus Jakarta Sans", sans-serif; }
.shell .card-a { font-size: 12.5px; }
.shell .bar { background: var(--soft); height: 4px; }
.shell .bar i { background: var(--gold); }
.shell .cv-stack .count { background: var(--gold); color: var(--gold-ink); box-shadow: none; }

/* right column */
.ha h3 { margin: 0 0 14px; font: 600 19px "Plus Jakarta Sans", sans-serif; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.nr ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.nr li { border-bottom: 1px solid var(--line); }
.nr button { width: 100%; display: grid; grid-template-columns: 64px minmax(0, 1fr) 18px; gap: 14px; align-items: center; padding: 14px 0; text-align: left; }
.nr .cv { width: 64px; }
.nr-t b { display: block; font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nr-t span { display: block; font-size: 13px; color: var(--ink-3); margin: 3px 0 12px; }
.nr-t .card-p { gap: 10px; }
.nr button > svg { width: 18px; height: 18px; color: var(--ink-3); }
.nr-empty { color: var(--ink-3); font-size: 14px; line-height: 1.5; padding: 4px 0 14px; }
.quote { position: relative; padding: 4px 0 0; overflow: hidden; }
.qmark { display: block; font: 700 54px / .6 "Fraunces", serif; color: var(--gold); height: 26px; }
.q-tw { margin: 10px 0 8px; font: italic 500 21px / 1.28 "Fraunces", Georgia, serif; }
.q-en { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.q-by { margin: 12px 0 0; font-size: 13px; color: var(--ink-3); }
.q-art { display: block; width: 100%; height: auto; margin-top: 18px; fill: none; stroke: var(--ink-2); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.q-art circle { fill: var(--ink-2); stroke: none; }
.q-art ellipse { stroke: var(--gold); }

/* ---- library page ---- */
.lib-bar { display: flex; align-items: center; gap: 12px; padding-bottom: 18px; margin-bottom: 26px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.flex1 { flex: 1; }
.shell .view-toggle { background: none; padding: 0; gap: 0; border: 1px solid var(--line); }
.shell .view-toggle button { width: 38px; height: 34px; color: var(--ink-3); }
.shell .view-toggle button.on { background: var(--ink); color: var(--panel); box-shadow: none; }
.shell .tab.sort { color: var(--ink-3); font-weight: 600; }
.shell .shelf.grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 30px 22px; }
.shelf.list { display: flex; flex-direction: column; }
.row-item { display: grid; grid-template-columns: 56px minmax(0, 2fr) minmax(0, 1fr) 160px 40px; gap: 18px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); animation: rise .35s ease both; }
.row-item .cv { width: 56px; cursor: pointer; }
.row-item b { display: block; font-size: 15px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item small { font-size: 13px; color: var(--ink-3); }
.row-item .kind { font-size: 13px; color: var(--ink-2); }
.row-item .more { width: 36px; height: 36px; display: grid; place-items: center; color: var(--ink-3); }
.row-item .more:hover { background: var(--soft); color: var(--ink); }
.shell .empty { text-align: left; max-width: 520px; margin: 30px 0; padding: 0; }
.shell .empty h2 { font: 500 30px "Fraunces", serif; }

/* ---- discover inside the shell ---- */
#discoverHost .disc-panel { height: auto; overflow: visible; padding: 0; }
#discoverHost .disc-head { position: static; background: none; padding: 0 0 14px; }
#discoverHost #btnDiscClose { display: none; }
#discoverHost .disc-search { height: 48px; background: var(--panel); box-shadow: none; border: 1px solid var(--line); }
#discoverHost .disc-shelves button { background: none; border: 1px solid var(--line); height: 36px; }
#discoverHost .disc-shelves button.on { background: var(--ink); color: var(--panel); border-color: var(--ink); }
#discoverHost .disc-note { margin: 12px 0 26px; }
#discoverHost .disc-item .get { box-shadow: none; border: 1px solid var(--line); }
#discoverHost .disc-item .get.done { background: var(--ink); color: var(--panel); border-color: var(--ink); }
#discoverHost .disc-tag { box-shadow: none; }
#discoverHost .cover { border-radius: 0; box-shadow: 0 1px 2px rgba(20,17,10,.08), 0 6px 14px -10px rgba(20,17,10,.25); }
#discoverHost .disc-callout { border-left-color: var(--gold); background: var(--panel); }
.overlay#discover::after { display: none; }

/* ---- collections ---- */
.col-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.col-card { display: flex; flex-direction: column; text-align: left; background: var(--panel); border: 1px solid var(--line); box-shadow: var(--sh); transition: border-color .2s; animation: rise .4s ease both; }
.col-card:hover { border-color: var(--ink-3); }
.col-art { position: relative; height: 170px; background: var(--soft); overflow: hidden; perspective: 900px; }
.col-art .cv { position: absolute; bottom: 18px; width: 92px; box-shadow: 0 6px 14px -8px rgba(0,0,0,.4); }
.col-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.col-body b { font: 500 19px "Fraunces", serif; }
.col-body small { font-size: 13px; color: var(--ink-3); }
.col-empty { color: var(--ink-2); line-height: 1.6; max-width: 520px; }

/* ---- highlights & notes ---- */
.hl-list, .nt-list { display: flex; flex-direction: column; gap: 34px; max-width: 880px; }
.hl-book { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 0 22px; }
.hl-book > .cv { width: 72px; position: sticky; top: 20px; align-self: start; cursor: pointer; }
.hl-head { display: flex; align-items: baseline; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.hl-head b { font: 500 20px "Fraunces", serif; }
.hl-head small { font-size: 13px; color: var(--ink-3); margin-left: auto; }
.hl-item { display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); text-align: left; width: 100%; }
.hl-item:hover { background: linear-gradient(90deg, var(--soft), transparent); }
.hl-item .sw { width: 4px; align-self: stretch; }
.hl-item q { font: italic 400 17px / 1.55 "Fraunces", Georgia, serif; color: var(--ink); }
.hl-item small { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.nt-item { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); text-align: left; width: 100%; }
.nt-item:hover { background: linear-gradient(90deg, var(--soft), transparent); }
.nt-item .ico { width: 34px; height: 34px; display: grid; place-items: center; background: var(--soft); color: var(--ink-2); flex: none; }
.nt-item .ico svg { width: 18px; height: 18px; }
.nt-item b { font-size: 14.5px; font-weight: 700; display: block; }
.nt-item span { font-size: 13px; color: var(--ink-3); }
.pg-empty { max-width: 520px; color: var(--ink-2); line-height: 1.65; font-size: 15px; padding: 30px 0; border-top: 1px solid var(--line); }
.pg-empty b { display: block; font: 500 24px "Fraunces", serif; color: var(--ink); margin-bottom: 6px; }

/* ---- sheets & overlays: square, light ---- */
.add-sheet, #seriesSheet, .sheet { box-shadow: 0 -4px 24px -12px rgba(20,17,10,.25) !important; }
.import-tray, .menu, .word-pop, .next-up, .coach-card { box-shadow: 0 4px 24px -12px rgba(20,17,10,.3) !important; }
.add-tile { border: 1px solid var(--line); }
.add-tile:first-child { background: var(--ink); color: var(--panel); border-color: var(--ink); }

/* ---- responsive ---- */
@media (max-width: 1239px) {
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .ha { border-left: 0; padding-left: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-top: 34px; border-top: 1px solid var(--line); padding-top: 30px; }
}
@media (max-width: 1023px) {
  #library.shell { grid-template-columns: 76px minmax(0, 1fr); }
  .sb { padding-inline: 12px; align-items: center; }
  .sb-logo span, .sb-nav button span, .sb-goal, .sb-me-text, .sb-me > svg { display: none; }
  .sb-logo { padding: 0 0 26px; }
  .sb-nav button { width: 52px; justify-content: center; padding: 0; }
  .sb-me { padding: 14px 0 0; }
  .themes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cr { grid-template-columns: 220px minmax(0, 1fr); }
}
@media (max-width: 720px) {
  #library.shell { grid-template-columns: minmax(0, 1fr); padding-bottom: 66px; }
  .sb { position: fixed; z-index: 30; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; padding: 4px 6px calc(var(--safe-b) + 4px); border-right: 0; border-top: 1px solid var(--line); }
  .sb-logo, .sb-me { display: none; }
  .sb-nav { flex-direction: row; width: 100%; justify-content: space-around; }
  .sb-ind { height: 3px; top: 0; }
  .sb-nav button { width: auto; flex: 1; height: 54px; flex-direction: column; gap: 3px; font-size: 10.5px; }
  .sb-nav button span { display: block; }
  .sb-nav button.on { color: var(--ink); }
  .cr { grid-template-columns: minmax(0, 1fr); }
  .cr-stage { min-height: 210px; }
  .cr-text { padding: 4px 22px 24px; }
  .ha { grid-template-columns: 1fr; }
  .row-item { grid-template-columns: 48px minmax(0, 1fr) 36px; }
  .row-item .kind, .row-item .card-p { display: none; }
  .head-tools .sq-search { width: 100%; }
  .ph { flex-direction: column; }
}

/* =========================================================================
   CLEAN PASS — typographic theme cards, one cover style, no drawings
   ========================================================================= */
.theme {
  height: auto; min-height: 148px; padding: 18px 18px 16px; text-align: left; align-items: flex-start; justify-content: flex-start; gap: 6px;
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); box-shadow: none; transition: border-color .2s, background-color .2s;
}
.theme:hover { border-color: var(--ink); }
.theme small { font-size: 12px; font-weight: 700; color: var(--gold); letter-spacing: .08em; }
.theme b { font: 500 19px / 1.15 "Fraunces", Georgia, serif; max-width: none; text-shadow: none; color: var(--ink); }
.theme span { font-size: 13px; line-height: 1.45; color: var(--ink-3); }
.theme .go { margin-top: auto; align-self: flex-end; stroke: var(--ink); width: 18px; height: 18px; transition: transform .25s; }
.theme:hover .go { transform: translateX(4px); }

.gc-plain { padding: 12cqw 11cqw 10cqw; display: flex; flex-direction: column; }
.gc-plain .gc-title { font: 500 13cqw / 1.08 "Fraunces", Georgia, serif; letter-spacing: -.01em; color: var(--fg); -webkit-line-clamp: 5; }
.gc-plain .gc-rule { display: block; width: 18cqw; height: 1.1cqw; background: var(--ac); margin: 7cqw 0 0; }
.gc-plain .gc-author { margin-top: auto; font: 600 5.4cqw / 1.3 "Plus Jakarta Sans", sans-serif; letter-spacing: .08em; text-transform: uppercase; color: var(--fg); opacity: .8; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.quote { padding: 22px 0 0; border-top: 0; }
.q-tw { font-size: 22px; }
.shell .bar i, .shell .card-p .bar i { background: var(--gold) !important; }
.shell .card-p small { color: var(--ink-3); }

/* ---- overlap fixes ---- */
.sb-ind { will-change: transform; }
@media (max-width: 1023px) and (min-width: 721px) { .sb-nav { align-items: center; } }
@media (max-width: 720px) {
  .sec-h { flex-wrap: wrap; row-gap: 10px; }
  .sec-h h2 { flex: 1 1 auto; }
  .sec-h .tabs2 { order: 3; width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .sec-h .tabs2 button { flex: none; }
  .ph { gap: 10px; margin-bottom: 22px; }
  .ph .head-tools { position: absolute; top: calc(var(--safe-t) + 26px); right: 14px; }
  .pg { position: relative; }
  .ph h1 { padding-right: 96px; }
  #library.shell .lib-bar { gap: 8px; }
  .lib-bar .tabs2 { width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .lib-bar .tabs2 .tab { flex: none; }
  .ph .sq-search { width: calc(100vw - 40px); }
  .pg[data-page="library"] .ph .head-tools, .pg[data-page="highlights"] .ph .head-tools { position: static; }
  .pg[data-page="library"] .ph h1, .pg[data-page="highlights"] .ph h1 { padding-right: 0; }
}
@media (max-width: 720px) {
  .pg[data-page="library"] .ph .head-tools, .pg[data-page="highlights"] .ph .head-tools { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .pg[data-page="library"] .ph .sq-search, .pg[data-page="highlights"] .ph .sq-search { width: auto; }
  .pg[data-page="library"] .ph .btn-dark { width: 46px; padding: 0; }
  .pg[data-page="library"] .ph .btn-dark span { display: none; }
  .pg[data-page="collections"] .ph .btn-dark span { display: none; }
  .pg[data-page="collections"] .ph .btn-dark { width: 46px; padding: 0; }
}

/* =========================================================================
   HAND-DRAWN — sketchy icons that "boil", doodles, scribbled notes
   ========================================================================= */
svg.hd { overflow: visible; }
svg.hd .hd-take { opacity: 0; }
svg.hd .hd-0 { opacity: 1; }
svg.hd path { stroke-linecap: round; stroke-linejoin: round; }
@keyframes hdBoil { 0% { opacity: 1; } 33.33% { opacity: 1; } 33.34% { opacity: 0; } 100% { opacity: 0; } }
:is(button, a, .theme, .nav):hover > svg.hd .hd-take,
:is(button, a, .theme):hover svg.hd.doodle-sm .hd-take,
:is(button, a):active > svg.hd .hd-take,
.sb-nav button.on > svg.hd .hd-take,
svg.hd.doodle .hd-take, .boil svg.hd .hd-take { animation: hdBoil .45s infinite; }
svg.hd .hd-1 { animation-delay: -.3s !important; }
svg.hd .hd-2 { animation-delay: -.15s !important; }
@media (prefers-reduced-motion: reduce) { svg.hd .hd-take { animation: none !important; } svg.hd .hd-0 { opacity: 1 !important; } }

/* doodles */
.doodle { display: block; width: 100%; max-width: 230px; height: auto; color: var(--ink-2); fill: none; }
.doodle .gold, .doodle-sm .gold { color: var(--gold); }
.doodle .mark path { stroke: var(--gold); stroke-width: 9; opacity: .45; }
.doodle-sm { width: 46px; height: 46px; color: var(--ink-3); fill: none; transition: color .25s; }
.scribble { margin: 0; font: 600 23px / 1.1 "Caveat", "Segoe Print", cursive; color: var(--gold); transform: rotate(-2deg); }

/* page titles get a hand-drawn underline that draws itself */
.hd-rule { display: block; width: 96px; height: 14px; margin: 8px 0 12px; fill: none; stroke: var(--gold); stroke-width: 2.6; stroke-linecap: round; overflow: visible; }

/* empty states with a doodle */
.doodled { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 6px 28px; align-items: center; border-top: 1px solid var(--line); padding: 30px 0; max-width: 680px; }
.doodled .doodle { grid-row: 1 / span 3; }
.doodled b { font: 500 24px "Fraunces", serif; color: var(--ink); }
.doodled span { color: var(--ink-2); line-height: 1.6; font-size: 15px; }
.prev-empty.doodled, .nr .doodled { grid-template-columns: 140px minmax(0, 1fr); padding: 18px 0; }
.nr .doodled { grid-template-columns: 1fr; border-top: 0; }
.nr .doodled .doodle { max-width: 170px; grid-row: auto; }
@media (max-width: 720px) { .doodled { grid-template-columns: 1fr; } .doodled .doodle { grid-row: auto; max-width: 180px; } }

/* theme cards carry a doodle */
.theme { position: relative; }
.theme .doodle-sm { position: absolute; top: 14px; right: 14px; }
.theme:hover .doodle-sm { color: var(--gold); }
.themes { grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); }
.theme b { padding-right: 46px; }

/* sidebar name: never cut off */
.sb-me-text b { white-space: normal; line-height: 1.2; }
.shell .empty .doodle { margin-bottom: 8px; }

/* hand-drawn lines take their colour from `color`, not `stroke` */
.sb-logo svg { color: var(--gold); }
.theme .go { color: var(--ink); }

/* =========================================================================
   PROFILE & SYNC
   ========================================================================= */
.prof-sheet { z-index: 58; }
#profScrim { z-index: 57; }
.sync-box { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 4px 22px; align-items: start; }
.sync-box .doodle { grid-row: 1 / span 6; max-width: 150px; }
.sync-box h3 { margin: 0; font: 500 21px "Fraunces", serif; }
.sync-box p { margin: 4px 0 8px; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.sync-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.sync-code { display: flex; align-items: center; gap: 10px; margin: 6px 0 4px; }
.sync-code code { font: 700 19px / 1 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .06em; padding: 12px 14px; background: var(--soft); border: 1px dashed var(--ink-3); user-select: all; word-break: break-all; }
.sync-status { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 700; color: var(--ink-2); }
.sync-status i { width: 9px; height: 9px; border-radius: 50% !important; background: var(--ink-3); }
.sync-status.ok i { background: var(--green); }
.sync-status.syncing i { background: var(--gold); animation: pulse 1s ease-in-out infinite; }
.sync-status.error i { background: var(--red); }
@keyframes pulse { 50% { opacity: .3; } }
.sync-link { display: flex; gap: 8px; margin-top: 8px; }
.sync-link input { flex: 1; min-width: 0; height: 46px; padding: 0 14px; border: 1px solid var(--line); background: var(--panel); font: 700 15px ui-monospace, Consolas, monospace; letter-spacing: .05em; color: var(--ink); text-transform: uppercase; outline: 0; }
.sync-link input:focus { border-color: var(--ink); }
.sync-warn { font-size: 12.5px !important; color: var(--ink-3) !important; }
@media (max-width: 720px) { .sync-box { grid-template-columns: 1fr; } .sync-box .doodle { grid-row: auto; max-width: 140px; } }

/* =========================================================================
   HANDWRITTEN TYPE — the whole interface is written by hand.
   (The text inside books keeps proper book typography.)
   ========================================================================= */
.ww { display: inline-block; white-space: pre; will-change: clip-path, transform; }
body:not(.ui-print) :is(.shell, #discover, #seriesView, .add-sheet, .import-tray, .menu, .bindery, .toast, #seriesSheet, #profSheet,
    #reader .hud, #reader .sheet, #reader .drawer, #reader .word-pop, #reader .coach-card, #reader .next-up, #reader .scrub-peek, #reader .pen-bar),
body:not(.ui-print) :is(.shell, #discover, #seriesView, .add-sheet, .import-tray, .menu, .bindery, .toast, #seriesSheet, #profSheet,
    #reader .hud, #reader .sheet, #reader .drawer, #reader .word-pop, #reader .coach-card, #reader .next-up, #reader .scrub-peek) * {
  font-family: "Kalam", "Segoe Print", "Comic Neue", cursive !important;
}
/* big titles in a looser pen */
:is(body:not(.ui-print)) :is(.ph h1, .cr-text h2, .sv-title input, .add-head h2, .bind-status, .empty h2, .coach-card h3, .pop-word, .hud-title strong, #reader .drawer-tabs button.on) {
  font-family: "Caveat", "Kalam", cursive !important; font-weight: 700 !important; letter-spacing: 0 !important;
}
.ph h1 { font-size: clamp(42px, 4.4vw, 56px) !important; line-height: 1 !important; }
.cr-text h2 { font-size: clamp(34px, 3.4vw, 46px) !important; line-height: 1 !important; }
.add-head h2, .empty h2 { font-size: 34px !important; }
.sec-h h2, .ha h3 { font-weight: 700 !important; font-size: 22px !important; }
.theme b, .col-body b, .hl-head b, .doodled b, .nr-t b, .card-t, .pop-t, .row-item b { font-weight: 700 !important; }
.doodled b { font-size: 24px !important; }
.q-tw { font-size: 23px !important; font-weight: 400; }
.hl-item q { font-size: 17px !important; }
.sb-nav button { font-size: 16px; font-weight: 400; }
.sb-nav button.on { font-weight: 700; }
.btn-gold, .btn-dark, .btn-line, .tabs2 button, .tabs2 .tab { font-weight: 700 !important; }
/* keep these in their own type */
.shell .gc .gc-title, .gc .gc-title { font-family: "Fraunces", Georgia, serif !important; }
.shell .gc .gc-author, .gc .gc-author { font-family: "Plus Jakarta Sans", sans-serif !important; }
.sync-code code, .sync-link input { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace !important; }
.scribble { font-family: "Caveat", cursive !important; }

/* =========================================================================
   NO BOXES — hand-drawn frames, marker highlights, plain written chips
   ========================================================================= */
.sk-on { isolation: isolate; border-color: transparent !important; box-shadow: none !important; background: transparent !important; }
.sk-frame { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none; overflow: visible; color: var(--sk-line, var(--ink-2)); }
.sk-frame path { stroke-linecap: round; stroke-linejoin: round; }
/* what each frame is filled with, and its line colour */
.theme, .col-card, .sq-search, #discoverHost .disc-search, .find-field, .add-tile, .btn-line, .disc-item .get, .sync-code code, .stepper button, .sb-goal-step button, .row-item .more { --sk-fill: var(--panel); --sk-line: var(--ink-2); }
.btn-gold { --sk-fill: var(--gold); --sk-line: #A9740F; }
.btn-dark, .sb-ind, .disc-item .get.done { --sk-fill: var(--ink); --sk-line: var(--ink); }
.btn-sq { --sk-fill: transparent; --sk-line: rgba(255, 255, 255, .7); }
.add-tile:first-child { --sk-fill: var(--ink); --sk-line: var(--ink); }
.sb-ind { background: transparent !important; }
/* the moving ink swatch behind the current page */
.sb-ind .sk-frame { inset: -2px -3px; width: calc(100% + 6px); height: calc(100% + 4px); }
/* hover: the frame boils */
:is(.theme, .col-card, .btn-line, .btn-gold, .btn-dark, .btn-sq, .add-tile, .disc-item .get):hover > .sk-frame .hd-take { animation: hdBoil .45s infinite; }

/* chips & tabs: written words, the chosen one swiped with a marker */
.tabs2 button, .tabs2 .tab, #discoverHost .disc-shelves button, .seg button, .drawer-tabs button, .shell .view-toggle button, .chips .tab {
  background: none !important; border: 0 !important; box-shadow: none !important; color: var(--ink-2) !important;
  padding: 0 12px !important;
}
.shell .view-toggle, .seg, .drawer-tabs { border: 0 !important; background: none !important; box-shadow: none !important; }
.tabs2 button.on, .tabs2 .tab.is-on, #discoverHost .disc-shelves button.on, .seg button.on, .drawer-tabs button.on, .shell .view-toggle button.on, .chips .tab.is-on {
  color: #1A1408 !important;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 32' preserveAspectRatio='none'%3E%3Cpath d='M5 9 C 22 3, 58 2, 94 6 C 99 7, 100 20, 96 25 C 70 30, 32 31, 7 27 C 1 26, 0 13, 5 9 Z' fill='%23E3A21A' fill-opacity='.7'/%3E%3Cpath d='M9 24 C 36 27, 70 26, 93 21' stroke='%23C98A0E' stroke-width='1.2' fill='none' stroke-linecap='round' opacity='.6'/%3E%3C/svg%3E") center / 100% 86% no-repeat !important;
}
.tabs2 button:not(.on):hover, #discoverHost .disc-shelves button:not(.on):hover, .seg button:not(.on):hover, .tabs2 .tab:not(.is-on):hover {
  color: var(--ink) !important; text-decoration: underline wavy var(--gold) 1.5px; text-underline-offset: 6px;
}
.shell .view-toggle button svg { width: 19px; height: 19px; }
.sk-on:not(.sb-ind) { position: relative; }
/* frames always fill their element, whatever icon sizing a button applies to its svgs */
svg.sk-frame { width: 100% !important; height: 100% !important; inset: 0 !important; stroke-width: initial; }
.sb-ind svg.sk-frame { inset: -2px -3px !important; width: calc(100% + 6px) !important; height: calc(100% + 4px) !important; }

/* the chosen chip sits on a dry-brush stroke */
.tabs2 button.on, .tabs2 .tab.is-on, #discoverHost .disc-shelves button.on, .seg button.on, .drawer-tabs button.on, .shell .view-toggle button.on, .chips .tab.is-on {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 36' preserveAspectRatio='none'%3E %3Cdefs%3E %3Cfilter id='r' x='-6%25' y='-30%25' width='112%25' height='160%25'%3E %3CfeTurbulence type='fractalNoise' baseFrequency='0.035 0.8' numOctaves='2' seed='7'/%3E %3CfeDisplacementMap in='SourceGraphic' scale='5.5' xChannelSelector='R' yChannelSelector='G'/%3E %3C/filter%3E %3Cmask id='m'%3E %3Crect width='120' height='36' fill='white'/%3E %3Cpath d='M62 14.5 C 82 13.5, 100 14.5, 117 17' stroke='black' stroke-width='1.1' fill='none'/%3E %3Cpath d='M78 23.5 C 94 23.5, 106 22.5, 117 21' stroke='black' stroke-width='.9' fill='none'/%3E %3Cpath d='M96 18.5 C 104 18.3, 110 18.6, 117 19.4' stroke='black' stroke-width='.7' fill='none'/%3E %3Cpath d='M3 23 C 8 23.2, 13 23.8, 19 24.6' stroke='black' stroke-width='.8' fill='none'/%3E %3C/mask%3E %3C/defs%3E %3Cg filter='url%28%23r%29' mask='url%28%23m%29'%3E %3Cpath d='M2.5 19 C 6 12.5, 18 9.5, 38 8.6 C 62 7.6, 92 8.2, 112 10.8 C 117.5 11.6, 119 15, 117.6 19.5 C 116.4 24, 113 26.6, 106 27.4 C 84 29.6, 52 30.6, 24 29.4 C 12 28.9, 4.5 27.6, 2.5 24 Z' fill='%23E3A21A' fill-opacity='.88'/%3E %3Cpath d='M7 13.6 C 38 10.6, 80 10.4, 113 12.8' stroke='%23B8790A' stroke-width='1.1' fill='none' opacity='.55'/%3E %3Cpath d='M5 25.2 C 40 23.4, 82 24, 114 22.2' stroke='%23F4C764' stroke-width='1.5' fill='none' opacity='.65'/%3E %3Cpath d='M12 19.4 C 44 17.6, 76 18.4, 110 17.2' stroke='%23A86E06' stroke-width='.6' fill='none' opacity='.45'/%3E %3Cpath d='M20 16.2 C 50 14.6, 86 15, 108 15.6' stroke='%23F6D27F' stroke-width='.8' fill='none' opacity='.5'/%3E %3C/g%3E %3C/svg%3E") center / 112% 100% no-repeat !important;
  padding: 0 16px !important;
}

/* the chosen chip sits on a dry-brush stroke */
.tabs2 button.on, .tabs2 .tab.is-on, #discoverHost .disc-shelves button.on, .seg button.on, .drawer-tabs button.on, .shell .view-toggle button.on, .chips .tab.is-on {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 36' preserveAspectRatio='none'%3E %3Cdefs%3E %3Cfilter id='r' x='-6%25' y='-30%25' width='112%25' height='160%25'%3E %3CfeTurbulence type='fractalNoise' baseFrequency='0.035 0.8' numOctaves='2' seed='7'/%3E %3CfeDisplacementMap in='SourceGraphic' scale='5.5' xChannelSelector='R' yChannelSelector='G'/%3E %3C/filter%3E %3Cmask id='m'%3E %3Crect width='120' height='36' fill='white'/%3E %3Cpath d='M62 14.5 C 82 13.5, 100 14.5, 117 17' stroke='black' stroke-width='1.1' fill='none'/%3E %3Cpath d='M78 23.5 C 94 23.5, 106 22.5, 117 21' stroke='black' stroke-width='.9' fill='none'/%3E %3Cpath d='M96 18.5 C 104 18.3, 110 18.6, 117 19.4' stroke='black' stroke-width='.7' fill='none'/%3E %3Cpath d='M3 23 C 8 23.2, 13 23.8, 19 24.6' stroke='black' stroke-width='.8' fill='none'/%3E %3C/mask%3E %3C/defs%3E %3Cg filter='url%28%23r%29' mask='url%28%23m%29'%3E %3Cpath d='M2.5 19 C 6 12.5, 18 9.5, 38 8.6 C 62 7.6, 92 8.2, 112 10.8 C 117.5 11.6, 119 15, 117.6 19.5 C 116.4 24, 113 26.6, 106 27.4 C 84 29.6, 52 30.6, 24 29.4 C 12 28.9, 4.5 27.6, 2.5 24 Z' fill='%23E3A21A' fill-opacity='.88'/%3E %3Cpath d='M7 13.6 C 38 10.6, 80 10.4, 113 12.8' stroke='%23B8790A' stroke-width='1.1' fill='none' opacity='.55'/%3E %3Cpath d='M5 25.2 C 40 23.4, 82 24, 114 22.2' stroke='%23F4C764' stroke-width='1.5' fill='none' opacity='.65'/%3E %3Cpath d='M12 19.4 C 44 17.6, 76 18.4, 110 17.2' stroke='%23A86E06' stroke-width='.6' fill='none' opacity='.45'/%3E %3Cpath d='M20 16.2 C 50 14.6, 86 15, 108 15.6' stroke='%23F6D27F' stroke-width='.8' fill='none' opacity='.5'/%3E %3C/g%3E %3C/svg%3E") center / 112% 100% no-repeat !important;
  padding: 0 16px !important;
}

/* =========================================================================
   RESPONSIVE — laptop, tablet landscape, tablet portrait, phone
   ========================================================================= */
/* the 3D card adapts to its own width, not the screen's */
.hm { container-type: inline-size; container-name: hm; }
@container hm (max-width: 640px) {
  .cr { grid-template-columns: minmax(0, 1fr) !important; }
  .cr-stage { min-height: 220px; }
  .cr-text { padding: 0 24px 24px !important; }
  .cr-text h2 { font-size: 34px !important; }
}
@container hm (min-width: 641px) and (max-width: 760px) {
  .cr { grid-template-columns: 230px minmax(0, 1fr) !important; }
}

/* tablet landscape & small laptops: the right column moves below the main one */
@media (min-width: 1024px) and (max-width: 1439px) {
  #library.shell { grid-template-columns: 216px minmax(0, 1fr); }
  .sb { padding-left: 14px; padding-right: 14px; }
  .sb-logo span { font-size: 20px; }
  .home-grid { grid-template-columns: minmax(0, 1fr) !important; }
  .ha { border-left: 0 !important; padding-left: 0 !important; margin-top: 30px !important; padding-top: 26px;
        border-top: 1px solid var(--line); display: grid !important; grid-template-columns: 1fr 1fr; gap: 34px; }
  .pg { padding-left: clamp(22px, 2.4vw, 36px); padding-right: clamp(22px, 2.4vw, 36px); }
}
/* big screens: everything side by side, with room to breathe */
@media (min-width: 1440px) {
  .home-grid { grid-template-columns: minmax(0, 1fr) 320px; }
  .pg { padding-left: 48px; padding-right: 48px; }
}
/* tablet portrait */
@media (min-width: 721px) and (max-width: 1023px) {
  .ha { grid-template-columns: 1fr 1fr !important; }
  .themes { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
/* phones */
@media (max-width: 720px) {
  .themes { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .theme { min-height: 140px; padding: 14px; }
  .theme .doodle-sm { width: 36px; height: 36px; top: 10px; right: 10px; }
  .pg { padding-left: 16px; padding-right: 16px; }
  .ph h1 { font-size: 40px !important; }
  .shell .shelf.grid, .prev { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)) !important; gap: 20px 12px !important; }
}
/* very small phones */
@media (max-width: 380px) {
  .themes { grid-template-columns: minmax(0, 1fr) !important; }
  .sb-nav button { font-size: 9.5px !important; }
}

/* opening / closing a book: the lifted cover */
.open-layer .op-ghost { position: fixed; z-index: 60; transform-origin: 50% 60%; will-change: transform, opacity; box-shadow: 0 22px 40px -18px rgba(0, 0, 0, .45); }
.open-layer .op-ghost .cover { position: absolute; inset: 0; width: 100%; height: 100%; aspect-ratio: auto; border-radius: 2px 5px 5px 2px !important; box-shadow: none; }
#reader { will-change: clip-path; }

/* ---- the Sankofa pattern on the Continue-reading card ---- */
.cr::before { display: none !important; }
.cr-pattern { position: absolute; inset: 0 0 0 40%; pointer-events: none; color: var(--gold); opacity: .2; z-index: 0; overflow: hidden; }
.cr-pattern span { position: absolute; display: block; }
.cr-pattern svg { display: block; width: 100%; height: auto; fill: none; overflow: visible; }
.cr-pattern svg.hd .hd-take, .q-sk svg.hd .hd-take { animation: hdBoil 1.2s infinite; }
.cr-pattern svg.hd .hd-1, .q-sk svg.hd .hd-1 { animation-delay: -.8s !important; }
.cr-pattern svg.hd .hd-2, .q-sk svg.hd .hd-2 { animation-delay: -.4s !important; }
.cr-text, .cr-stage { position: relative; z-index: 1; }
.q-sk { float: right; width: 62px; color: var(--gold); margin: -4px 0 6px 10px; }
.q-sk svg { width: 100%; height: auto; fill: none; }
/* a drawn book where 3D isn't available */
.cr-flat { position: absolute; inset: 0; display: grid; place-items: center; perspective: 900px; }
.cr-flat .cv { width: 118px; transform: rotateY(-16deg) rotateX(4deg); box-shadow: 10px 16px 26px -10px rgba(0,0,0,.6); animation: crFloat 4s ease-in-out infinite; }
.cr-flat-empty { width: 118px; aspect-ratio: 2 / 3; background: #2E4A3A; transform: rotateY(-16deg); animation: crFloat 4s ease-in-out infinite; }
@keyframes crFloat { 50% { transform: rotateY(-10deg) rotateX(2deg) translateY(-6px); } }
.seg button[data-font="hand"] { font-family: "Kalam", cursive !important; }
/* covers & codes keep their own type, whatever the lettering setting (ids out-rank the handwriting rule) */
:is(#library, #discover, #seriesView, #openLayer, #profSheet, #reader) .gc .gc-title { font-family: "Fraunces", Georgia, serif !important; }
:is(#library, #discover, #seriesView, #openLayer, #profSheet, #reader) .gc .gc-author { font-family: "Plus Jakarta Sans", sans-serif !important; }
:is(#profSheet) .sync-code code, :is(#profSheet) .sync-link input { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace !important; }

/* ---- the hand-drawn loader ---- */
.hd-loader { display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--ink-2); text-align: center; }
.hl-art { position: relative; width: 132px; aspect-ratio: 120 / 80; }
.hd-loader-sm .hl-art { width: 92px; }
.hd-loader-lg .hl-art { width: 180px; }
.hl-art svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; }
.hl-book .hd-take { animation: hdBoil .45s infinite !important; }
.hl-ink path { stroke: var(--gold, #C9971C); stroke-width: 1.5; stroke-dasharray: 1 1; stroke-dashoffset: 1; opacity: .85;
  animation: hlWrite 2.6s cubic-bezier(.5, 0, .3, 1) infinite; animation-delay: var(--d); }
@keyframes hlWrite { 0% { stroke-dashoffset: 1; opacity: .85; } 30%, 80% { stroke-dashoffset: 0; opacity: .85; } 100% { stroke-dashoffset: 0; opacity: 0; } }
.hl-leaf { fill: var(--desk, #F5F3EE); stroke-width: 1.6; transform-box: view-box; transform-origin: 60px 40px;
  opacity: 0; animation: hlFlip 2.1s cubic-bezier(.55, .05, .35, 1) infinite; animation-delay: calc(var(--i) * .7s); }
@keyframes hlFlip {
  0% { transform: scaleX(1) skewY(0); opacity: 0; }
  6% { opacity: 1; transform: scaleX(.98) skewY(-1deg); }
  30% { transform: scaleX(.35) skewY(-7deg); }
  50% { transform: scaleX(-.4) skewY(6deg); }
  66% { transform: scaleX(-1) skewY(0); opacity: 1; }
  78%, 100% { transform: scaleX(-1); opacity: 0; }
}
.hl-text { margin: 0; font: 500 22px "Caveat", "Kalam", cursive; color: var(--ink); letter-spacing: .01em; }
.hd-loader-sm .hl-text { font-size: 18px; }
.hl-dots b { display: inline-block; font-weight: 700; animation: hlDot 1.2s infinite; }
.hl-dots b:nth-child(2) { animation-delay: .15s; } .hl-dots b:nth-child(3) { animation-delay: .3s; }
@keyframes hlDot { 0%, 60%, 100% { transform: translateY(0); opacity: .35; } 30% { transform: translateY(-4px); opacity: 1; } }
body.ui-print .hl-text { font-family: inherit; font-size: 15px; }
@media (prefers-reduced-motion: reduce) {
  .hl-leaf { animation: none; } .hl-ink path { animation: none; stroke-dashoffset: 0; } .hl-dots b { animation: none; opacity: 1; }
}

/* the veil while a book is being opened */
.open-veil { position: fixed; inset: 0; z-index: 64; display: grid; place-items: center; pointer-events: none;
  background: color-mix(in srgb, var(--desk, var(--bg)) 70%, transparent); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .25s ease; }
.open-veil.on { opacity: 1; pointer-events: auto; }
.open-veil .hl-text { max-width: min(80vw, 420px); }

/* a pen scribble spinning inside busy buttons */
.pen-spin { width: 1.05em; height: 1.05em; vertical-align: -.15em; margin-right: 6px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round;
  stroke-dasharray: .7 .3; animation: penSpin .9s linear infinite; }
@keyframes penSpin { to { transform: rotate(360deg); } }
.pen-spin { transform-origin: 50% 50%; }

/* Discover: sketched placeholder covers instead of grey boxes */
.disc-loading { padding: 26px 0 14px !important; }
.disc-skel { display: flex; flex-direction: column; gap: 8px; color: var(--line-2, color-mix(in srgb, var(--ink) 22%, transparent)); animation: rise .4s var(--ease-paper) both, skPulse 1.6s ease-in-out infinite; }
.disc-skel svg { width: 100%; height: auto; overflow: visible; fill: none; stroke: currentColor; }
.disc-skel svg .hd-take { animation: hdBoil .6s infinite; }
@keyframes skPulse { 50% { opacity: .45; } }

/* empty panels always take the full row, wherever they sit */
:is(.col-grid, .shelf, .prev-row, .disc-grid) > .doodled { grid-column: 1 / -1; }
.col-grid > .doodled { max-width: 720px; }
.tray-thumb .pen-spin { margin: 0; width: 22px; height: 22px; color: var(--gold, #C9971C); }
