/* Handwritten notebooks (assets/notebook.js): the split pane / full screen, pages, menus, My notes cards. */
body.nb-split { --nbw: 50vw; }
body.nb-split > main { margin-right: var(--nbw); transition: margin-right .35s cubic-bezier(0.32, 0.72, 0, 1); }
body.nb-resizing > main { transition: none; }
body.nb-resizing { cursor: col-resize; -webkit-user-select: none; user-select: none; }
body.nb-split .mn-tab, body.nb-split .syl-tab { right: calc(var(--nbw) + 0px); }
body.nb-full > main { visibility: hidden; }

.nbx { position: fixed; top: 76px; bottom: 0; right: 0; z-index: 150; display: flex; flex-direction: column; background: var(--soft, #F3F4F6); color: var(--paper); box-shadow: -1px 0 0 rgba(var(--fg-rgb), .08), -24px 0 40px -30px rgba(0, 0, 0, .35); transform: translateX(30px); opacity: 0; transition: transform .4s cubic-bezier(0.32, 0.72, 0, 1), opacity .25s; }
.nbx.is-in { transform: none; opacity: 1; }
.nbx--split { width: var(--nbw); }
.nbx--full { left: 0; }
.nbx--embed { position: relative; top: auto; bottom: auto; right: auto; z-index: auto; box-shadow: none; transform: none; opacity: 1; background: var(--navy, #F3F4F6); }
.nbx--embed .nbx__h { padding: 8px 10px; }
.nbx--embed .nbx__name { font-size: 14.5px; flex-basis: 80px; }
.nbx--embed .nbx__row { min-width: 0; }
.nbx--embed .nbx__st { display: none; }
.nbx--embed .nbx__h, .nbx--embed .nbx__tools { min-width: 0; }
.nbx--embed .nbx__scroll { padding: 14px 12px 30px; }
@media (max-width: 1300px) { .nbx--embed .nbx-tb__zoom { display: none; } }
@media (max-width: 920px) { .nbx { top: 66px; } }
.nbx__drag { position: absolute; left: -6px; top: calc(50% + 26px); height: 100px; width: 12px; cursor: col-resize; z-index: 3; touch-action: none; }
.nbx__drag::after { content: ""; position: absolute; left: 4px; top: 50%; width: 4px; height: 44px; margin-top: -22px; border-radius: 4px; background: rgba(var(--fg-rgb), .22); transition: background .2s, height .2s; }
.nbx__drag:hover::after { background: var(--orange); height: 64px; margin-top: -32px; }

.nbx__h { flex: none; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; background: var(--card, #fff); border-bottom: 1px solid rgba(var(--fg-rgb), .08); }
.nbx__row { display: flex; align-items: center; gap: 4px; min-width: 0; }
.nbx__ib { flex: none; width: 34px; height: 34px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; text-decoration: none; }
.nbx__ib:hover { background: rgba(var(--fg-rgb), .07); color: var(--paper); }
.nbx__ib svg { width: 18px; height: 18px; }
.nbx__name { flex: 1 1 140px; min-width: 60px; height: 34px; padding: 0 8px; border: 0; border-radius: 9px; background: none; color: var(--paper); font: inherit; font-size: 16px; font-weight: 800; letter-spacing: -.01em; text-overflow: ellipsis; }
.nbx__name:hover { background: rgba(var(--fg-rgb), .05); }
.nbx__name:focus { outline: none; background: rgba(var(--fg-rgb), .06); box-shadow: inset 0 0 0 1.5px var(--orange); }
.nbx__st { flex: none; font-size: 11.5px; font-weight: 600; color: var(--faint); white-space: nowrap; }
.nbx__st.is-local { color: #B4621F; }
.nbx__sp { flex: 1 1 0; }
.nbx__pg { flex: none; padding: 0 6px; font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.nbx__zoom { flex: none; display: inline-flex; align-items: center; border-radius: 10px; background: rgba(var(--fg-rgb), .05); }
.nbx__zoom .nbx__ib { width: 30px; }
.nbx__zv { min-width: 46px; height: 30px; padding: 0; border: 0; background: none; color: var(--paper); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; }
.nbx__peek { display: none; }
.nbx__tools .ink-bar { padding: 4px; }
.nbx__tools .ink-b { width: 34px; height: 34px; }
/* the page controls on the toolbar's right (owner, 2026-10-26) */
/* when it doesn't fit (laptops, iPads) the page controls wrap onto a second row instead of hiding off the edge */
.nbx__tools .ink-bar { flex-wrap: wrap; overflow: visible; row-gap: 4px; }
.nbx__tools .ink-bar__x { margin-left: auto; padding-left: 8px; border-left: 1px solid rgba(255, 255, 255, .12); gap: 2px; }
.nbx-tb__pg { padding: 0 6px; font-size: 12px; font-weight: 700; color: rgba(255, 255, 255, .7); font-variant-numeric: tabular-nums; white-space: nowrap; }
.nbx-tb__zoom { display: inline-flex; align-items: center; border-radius: 12px; background: rgba(255, 255, 255, .08); }
.nbx-tb__zoom .ink-b { width: 30px; }
.nbx-tb__zv { min-width: 44px; height: 30px; padding: 0; border: 0; background: none; color: #fff; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums; }
.nbx-tb.is-on { background: rgba(255, 255, 255, .16); }
/* the strip behind the bar's notch is the notebook's own white, not the page colour (owner, 2026-10-26) */
.nbx:not(.nbx--embed)::before { content: ""; position: absolute; left: 0; right: 0; bottom: 100%; height: 80px; background: var(--card, #fff); pointer-events: none; }

.nbx__scroll { flex: 1; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 18px 20px 40px; }
.nbx__pages { display: flex; flex-direction: column; align-items: center; gap: 6px; width: max-content; min-width: 100%; margin: 0 auto; }
.nbx__load { padding: 60px 0; color: var(--muted); font-weight: 600; }
.nb-pw { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.nb-page { position: relative; width: var(--pw, 600px); height: var(--ph, 848px); border-radius: 4px; overflow: hidden; box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 12px 30px -18px rgba(0, 0, 0, .35); background: #fff; }
.nb-tpl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.nb-page .ink { z-index: 1; }
.nb-pf { display: flex; align-items: center; gap: 4px; margin-bottom: 14px; font-size: 12px; font-weight: 600; color: var(--muted); }
.nb-pf select { height: 28px; padding: 0 6px; border: 0; border-radius: 8px; background: rgba(var(--fg-rgb), .06); color: var(--paper); font: inherit; font-size: 12px; font-weight: 600; }
.nb-pf button { width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.nb-pf button:hover { background: rgba(var(--fg-rgb), .07); color: var(--paper); }
.nb-pf button svg { width: 15px; height: 15px; }
.nbx__add { display: flex; align-items: center; gap: 8px; margin: 4px auto 0; height: 44px; padding: 0 20px; border: 2px dashed rgba(var(--fg-rgb), .2); border-radius: 14px; background: none; color: var(--muted); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.nbx__add:hover { border-color: var(--orange); color: var(--orange); }
.nbx__add svg { width: 17px; height: 17px; }

/* menus: paper and templates, your notebooks */
.nbx-pop { position: fixed; z-index: 330; width: min(340px, calc(100vw - 20px)); max-height: calc(100vh - 100px); overflow: auto; padding: 12px; border-radius: 18px; background: var(--card, #fff); color: var(--paper); box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .45), 0 0 0 1px rgba(var(--fg-rgb), .08); }
.nbx-pop__h { margin: 10px 4px 6px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.nbx-pop__h:first-child { margin-top: 2px; }
.nbx-tpls { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.nbx-tpls button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 2px; border: 0; border-radius: 10px; background: none; color: var(--paper); font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; }
.nbx-tpls button.is-on { background: rgba(227, 114, 57, .12); color: var(--orange); }
.nbx-tpls__pic { position: relative; width: 46px; height: 65px; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px rgba(var(--fg-rgb), .14); }
.nbx-tpls__pic svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.nbx-pop__all { display: flex; align-items: center; gap: 6px; margin: 8px 4px 0; font-size: 12.5px; color: var(--muted); }
.nbx-seg { display: flex; flex-wrap: wrap; gap: 4px; }
.nbx-seg button { flex: 1 1 auto; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 10px; border: 0; border-radius: 10px; background: rgba(var(--fg-rgb), .06); color: var(--paper); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.nbx-seg button.is-on { background: var(--ink, #0E0E10); color: #fff; }
html[data-theme="dark"] .nbx-seg button.is-on { background: var(--orange); }
.nbx-seg button i { width: 14px; height: 14px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .2); }
.nbx-pop > button[data-open], .nbx-list button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--paper); font: inherit; text-align: left; cursor: pointer; }
.nbx-pop button[data-open]:hover { background: rgba(var(--fg-rgb), .05); }
.nbx-pop button[data-open].is-on { background: rgba(227, 114, 57, .1); }
.nbx-pop button[data-open] b { font-size: 14px; } .nbx-pop button[data-open] small { font-size: 12px; color: var(--muted); }
.nbx-list { max-height: 260px; overflow: auto; }
.nbx-new { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 8px; height: 40px; border: 0; border-radius: 12px; background: var(--ink, #0E0E10); color: #fff; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
html[data-theme="dark"] .nbx-new { background: var(--orange); }
.nbx-new svg { width: 16px; height: 16px; }

/* narrow screens: the notebook takes the whole width, with a switch back to the note */
@media (max-width: 759px) {
  body.nb-split > main { margin-right: 0; }
  .nbx--split { width: auto; left: 0; }
  .nbx__drag { display: none; }
  .nbx__peek { display: grid; }
  body.nb-split.nb-peek .nbx { transform: translateX(100%); opacity: 1; }
  .nbx__zoom, .nbx__st { display: none; }
}

/* phones: the pill that brings the notebook back after "Show the note" */
.nbx-back { position: fixed; right: 16px; bottom: 84px; z-index: 160; display: none; align-items: center; gap: 7px; height: 44px; padding: 0 16px; border: 0; border-radius: 99px; background: var(--ink, #0E0E10); color: #fff; font: inherit; font-size: 14px; font-weight: 700; box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .5); cursor: pointer; }
.nbx-back svg { width: 17px; height: 17px; }
@media (max-width: 759px) { body.nb-split.nb-peek .nbx-back { display: inline-flex; } }

/* My notes: notebook cards with a picture of page 1 */
.mine__nbs { margin-bottom: 26px; }
.mine__nbs .mine__nbgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.nb-card { position: relative; padding: 0 !important; overflow: hidden; }
.nb-card__a { display: flex; flex-direction: column; gap: 0; color: inherit; text-decoration: none; }
.nb-card__pic { display: block; aspect-ratio: 1000 / 700; overflow: hidden; background: rgba(var(--fg-rgb), .05); }
.nb-thumb { position: relative; display: block; width: 100%; aspect-ratio: 1000 / 1414; }
.nb-thumb svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.nb-card__t { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px 12px; }
.nb-card__t b { font-size: 14.5px; }
.mine__new { display: grid; place-items: center; gap: 6px; min-height: 160px; border: 2px dashed rgba(var(--fg-rgb), .18); border-radius: 18px; background: none; color: var(--muted); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }
.mine__new:hover { border-color: var(--orange); color: var(--orange); }
.mine__new svg { width: 22px; height: 22px; }
@media print { .nbx, .nbx-pop { display: none !important; } }
