/* Study Quest — library.css (V7.2.4 "The full study release", lane A, builder v724-editor: scope A1)
 * The Nauka's Library: the card editor (js/ui-cardeditor.js), the editor page and the card table (js/ui-library.js), the
 * Chapters course page (js/ui-course.js) and practice's top bar and menus (js/ui-practice.js).
 * The look follows the approved mock-ups work/v9/v722/mocks/editor.html + books.css (the user, 16 Oct: "I like the mockups").
 * Everything is scoped under .ed / .lib- / .crs- / .pr- so nothing leaks into the other books.
 */

/* ---------------------------------------------------------------------------------------------- the editor page */
.nk-layer.lib-doc .nk-page.l .nk-in { padding-top: 20px; }
.lib-head { position: sticky; top: -20px; z-index: 6; margin: -20px -34px 0; padding: 20px 34px 4px; background: var(--nk-page); box-shadow: 0 1px 0 rgba(216, 200, 166, 0.8); }
.nk-layer.is-small .lib-head { position: static; margin: 0; padding: 0; box-shadow: none; }
.ed-row { scroll-margin-top: 170px; }
.lib-back { border: 0; background: none; padding: 0; font: inherit; color: var(--nk-lapis); cursor: pointer; }
.lib-back:hover { text-decoration: underline; }
.lib-ttl { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.lib-name { cursor: text; }
.lib-name:hover { box-shadow: inset 0 -2px 0 rgba(47, 90, 154, 0.25); }
.lib-bar, .lib-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.lib-bar .lib-find { flex: 1; min-width: 180px; height: 32px; }
.lib-bar .lib-find input { height: 28px; }
.lib-tools .nk-btn { height: 26px; padding: 0 9px; font-size: 12.5px; }
.lib-tools .nk-btn.ico { width: 28px; padding: 0; justify-content: center; font-size: 15px; }
.lib-status { margin-left: auto; font: 500 12px/1.2 var(--nk-ui); color: var(--nk-meta); white-space: nowrap; }
.lib-status.is-warn { color: #9a2f08; }
.lib-notice { position: relative; margin: 4px 0 8px; padding-right: 32px; font-size: 13px; }
.lib-notice .nk-btn { position: absolute; right: 4px; top: 4px; height: 22px; width: 22px; padding: 0; justify-content: center; }
.lib-findpop { position: absolute; z-index: 30; left: 0; right: 0; top: 108px; max-height: 360px; overflow: auto; background: #fffaf0; border: 1px solid var(--nk-lapis);
  border-radius: 4px; box-shadow: 0 14px 30px rgba(40, 30, 10, 0.25); padding: 6px 0; }
.lib-findpop .grp { font: 700 10px/1 var(--nk-ui); letter-spacing: 0.12em; text-transform: uppercase; color: var(--nk-meta); padding: 8px 14px 4px; }
.lib-findpop .it { display: grid; grid-template-columns: 74px 1fr; gap: 10px; width: 100%; padding: 6px 14px; border: 0; background: none; text-align: left;
  font: 500 13.5px/1.35 var(--nk-ui); color: var(--nk-ink); cursor: pointer; }
.lib-findpop .it:hover { background: var(--nk-sel); }
.lib-findpop mark { background: #f3dc8f; color: inherit; }

/* ---------------------------------------------------------------------------------------------- the outline (the card editor) */
.ed { position: relative; outline: none; padding-bottom: 60px; }
.ed-list { font-family: var(--nk-read, Georgia, serif); }
.ed-row { position: relative; display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: start; min-height: 28px; border-radius: 2px; }
.ed-row.is-caret { background: rgba(47, 90, 154, 0.07); box-shadow: inset 3px 0 0 var(--nk-lapis); }
.ed-row.is-sel { background: rgba(47, 90, 154, 0.16); }
.ed-gut { padding-top: 4px; min-height: 1px; }
.ed-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 88px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  font: 700 9.5px/1 var(--nk-ui); letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 5px 3px; border-radius: 3px;
  background: #e9dec5; border: 1px solid #d3c19c; color: var(--nk-ink-2); cursor: pointer; }
.ed-chip:hover { border-color: var(--nk-lapis); color: var(--nk-ink); }
.ed-chip.is-off { background: #e4ddd0; color: #6b604f; text-decoration: line-through; }
.ed-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; flex: none; }
.ed-dot.d-due { background: #c2410c; } .ed-dot.d-new { background: #2f5a9a; } .ed-dot.d-known { background: #2f7a68; }
.ed-dot.d-learn { background: #b06a12; } .ed-dot.d-aside { background: #9a9080; }
.ed-role { display: inline-block; margin-top: 2px; font: 600 10.5px/1.2 var(--nk-ui); color: var(--nk-meta); letter-spacing: 0.02em; }
.ed-row.is-right .ed-role { color: #2f7a68; }
.ed-tx { position: relative; padding: 3px 4px 4px calc(18px + var(--in, 0) * 22px); font-size: 16px; line-height: 1.42; color: var(--nk-ink); min-width: 0; overflow-wrap: anywhere; }
.ed-tx::before { content: ''; position: absolute; left: calc(4px + var(--in, 0) * 22px); top: 12px; width: 6px; height: 6px; border-radius: 50%; background: #8f7a5a; }
.ed-row.k-blank .ed-tx::before { display: none; }
.ed-row.k-heading .ed-tx { padding-left: calc(var(--in, 0) * 22px); }
.ed-row.k-heading .ed-tx::before { display: none; }
.ed-row.k-heading.h1 .ed-tx { font: 600 21px/1.3 var(--nk-read, Georgia, serif); margin-top: 6px; }
.ed-row.k-heading.h2 .ed-tx { font: 600 17.5px/1.35 var(--nk-read, Georgia, serif); margin-top: 2px; color: var(--nk-ink-2); }
.ed-row.k-heading.h3 .ed-tx { font: 600 16px/1.35 var(--nk-read, Georgia, serif); color: var(--nk-ink-2); }
.ed-row.r-explain .ed-tx, .ed-row.r-detail .ed-tx, .ed-row.r-hint .ed-tx, .ed-row.r-hintb .ed-tx { color: var(--nk-ink-2); font-size: 15px; }
.ed-row.k-child .ed-tx::after { content: ''; position: absolute; left: calc(var(--in, 0) * 22px - 9px); top: -2px; bottom: -2px; width: 1px; background: #dccaa5; }
.ed-row.k-note .ed-tx { color: var(--nk-ink-2); }
.ed-empty { display: inline-block; min-height: 1em; }
.ed-arrow { color: #c2410c; margin: 0 6px; font-family: var(--nk-ui); }
.ed-arrow.is-off { color: #8a7f6c; }
.ed-clz { background: rgba(194, 65, 12, 0.1); border-bottom: 2px solid #c2410c; padding: 0 2px; border-radius: 2px 2px 0 0; }
.ed-ref { color: var(--nk-lapis); border-bottom: 1px solid rgba(47, 90, 154, 0.4); cursor: pointer; }
.ed-tag { font: 600 12.5px/1 var(--nk-ui); color: #6a4a8a; background: rgba(106, 74, 138, 0.09); padding: 2px 5px; border-radius: 3px; margin-left: 4px; }
.ed-sx { font: 600 0.8em/1 "SF Mono", Menlo, monospace; color: #6a3a10; background: rgba(176, 106, 18, 0.12); padding: 2px 4px; border-radius: 3px; margin: 0 3px; vertical-align: 1px; }
.ed-marker { font: 600 11px/1 var(--nk-ui); color: #2f7a68; background: rgba(47, 122, 104, 0.09); padding: 2px 5px; border-radius: 3px; margin-left: 6px; }
.ed-warn { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 6px; border-radius: 50%; background: #c2410c; color: #fff; font: 700 11px/1 var(--nk-ui); cursor: help; vertical-align: 1px; }
.ed-math math { font-size: 1.05em; }
.ed-ta { display: block; width: 100%; margin: 0; padding: 0; border: 0; outline: 0; resize: none; overflow: hidden; background: transparent;
  font: inherit; line-height: inherit; color: var(--nk-ink); caret-color: #c2410c; white-space: pre-wrap; overflow-wrap: anywhere; }
.ed-row.k-heading .ed-ta { font: inherit; }
.ed-mirror { position: absolute; visibility: hidden; left: 0; top: 0; white-space: pre-wrap; overflow-wrap: anywhere; height: auto; }
/* the menus: / insert, [[ link, the chip's type menu, the toolbar's menus */
.ed-pop { position: absolute; z-index: 40; width: 300px; max-height: 340px; overflow: auto; padding: 6px 0; background: #fffaf0; border: 1px solid var(--nk-lapis);
  border-radius: 4px; box-shadow: 0 14px 30px rgba(40, 30, 10, 0.28); font-family: var(--nk-ui); }
.ed-pop.hidden { display: none; }
.ed-pop-h { font: 700 10px/1 var(--nk-ui); letter-spacing: 0.12em; text-transform: uppercase; color: var(--nk-meta); padding: 6px 12px 6px; }
.ed-pop-it { display: grid; grid-template-columns: 1fr auto; gap: 1px 10px; width: 100%; padding: 6px 12px; border: 0; background: none; text-align: left; cursor: pointer; color: var(--nk-ink); }
.ed-pop-it .l { font: 600 13.5px/1.25 var(--nk-ui); }
.ed-pop-it .w { grid-column: 1 / 3; font: 500 11.5px/1.3 var(--nk-ui); color: var(--nk-meta); }
.ed-pop-it .k { grid-column: 2; grid-row: 1; font: 600 11px/1 "SF Mono", Menlo, monospace; color: #c2410c; }
.ed-pop-it.is-on, .ed-pop-it:hover { background: var(--nk-sel); }
.ed-pop-it.is-dim { opacity: 0.6; }
.ed-pop-sep { height: 1px; margin: 5px 10px; background: var(--nk-rule); }
.ed-pop-none { padding: 8px 12px; font: 500 12.5px/1.35 var(--nk-ui); color: var(--nk-meta); }
.ed--mini .ed-row { grid-template-columns: 84px minmax(0, 1fr); }
.ed--mini .ed-tx { font-size: 15.5px; }

/* ---------------------------------------------------------------------------------------------- the live preview (right page) */
.lib-side .lib-sub { margin: -4px 0 10px; }
.lib-lect { background: #1b1814; color: #e8e1d3; border-radius: 4px; box-shadow: 0 0 0 1px #050505, inset 0 0 0 1px #7a5229; padding: 14px 20px 14px; }
.lib-lect .lib-lect-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.lib-lect .lib-trail { font: 500 12.5px/1.3 var(--nk-ui); color: #a39c8f; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-lect .st-tag { flex: none; font: 700 9.5px/1 var(--nk-ui); letter-spacing: 0.1em; text-transform: uppercase; padding: 4px 6px 3px; border: 1px solid #7a5229; border-radius: 2px; color: #d7c7a4; }
.lib-lect .q { font: 400 20px/1.35 var(--nk-read, Georgia, serif); margin: 8px 0 0; color: #f1ebdd; }
.lib-lect .a { font: 400 17px/1.45 var(--nk-read, Georgia, serif); color: #e8e1d3; }
.lib-lect .rl { height: 1px; background: #3a342c; margin: 12px 0 10px; position: relative; }
.lib-lect .rl::after { content: ''; position: absolute; left: 50%; top: -4px; width: 8px; height: 8px; margin-left: -4px; transform: rotate(45deg); background: #1b1814; border: 1px solid #7a5229; }
.lib-lect .opt { display: grid; grid-template-columns: 26px 1fr auto; gap: 4px 10px; align-items: center; min-height: 40px; padding: 3px 12px 3px 10px; margin-top: 6px;
  border: 1px solid #3a342c; border-left: 3px solid #3a342c; border-radius: 3px; }
.lib-lect .opt .ob { min-width: 0; }
.lib-lect .opt .st-mathline, .lib-lect .opt .ob math, .lib-lect .opt .ob math[display="block"] { text-align: left; justify-content: flex-start; margin: 0; }
.lib-lect .opt .ob .st-mathline { display: inline-block; }
.lib-lect .opt.good { border-left-color: #5f9a8a; background: rgba(95, 154, 138, 0.12); }
.lib-lect .opt .res { font: 600 12px/1 var(--nk-ui); color: #8fc2b3; }
.lib-lect .opt .why { grid-column: 2 / 4; font-size: 14.5px; line-height: 1.45; color: #c2baab; margin: 0 0 4px; }
.lib-lect .st-kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 3px; background: #3a342c; color: #e8e1d3; font: 700 11px/1 var(--nk-ui); }
.lib-lect .more { margin-top: 10px; padding-left: 10px; border-left: 2px solid #5a4a30; color: #c9c0ae; font-size: 15px; }
.lib-lect .more .lbl { display: block; font: 700 10px/1.6 var(--nk-ui); letter-spacing: 0.12em; text-transform: uppercase; color: #a39c8f; }
.lib-lect .lib-hint { margin-top: 8px; font: 500 13.5px/1.4 var(--nk-ui); color: #d7c7a4; }
.lib-lect .lib-shuf { color: #a39c8f; margin-top: 8px; font-size: 12px; }
.lib-lect .st-fill, .lib-lect .st-ans { color: #f3c47a; }
.lib-lect .st-blank { display: inline-block; min-width: 44px; border-bottom: 2px solid #c2410c; color: #c2410c; text-align: center; }
.lib-dirs { display: flex; gap: 6px; margin-bottom: 8px; }
.lib-dir { height: 24px; padding: 0 9px; border: 1px solid var(--nk-rule); border-radius: 12px; background: #fbf6ea; font: 600 12px/1 var(--nk-ui); color: var(--nk-ink-2); cursor: pointer; }
.lib-dir.is-on { border-color: var(--nk-lapis); color: var(--nk-lapis); background: rgba(47, 90, 154, 0.08); }
.lib-kv { display: grid; grid-template-columns: 104px 1fr; gap: 8px 14px; font: 500 13.5px/1.4 var(--nk-ui); color: var(--nk-ink); margin: 0; }
.lib-kv dt { font: 700 10.5px/1.9 var(--nk-ui); letter-spacing: 0.12em; text-transform: uppercase; color: var(--nk-meta); }
.lib-kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.lib-tag { font: 600 12.5px/1 var(--nk-ui); color: #6a4a8a; background: rgba(106, 74, 138, 0.09); padding: 2px 5px; border-radius: 3px; }
.lib-link { border: 0; background: none; padding: 0; font: inherit; color: var(--nk-lapis); border-bottom: 1px solid rgba(47, 90, 154, 0.4); cursor: pointer; }
.lib-cheat .cheat { display: flex; flex-wrap: wrap; gap: 6px 12px; font: 500 12.5px/1.6 var(--nk-ui); color: var(--nk-meta); }
.lib-cheat code { font: 600 12px/1 "SF Mono", Menlo, monospace; color: #c2410c; background: rgba(194, 65, 12, 0.08); padding: 2px 4px; border-radius: 3px; margin-right: 3px; }
.lib-cheat .lib-keys { margin-top: 10px; font-size: 12px; }

/* ---------------------------------------------------------------------------------------------- the Library home additions */
.lib-tree li.d0 { padding-left: 4px; }
.lib-docs li { grid-template-columns: 22px minmax(0, 1fr) 46px 130px 30px; }
.lib-docs li.head { grid-template-columns: 22px minmax(0, 1fr) 46px 130px 30px; }
.nk-head__r { display: flex; gap: 8px; align-items: center; }

/* ---------------------------------------------------------------------------------------------- the card table (across the spread) */
.nk-layer.lib-wide .nk-spread { grid-template-columns: 1fr; }
.nk-layer.lib-wide .nk-spread::after { display: none; }
.nk-layer.lib-wide .nk-page.r { display: none; }
.nk-layer.lib-wide .nk-page.l { border-radius: 2px 2px 3px 3px; background: var(--nk-page); }
.lib-table { position: relative; padding-bottom: 64px; }
.lib-thead { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.lib-thead-r { margin-left: auto; display: flex; gap: 8px; }
.lib-table .fchips { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.lib-table .lib-tqwrap { width: 290px; height: 30px; }
.lib-table .lib-tqwrap input { height: 26px; }
.lib-table select.fchip { height: 28px; padding: 0 10px; border: 1px solid var(--nk-rule); border-radius: 14px; background: #fbf6ea; font: 600 12.5px/1 var(--nk-ui); color: var(--nk-ink-2); max-width: 220px; }
.lib-table select.fchip.on { border-color: var(--nk-lapis); color: var(--nk-lapis); background: rgba(47, 90, 154, 0.07); }
.lib-ledger { width: 100%; border-collapse: collapse; font: 500 13.5px/1.3 var(--nk-ui); color: var(--nk-ink); table-layout: fixed; }
.lib-ledger th { font: 700 10.5px/1 var(--nk-ui); letter-spacing: 0.1em; text-transform: uppercase; color: var(--nk-meta); text-align: left; padding: 9px 8px; border-bottom: 3px double #a8321e;
  background: #efe5cf; cursor: pointer; white-space: nowrap; }
.lib-ledger th.c, .lib-ledger td.c { width: 30px; text-align: center; }
.lib-ledger th.n, .lib-ledger td.n { width: 40px; text-align: right; color: var(--nk-meta); }
.lib-ledger th.col-type { width: 104px; } .lib-ledger th.col-theme { width: 150px; } .lib-ledger th.col-due { width: 82px; }
.lib-ledger th.col-stab, .lib-ledger th.col-lapses, .lib-ledger th.col-reviews { width: 64px; text-align: right; } .lib-ledger th.col-time { width: 70px; text-align: right; }
.lib-ledger th.go, .lib-ledger td.go { width: 30px; }
.lib-ledger td { padding: 0 8px; height: 34px; border-bottom: 1px solid #e0d1b0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.lib-ledger td.f { font: 400 15px/1.3 var(--nk-read, Georgia, serif); cursor: text; }
.lib-ledger td.b { font: 400 14.5px/1.3 var(--nk-read, Georgia, serif); color: var(--nk-ink-2); cursor: text; }
.lib-ledger td.r { text-align: right; font-variant-numeric: tabular-nums; }
.lib-ledger td.due.is-due { color: #9a2f08; font-weight: 600; }
.lib-ledger td.rv { cursor: pointer; color: var(--nk-lapis); }
.lib-ledger tr:nth-child(even) td { background: rgba(236, 226, 204, 0.45); }
.lib-ledger tr.is-sel td { background: rgba(47, 90, 154, 0.12) !important; }
.lib-ledger td.edit { outline: 2px solid var(--nk-lapis); outline-offset: -2px; background: #fffaf0 !important; white-space: normal; padding: 4px 6px; height: auto; }
.lib-ledger .lib-cell { width: 100%; min-height: 48px; border: 0; outline: 0; resize: vertical; background: transparent; font: 400 14.5px/1.35 var(--nk-read, Georgia, serif); color: var(--nk-ink); }
.lib-ledger .cb { width: 14px; height: 14px; border: 1px solid #a8987a; border-radius: 2px; display: inline-block; vertical-align: -2px; background: #fffaf0; cursor: pointer; }
.lib-ledger .cb.on { background: var(--nk-lapis); border-color: var(--nk-lapis); box-shadow: inset 0 0 0 2px #fffaf0; }
.lib-ledger span.ty { font: 700 9.5px/1 var(--nk-ui); letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 5px 3px; border-radius: 3px; background: #e9dec5; border: 1px solid #d3c19c; color: var(--nk-ink-2); }
.lib-ledger .lee { color: #a8321e; font-weight: 700; }
.lib-go { border: 0; background: none; color: var(--nk-lapis); cursor: pointer; font-size: 14px; }
.lib-selbar { position: sticky; bottom: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding: 7px 12px; border-radius: 4px;
  background: #1f2d4a; color: #dfe6f2; font: 600 13px/1 var(--nk-ui); box-shadow: 0 8px 20px rgba(10, 18, 34, 0.35); }
.lib-selbar .nk-btn { background: #2c3c5e; border-color: #3d5180; color: #dfe6f2; height: 26px; font-size: 12.5px; }
.lib-selbar .hint { margin-left: auto; font-weight: 500; color: #9fb0cf; }

/* ---------------------------------------------------------------------------------------------- dialogs (quick card, pickers, history) */
.modal.lib-modal { max-width: 560px; }
.lib-quick .lib-qtypes { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.lib-qt { height: 26px; padding: 0 10px; border-radius: 13px; border: 1px solid rgba(220, 200, 160, 0.4); background: rgba(255, 255, 255, 0.06); color: inherit; font: 600 12.5px/1 var(--nk-ui, system-ui); cursor: pointer; }
.lib-qt.is-on { border-color: #e2c48a; background: rgba(226, 196, 138, 0.18); }
.lib-quick textarea.input { width: 100%; min-height: 48px; resize: vertical; font: 15px/1.4 var(--nk-read, Georgia, serif); }
.lib-pick { display: flex; flex-direction: column; gap: 4px; max-height: 50vh; overflow: auto; }
.lib-pick-it { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border: 1px solid rgba(220, 200, 160, 0.25); border-radius: 4px; background: rgba(255, 255, 255, 0.04); color: inherit; text-align: left; cursor: pointer; font: 500 14px/1.3 var(--nk-ui, system-ui); }
.lib-pick-it:hover, .lib-pick-it.is-on { border-color: #e2c48a; background: rgba(226, 196, 138, 0.12); }
.lib-hist .q { font: 500 15px/1.4 var(--nk-read, Georgia, serif); margin: 0 0 8px; }
.lib-hist-t { width: 100%; border-collapse: collapse; font: 500 13px/1.3 var(--nk-ui, system-ui); }
.lib-hist-t td { padding: 4px 6px; border-bottom: 1px solid rgba(220, 200, 160, 0.2); }
.lib-hist-t td.r { text-align: right; }

/* ---------------------------------------------------------------------------------------------- small window (480 x 360, compact) */
.nk-layer.is-small .ed-row { grid-template-columns: 64px minmax(0, 1fr); min-height: 22px; }
.nk-layer.is-small .ed-chip { max-width: 60px; font-size: 8px; padding: 3px 3px 2px; }
.nk-layer.is-small .ed-tx { font-size: 12.5px; padding-left: calc(12px + var(--in, 0) * 14px); }
.nk-layer.is-small .ed-tx::before { left: calc(2px + var(--in, 0) * 14px); top: 9px; width: 4px; height: 4px; }
.nk-layer.is-small .ed-row.k-heading.h1 .ed-tx { font-size: 15px; }
.nk-layer.is-small .lib-tools, .nk-layer.is-small .lib-cheat { display: none; }
.nk-layer.is-small .lib-lect { padding: 8px 10px; }
.nk-layer.is-small .lib-lect .q { font-size: 14px; }
.nk-layer.is-small .lib-kv { grid-template-columns: 70px 1fr; font-size: 11.5px; }
.nk-layer.is-small .lib-ledger { font-size: 11px; }
.nk-layer.is-small .lib-ledger th.col-theme, .nk-layer.is-small .lib-ledger td.th, .nk-layer.is-small .lib-ledger th.col-stab,
.nk-layer.is-small .lib-ledger th.col-time, .nk-layer.is-small .lib-ledger th.col-reviews, .nk-layer.is-small .lib-ledger td.col-stab,
.nk-layer.is-small .lib-ledger td.col-time, .nk-layer.is-small .lib-ledger td.col-reviews { display: none; }

/* ---------------------------------------------------------------------------------------------- the Chapters course page (js/ui-course.js) */
.crs-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.crs-head .nk-h2 { flex: 1; min-width: 0; }
.crs-hb { display: flex; gap: 6px; }
.crs-hb .nk-btn { height: 30px; }
.crs-banner { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 14px; border: 1px solid #e5b9ad; border-radius: 6px; background: #fbf0ea; }
.crs-exam { display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 4px 4px; font: 600 15px/1 var(--nk-ui); color: var(--nk-ink); cursor: pointer; }
.crs-exam svg { width: 16px; height: 16px; }
.crs-exam b { color: var(--nk-meta); font-size: 17px; }
.crs-exam.is-none { color: var(--nk-meta); font-weight: 500; }
.crs-today { margin-left: auto; font: 500 13px/1 var(--nk-ui); color: var(--nk-meta); }
.crs-go { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border: 1px solid var(--nk-rule); border-radius: 5px; background: #fffaf2; font: 600 13.5px/1 var(--nk-ui); color: var(--nk-ink); cursor: pointer; }
.crs-go svg { width: 15px; height: 15px; }
.crs-go:hover { border-color: var(--nk-lapis); }
.crs-go[disabled] { opacity: 0.5; cursor: default; }
.crs-subtabs { display: flex; gap: 22px; border-bottom: 1px solid var(--nk-rule); margin-bottom: 8px; }
.crs-sub { border: 0; background: none; padding: 8px 2px 9px; font: 600 15px/1 var(--nk-ui); color: var(--nk-meta); cursor: pointer; box-shadow: none; }
.crs-sub.is-on { color: var(--nk-ink); box-shadow: inset 0 -2px 0 var(--nk-lapis); }
.crs-rows { list-style: none; margin: 0; padding: 0; }
.crs-row { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 40px; border-bottom: 1px solid rgba(216, 200, 166, 0.6); }
.crs-row.is-menu { background: var(--nk-sel); }
.crs-name { justify-self: start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border: 0; background: none; padding: 0; text-align: left;
  font: 500 15px/1.2 var(--nk-ui); color: var(--nk-ink); cursor: pointer; }
.crs-name:hover { color: var(--nk-lapis); }
.crs-name .crs-ttl { color: var(--nk-ink-2); }
.crs-pillbox { display: inline-flex; border: 1px solid var(--nk-rule); border-radius: 6px; background: #fffaf2; overflow: hidden; }
.crs-pill { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 0; background: none; font: 600 12.5px/1 var(--nk-ui); color: var(--nk-ink-2); cursor: pointer; white-space: nowrap; }
.crs-pill svg { width: 14px; height: 14px; }
.crs-pill.k-today { color: #9a2f08; }
.crs-pill.k-learn { color: var(--nk-lapis); }
.crs-pill.k-done, .crs-pill.k-empty { color: var(--nk-meta); font-weight: 500; cursor: default; }
.crs-pill:hover:not([disabled]) { background: rgba(47, 90, 154, 0.08); }
.crs-caret { width: 28px; height: 28px; border: 0; border-left: 1px solid var(--nk-rule); background: none; color: var(--nk-ink-2); cursor: pointer; font-size: 12px; }
.crs-caret:hover, .crs-row.is-menu .crs-caret { background: rgba(47, 90, 154, 0.1); }
.crs-menu { position: absolute; z-index: 30; right: 0; top: 38px; width: 330px; padding: 6px 0; background: #fffaf0; border: 1px solid #c9b994; border-radius: 6px;
  box-shadow: 0 14px 30px rgba(40, 30, 10, 0.28); }
.crs-mi { display: grid; grid-template-columns: 1fr; width: 100%; padding: 7px 14px; border: 0; background: none; text-align: left; cursor: pointer; }
.crs-mi .l { font: 600 13.5px/1.25 var(--nk-ui); color: var(--nk-ink); }
.crs-mi .w { font: 500 11.5px/1.3 var(--nk-ui); color: var(--nk-meta); }
.crs-mi:hover:not([disabled]) { background: var(--nk-sel); }
.crs-mi.is-pri { background: var(--nk-lapis); }
.crs-mi.is-pri .l, .crs-mi.is-pri .w { color: #f4ecdb; }
.crs-mi.is-pri:hover { background: #366ab3; }
.crs-mi[disabled] { opacity: 0.45; cursor: default; }
.crs-sep { height: 1px; margin: 5px 12px; background: var(--nk-rule); }
.crs-stat { grid-column: 1 / 4; margin: 0 0 8px 30px; padding: 8px 10px; border-left: 3px solid var(--nk-lapis); background: #fbf6ea; font: 500 13px/1.45 var(--nk-ui); color: var(--nk-ink-2); display: flex; flex-direction: column; gap: 2px; }
.crs-exams { padding-top: 6px; }
.crs-examrow { display: grid; grid-template-columns: 20px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--nk-rule); }
.crs-examrow svg { width: 16px; height: 16px; }
.crs-examrow b { display: block; font: 600 15px/1.2 var(--nk-ui); }
.nk-layer.is-small .crs-banner { padding: 4px 6px; gap: 4px; }
.nk-layer.is-small .crs-go { height: 22px; padding: 0 6px; font-size: 10.5px; }
.nk-layer.is-small .crs-row { min-height: 26px; }
.nk-layer.is-small .crs-name { font-size: 12px; }
.nk-layer.is-small .crs-pill { height: 20px; font-size: 10px; padding: 0 5px; }
.nk-layer.is-small .crs-caret { width: 20px; height: 20px; }
.nk-layer.is-small .crs-menu { width: 230px; }

/* ---------------------------------------------------------------------------------------------- practice like RemNote (js/ui-practice.js) */
.pr-bar { display: flex; align-items: center; gap: 8px; padding: 12px 18px 0 40px; flex: none; font-family: var(--st-ui); color: var(--st-text-2); position: relative; z-index: 4; }
.pr-count { display: inline-flex; align-items: center; gap: 6px; font: 600 14px/1 var(--st-ui); color: var(--st-text); }
.pr-count svg { width: 14px; height: 14px; color: #5b7fb8; }
.pr-count .pr-n { font-variant-numeric: tabular-nums; }
.pr-count .pr-in { font-weight: 500; color: var(--st-text-2); }
.pr-b { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border: 1px solid var(--st-rule); border-radius: 5px; background: var(--st-page-2);
  font: 600 13px/1 var(--st-ui); color: var(--st-text); cursor: pointer; white-space: nowrap; }
.pr-b:hover:not([disabled]) { border-color: var(--st-bronze); }
.pr-b[disabled] { opacity: 0.45; cursor: default; }
.pr-b svg { width: 15px; height: 15px; }
.pr-b.pri { background: #2f5a9a; border-color: #24487e; color: #f4ecdb; }
.pr-b.pr-quiet { background: transparent; border-color: transparent; color: var(--st-meta); font-weight: 500; height: 24px; padding: 0 6px; }
.pr-b.pr-quiet:hover { color: var(--st-text); border-color: var(--st-rule); }
.pr-scope { max-width: 300px; }
.pr-scope .pr-scope-t { overflow: hidden; text-overflow: ellipsis; }
.pr-scope .pr-caret { color: var(--st-meta); font-size: 11px; }
.pr-sp { flex: 1; }
.pr-ico { width: 32px; padding: 0; justify-content: center; }
.pr-edit { width: auto; padding: 0 6px 0 8px; }
.pr-edit .st-kbd { min-width: 18px; height: 18px; font-size: 11px; line-height: 18px; padding: 0 3px; }
.pr-pop { position: absolute; z-index: 20; right: 14px; top: 50px; width: 330px; max-height: calc(100% - 70px); overflow: auto; padding: 6px 0; border-radius: 8px;
  background: #fffaf0; border: 1px solid #c9b994; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45); font-family: var(--st-ui); color: #211a12; }
.pr-pop.hidden { display: none; }
.pr-pop.is-picker { left: 40px; right: auto; width: 380px; }
.pr-mi { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 36px; padding: 6px 16px; border: 0; background: none; text-align: left; cursor: pointer; color: #211a12; }
.pr-mi .l { flex: 1; font: 600 14px/1.25 var(--st-ui); }
.pr-mi .r { font: 500 12.5px/1.2 var(--st-ui); color: #625240; max-width: 170px; text-align: right; }
.pr-mi .st-kbd { --st-kbd-bg: #e6dcc6; --st-kbd-text: #211a12; min-width: 20px; height: 20px; line-height: 20px; font-size: 12px; }
.pr-mi:hover:not([disabled]) { background: rgba(47, 90, 154, 0.1); }
.pr-mi.is-on .l { color: #2f5a9a; }
.pr-mi.is-on .l::before { content: '✓ '; }
.pr-mi.pr-mh .l { color: #625240; }
.pr-mi[disabled] { opacity: 0.45; cursor: default; }
.pr-sep { height: 1px; margin: 5px 12px; background: #e0d1b0; }
.pr-tog { position: relative; width: 34px; height: 20px; border-radius: 10px; background: #d9cdb4; flex: none; }
.pr-tog i { position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fffaf0; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); transition: left 0.12s; }
.pr-tog.on { background: #2f5a9a; }
.pr-tog.on i { left: 16px; }
.pr-ph { display: flex; align-items: center; gap: 8px; padding: 4px 16px 8px; font: 700 10.5px/1.2 var(--st-ui); letter-spacing: 0.12em; text-transform: uppercase; color: #625240; }
.pr-ph span { flex: 1; }
.pr-modes { display: flex; flex-wrap: wrap; gap: 5px; padding: 0 14px 8px; border-bottom: 1px solid #e0d1b0; }
.pr-mode { height: 26px; padding: 0 9px; border: 1px solid #d3c19c; border-radius: 13px; background: #fbf6ea; font: 600 12px/1 var(--st-ui); color: #4e4031; cursor: pointer; }
.pr-mode.is-on { border-color: #2f5a9a; color: #2f5a9a; background: rgba(47, 90, 154, 0.08); }
.pr-chs { padding-top: 4px; }
.pr-chs .pr-mi .r { color: #9a2f08; }
/* the card's own extras: the hint, Fix later, type in the answer, the leech prompt, the done choices */
.pr-extras { margin-top: 16px; font-family: var(--st-ui); }
.pr-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pr-early { font: 500 13px/1.3 var(--st-ui); color: var(--st-cloze); }
.pr-type { display: block; width: 100%; margin-top: 10px; height: 40px; padding: 0 12px; border: 1px solid var(--st-rule); border-radius: 4px; background: var(--st-page-2);
  font: 400 19px/1 var(--st-read); color: var(--st-text); outline: none; }
.pr-typerow { display: flex; gap: 8px; align-items: flex-end; } .pr-typerow .pr-type { flex: 1; } .pr-typerow .pr-typecheck { height: 40px; cursor: pointer; }   /* V7.8 fixer r34 */
.pr-type:focus { border-color: #5b7fb8; box-shadow: 0 0 0 3px rgba(91, 127, 184, 0.25); }
.pr-typed { display: flex; gap: 10px; align-items: baseline; margin-top: 10px; padding: 8px 12px; border-left: 3px solid var(--st-rule); background: var(--st-page-2); font: 500 15px/1.4 var(--st-ui); }
.pr-typed .lbl { font: 700 10.5px/1 var(--st-ui); letter-spacing: 0.12em; text-transform: uppercase; color: var(--st-meta); }
.pr-typed .t { flex: 1; font-family: var(--st-read); font-size: 17px; color: var(--st-text); }
.pr-typed.is-good { border-left-color: var(--st-good-edge); } .pr-typed.is-good .m { color: var(--st-good); }
.pr-typed.is-part { border-left-color: var(--st-r2); } .pr-typed.is-off { border-left-color: var(--st-bad-edge); }
.pr-hint { margin-top: 10px; font: 500 15px/1.4 var(--st-ui); color: var(--st-text-2); }
.pr-leech { padding: 14px 16px; border: 1px solid var(--st-bad-edge); border-radius: 4px; background: var(--st-bad-bg); font: 500 15px/1.45 var(--st-ui); color: var(--st-text); }
.pr-leech b { font-size: 17px; color: var(--st-bad); }
.pr-leech .pr-leech-q { font: 400 19px/1.35 var(--st-read); color: var(--st-text); }
.pr-done { justify-content: center; margin-top: 8px; }
/* the panels over the card: the inline editor (the Library's editor on paper) and Preview document */
.pr-panel { position: absolute; z-index: 15; left: 14px; right: 14px; top: 50px; bottom: 14px; display: flex; flex-direction: column; border-radius: 4px; overflow: hidden;
  background: #f4ecdb; color: #211a12; box-shadow: 0 0 0 1px #7a5229, 0 18px 40px rgba(0, 0, 0, 0.45);
  --nk-page: #f4ecdb; --nk-page-2: #ece2cc; --nk-ink: #211a12; --nk-ink-2: #4e4031; --nk-meta: #54442f; --nk-rule: #d8c8a6; --nk-lapis: #2f5a9a; --nk-sel: rgba(47, 90, 154, 0.13);
  --nk-read: var(--st-read); --nk-ui: var(--st-ui); }
.pr-panel.hidden { display: none; }
.pr-panel .pr-ph { padding: 12px 18px 8px; border-bottom: 1px solid #e0d1b0; }
.pr-panel .pr-ph .pr-b { --st-rule: #d3c19c; --st-page-2: #fbf6ea; --st-text: #4e4031; height: 26px; text-transform: none; letter-spacing: 0; }
.pr-edhost { flex: 1; min-height: 0; overflow: auto; padding: 14px 18px 6px; }
.pr-panel > .pr-row { padding: 10px 18px 12px; border-top: 1px solid #e0d1b0; --st-rule: #d3c19c; --st-page-2: #fbf6ea; --st-text: #4e4031; }
.pr-panel .pr-note { margin-left: auto; font: 500 12px/1.3 var(--st-ui); color: #625240; }
.pr-doc { flex: 1; min-height: 0; overflow: auto; padding: 12px 18px 20px; }
.pr-doc .ed-row { cursor: default; }
.pr-doc .ed-gut { font: 700 9px/1.2 var(--st-ui); letter-spacing: 0.06em; text-transform: uppercase; color: #8a7656; padding-top: 6px; }
/* V7.2.4 (A2): the practice window is the bigger one (1000 px, study.css; the world stays at its sides); Queue variant
   Compact = V7.2.0's 820 px. Full screen = Hermit's Hood (an item, ui-practice.js): everything else goes dark */
.st-layer.pr-compact .st-lectern { width: min(820px, calc(100vw - 40px)); }
.st-layer.pr-hood { z-index: 950; }   /* over the HUD and the chat: nothing else on screen */
body.sq-hood #toast-layer { visibility: hidden; }   /* the toasts live in their own fixed layer: hidden while the hood is up */
.st-layer.pr-hood .st-dim { background: #0b0a09; bottom: 0; pointer-events: auto; }
.st-layer.pr-hood .st-lectern { top: 64px; bottom: 58px; width: min(940px, calc(100vw - 32px)); }
.st-layer.pr-hood .st-plate { display: none; }
.pr-hoodbadge { position: absolute; top: 18px; right: 22px; display: flex; align-items: center; gap: 7px; padding: 8px 13px; pointer-events: auto;
  border: 1px solid #5a4a2e; border-radius: 3px; background: #15120d; color: #b9a681; font: 500 13px/1 var(--st-ui, sans-serif); }
.pr-hoodbadge svg { width: 18px; height: 18px; color: #d8b45a; }
.pr-hoodbadge b { color: #e2c46e; font-weight: 600; }
.pr-hoodfoot { position: absolute; left: 50%; transform: translateX(-50%); bottom: 20px; width: min(940px, calc(100vw - 32px)); display: flex;
  gap: 12px; padding: 0 6px; font: 500 13px/1.3 var(--st-ui, sans-serif); color: #8d7d63; pointer-events: none; }
.pr-hoodfoot .r { margin-left: auto; }
@media (max-width: 700px), (max-height: 480px) {
  .st-layer.pr-hood .st-lectern { top: 40px; bottom: 30px; }
  .pr-hoodbadge { top: 6px; right: 8px; padding: 5px 8px; font-size: 11px; }
  .pr-hoodfoot { bottom: 6px; font-size: 11px; }
  .pr-hoodfoot > span:first-child { display: none; }
}
/* the Edit SRS data dialog */
.pr-srs .q { font: 500 15px/1.4 Georgia, serif; margin: 0 0 10px; }
.pr-srs .lib-kv { color: inherit; grid-template-columns: 150px 1fr; } .pr-srs .lib-kv dt { color: #b9a681; white-space: nowrap; }
.pr-srsrow .lbl { white-space: nowrap; }
.pr-srsrow { display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; }
.pr-srsrow .lbl { font-weight: 600; }
.pr-srsnote { font-size: 12px !important; color: #b9a681 !important; margin: 0 0 10px; }
.pr-h4 { margin: 14px 0 6px; font: 700 11px/1.2 system-ui; letter-spacing: 0.12em; text-transform: uppercase; color: #b9a681; }
.pr-log { max-height: 220px; overflow: auto; }
.pr-fix { font: 500 12.5px/1 system-ui; }
.st-root.is-compact .pr-bar { padding: 6px 8px 0 10px; gap: 4px; }
.st-root.is-compact .pr-b { height: 22px; font-size: 10.5px; padding: 0 5px; }
.st-root.is-compact .pr-count .pr-in, .st-root.is-compact .pr-stats span { display: none; }
/* compact (a small window): the bar sits at the right end of the head row, icons only, so the card keeps its height */
.st-root.is-compact .pr-bar { position: absolute; top: 6px; right: 8px; padding: 0; gap: 3px; }
.st-root.is-compact .pr-count, .st-root.is-compact .pr-scope-t, .st-root.is-compact .pr-sp { display: none; }
.st-root.is-compact .pr-ico { width: 24px; }
.st-root.is-compact .pr-ico.pr-edit { width: auto; padding: 0 4px 0 5px; gap: 4px; }
.st-root.is-compact .pr-b svg { width: 13px; height: 13px; }
.st-root.is-compact .pr-edit .st-kbd { min-width: 14px; height: 14px; font-size: 9.5px; line-height: 14px; }
.st-root.is-compact .st-head { padding-right: 186px; }
.st-root.is-compact .pr-pop { width: 250px; top: 32px; }
.st-root.is-compact .pr-panel { top: 32px; left: 4px; right: 4px; bottom: 4px; }
.pr-pop.pr-float { position: fixed; z-index: 60; right: auto; top: auto; max-height: min(560px, calc(100vh - 120px)); }
.lib-tofix .lib-fixmark { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 3px; background: #a8321e; color: #fff; font: 700 11px/1 var(--nk-ui); }
.crs-ot { display: block; width: 100%; max-width: 420px; height: auto; margin: 4px 0 6px; }
/* the floating picker lives on <body> (outside the lectern's .st-root): its own fonts and paper */
.pr-pop.pr-float { --st-ui: "Avenir Next", Avenir, "Helvetica Neue", system-ui, sans-serif; --st-read: "Iowan Old Style", Charter, Palatino, Georgia, serif; font-family: var(--st-ui); }
/* V7.2.4 (A2): × marks an item of a set / list as missed; a partial list's known items; the rating the marks suggest; preview */
.st-list li { position: relative; }
.st-missx { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-left: 10px; vertical-align: 2px;
  border: 1px solid var(--st-rule, #6b5a3e); border-radius: 50%; background: transparent; color: var(--st-text-2, #b9a681);
  font: 600 14px/1 var(--st-ui, sans-serif); cursor: pointer; opacity: .55; padding: 0; }
.st-missx:hover, .st-list li.is-miss .st-missx { opacity: 1; border-color: #b8442f; color: #e0715a; }
.st-list li.is-miss { color: #e0715a; text-decoration: line-through; text-decoration-color: rgba(224, 113, 90, .7); }
.st-list li.was-miss:not(.is-miss)::marker { color: #d08a3a; }
.st-list li.is-known { opacity: .72; }
.st-partial { margin-top: 10px; }
.st-rate .st-r.is-suggest { box-shadow: 0 0 0 2px #d8a24a, 0 0 14px rgba(216, 162, 74, .35); }
.st-rate.is-preview .st-iv { opacity: .6; font-style: italic; }
/* V7.2.4 (A2) image occlusion on the lectern: the picture with its masks (hide one: the other labels are clues) */
.st-occl { display: flex; justify-content: center; margin: 4px 0 12px; }
.st-occl-fr { position: relative; display: inline-block; max-width: 100%; line-height: 0; background: #fbf6ea; border: 1px solid var(--st-rule, #6b5a3e); border-radius: 2px; }
.st-occl-fr img { display: block; max-width: 100%; max-height: clamp(140px, calc(100vh - 580px), 44vh); width: auto; height: auto; user-select: none; }   /* the answer stays in view under it */
.st-occl-fr.is-missing { min-width: 240px; min-height: 120px; }
.st-occl-fr.is-missing::after { content: attr(data-why); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 12px; text-align: center; font: 500 13px/1.4 var(--st-ui, sans-serif); color: #6b5a3e; }
.st-mask { position: absolute; box-sizing: border-box; border-radius: 2px; display: flex; align-items: center; justify-content: center; font: 700 14px/1 var(--st-ui, sans-serif); color: #fff; }
.st-mask.is-q { background: #c8551e; box-shadow: 0 0 0 2px #fbf6ea, 0 0 0 3.5px #c8551e; }
.st-mask.is-hid { background: #8c8170; }
.st-mask.is-rev { background: transparent; box-shadow: 0 0 0 2px #5f9a8a, 0 0 0 5px rgba(95, 154, 138, .28); }
.st-mask.is-clue { background: transparent; border: 1px dashed rgba(107, 90, 62, .45); }
.st-occl-meta { display: block; margin-top: 6px; }
/* V7.2.4 (A2) image occlusion: Library › Figures and a figure's page (the picture with its masks; masks -> cards) */
.oc-figlist li { cursor: pointer; }
.oc-figlist li .st { margin-left: auto; font: 600 12px/1 var(--nk-ui, sans-serif); color: var(--nk-ember, #b5541b); white-space: nowrap; }
.oc-figlist li .st.is-done { color: #3f7a5f; }
.oc-left, .oc-right { display: flex; flex-direction: column; min-height: 0; }
.oc-cap { cursor: text; }
.oc-from { margin: 2px 0 10px; }
.oc-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.oc-bar .oc-sp { flex: 1; }
.oc-seg { display: inline-flex; }
.oc-seg .nk-btn { border-radius: 0; }
.oc-seg .nk-btn:first-child { border-radius: 3px 0 0 3px; } .oc-seg .nk-btn:last-child { border-radius: 0 3px 3px 0; margin-left: -1px; }
.oc-seg .nk-btn.is-on { background: var(--nk-lapis, #2f5a9a); color: #fff; border-color: var(--nk-lapis, #2f5a9a); }
.oc-stage { flex: 1; min-height: 160px; display: flex; align-items: flex-start; justify-content: center; }
.oc-drop { width: 100%; min-height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 20px;
  border: 2px dashed var(--nk-rule, #d8c8a6); border-radius: 4px; text-align: center; color: var(--nk-ink-2, #4e4031); font: 500 13.5px/1.4 var(--nk-ui, sans-serif); }
.oc-drop b { font-size: 15px; }
.oc-fr { position: relative; display: inline-block; max-width: 100%; line-height: 0; border: 1px solid var(--nk-rule, #d8c8a6); background: #fff; cursor: crosshair; touch-action: none; user-select: none; }
.oc-fr img { display: block; max-width: 100%; max-height: 52vh; pointer-events: none; }
.oc-fr.is-missing { min-width: 260px; min-height: 160px; }
.oc-mask { position: absolute; box-sizing: border-box; background: #c8551e; border: 1px solid #8a3510; color: #fff; display: flex; align-items: center; justify-content: center;
  font: 700 13px/1 var(--nk-ui, sans-serif); cursor: move; border-radius: 2px; }
.oc-mask.is-grp { background: #b24c1c; }
.oc-mask.is-sel { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--nk-lapis, #2f5a9a); }
.oc-mask.is-new { background: rgba(200, 85, 30, .45); border-style: dashed; }
.oc-foot { margin-top: 8px; }
.oc-msg { margin: 6px 0 0; font: 600 13px/1.35 var(--nk-ui, sans-serif); color: var(--nk-lapis, #2f5a9a); }
.oc-list { list-style: none; margin: 4px 0 10px; padding: 0; }
.oc-list li { display: flex; align-items: center; gap: 10px; padding: 5px 6px; border-bottom: 1px solid var(--nk-rule, #d8c8a6); cursor: pointer; }
.oc-list li.is-sel { background: var(--nk-sel, rgba(47, 90, 154, .13)); }
.oc-list .oc-n { flex: none; width: 22px; height: 22px; border-radius: 3px; background: #c8551e; color: #fff; display: flex; align-items: center; justify-content: center; font: 700 12px/1 var(--nk-ui, sans-serif); }
.oc-list .oc-label { flex: 1; min-width: 0; font: 500 14px/1.3 Georgia, serif; padding: 4px 6px; border: 1px solid transparent; background: transparent; color: var(--nk-ink, #211a12); border-radius: 2px; }
.oc-list .oc-label:hover, .oc-list .oc-label:focus { border-color: var(--nk-rule, #d8c8a6); background: #fffaf0; outline: none; }
.oc-list .oc-st { flex: none; font: 500 12px/1 var(--nk-ui, sans-serif); color: var(--nk-meta, #54442f); white-space: nowrap; }
.oc-preview { background: #1a1611; border-radius: 4px; padding: 10px 12px; color: #e8dcc2; }
.oc-preview .oc-pq { font: 500 13px/1.35 var(--nk-ui, sans-serif); margin-bottom: 8px; }
.oc-preview .oc-pa { font: 500 13px/1.35 var(--nk-ui, sans-serif); margin-top: 8px; color: #b9a681; }
.oc-mini img { max-height: 170px; }
.oc-figs { list-style: none; margin: 0; padding: 0; }
.oc-figs li { display: flex; gap: 10px; padding: 5px 2px; border-bottom: 1px dotted var(--nk-rule, #d8c8a6); cursor: pointer; font: 500 13px/1.3 var(--nk-ui, sans-serif); }
.oc-figs li .ch { margin-left: auto; color: var(--nk-meta, #54442f); white-space: nowrap; }
.oc-figs li.more { cursor: default; color: var(--nk-meta, #54442f); }
/* R11 (the lead, 17 Oct ~19:52): every dialog over the practice window is SOLID (the card behind never shows through):
   Edit SRS data, Fix later's note, the leech prompt's choices, any modal opened while practice is on screen */
.modal.lib-modal, .modal.pr-srsmodal, body:has(.st-on) .modal { background-color: #17130e; background-clip: padding-box; }
.modal.lib-modal .modal-body, .modal.pr-srsmodal .modal-body, body:has(.st-on) .modal .modal-body { background: #15110c; border-radius: 2px; }   /* as tome.css's dialogs */
body:has(.st-on) .modal-backdrop { background: rgba(3, 3, 4, 0.82); }
/* V7.2.4 (A2 + R12): the course page's new-card settings (a day; book order or shuffled in a chapter) */
.crs-set { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; font: 500 13px/1.3 var(--nk-ui, sans-serif); color: var(--nk-ink-2, #4e4031); }
.crs-set .l { color: var(--nk-meta, #54442f); }
.crs-set .crs-gap { margin-left: 10px; }
.crs-set .crs-step { min-width: 26px; padding: 0 6px; }
.crs-set .crs-npd { min-width: 40px; border: 1px solid var(--nk-rule, #d8c8a6); background: #fffaf0; border-radius: 3px; padding: 3px 6px; font: 600 13px/1.2 var(--nk-ui, sans-serif); color: var(--nk-ink, #211a12); cursor: text; }
.crs-set .crs-seg { display: inline-flex; }
.crs-set .crs-seg .nk-btn { border-radius: 0; } .crs-set .crs-seg .nk-btn:first-child { border-radius: 3px 0 0 3px; } .crs-set .crs-seg .nk-btn:last-child { border-radius: 0 3px 3px 0; margin-left: -1px; }
.crs-set .crs-seg .nk-btn.is-on { background: var(--nk-lapis, #2f5a9a); color: #fff; border-color: var(--nk-lapis, #2f5a9a); }

/* ---------------------------------------------------------------------------------------------- Import cards (V7.2.4 R12, v724-late)
   a page of the Library (js/ui-import.js): it replaced the retired deck window's import */
.im-left, .im-right { min-width: 0; }
.im-drop { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 14px 0 12px; padding: 16px 14px;
  border: 1.5px dashed var(--nk-rule, #d8c8a6); border-radius: 6px; background: rgba(255, 255, 255, 0.35); }
.im-drop.is-over { border-color: var(--nk-lapis, #2f5a9a); background: var(--nk-sel, rgba(47, 90, 154, 0.13)); }
.im-drop .im-file { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.im-drop label.im-pick { cursor: pointer; }
.im-msg { margin: 10px 0; padding: 6px 10px; border-left: 3px solid var(--nk-rule, #d8c8a6); font: 500 13px/1.45 var(--nk-ui); overflow-wrap: anywhere; }
.im-msg.is-ok { border-left-color: #2f7a68; color: #1f4f43; background: rgba(47, 122, 104, 0.08); }
.im-msg.is-warn { border-left-color: #a8321e; color: #7a2414; background: rgba(168, 50, 30, 0.07); }
.im-point { margin: 0 0 12px; }
.im-point b { display: block; font: 600 15px/1.3 var(--nk-read); color: var(--nk-ink); margin-bottom: 2px; }
.im-point p { margin: 0; }
.im-line { margin: 0 0 4px; font: 600 14px/1.4 var(--nk-read); color: var(--nk-ink); overflow-wrap: anywhere; }
.im-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 10px; }
.im-chips .nk-btn.im-chip { height: 26px; padding: 0 8px; font-size: 12px; }
.im-chips .nk-btn.im-chip.is-on { background: #e7eef8; border-color: var(--nk-lapis, #2f5a9a); color: #1f3f70; }
.im-npd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 12px; font: 500 13px/1.3 var(--nk-ui); color: var(--nk-ink); }
.im-npd input { width: 76px; font: 600 13px/1.2 var(--nk-ui); color: var(--nk-ink); background: #fffaf0; border: 1px solid var(--nk-rule, #d8c8a6); border-radius: 3px; padding: 4px 6px; }

/* V7.2.4 fixer: the tools row as one menu button when the book is one page (480 x 360) */
.lib-bar .lib-toolsbtn { display: none; }
.nk-layer.is-small .lib-bar .lib-toolsbtn { display: inline-flex; }
/* V7.2.4 fixer (the critic: the live preview touched the CARD SYNTAX heading under it) */
.lib-side .lib-cheat { margin-top: 18px; }

/* ============================================================================================== V7.3 lane L (v73-library)
 * The Library as THE place to write and organise: the tree (folders in folders, arrows, drag, the row menu, inline rename), the
 * breadcrumbs, the right page (Content · Exams, List | Shelf), the Shelf view (the bookcase), the Zaborav (its page, the toast).
 */
/* ---- the tree */
.lib-treehead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.lib-treehead .nk-h3 { margin-bottom: 6px; }
.lib-treehead .nk-meta { font-size: 11.5px; }
.nk-tree.lib-tree li.lib-row { position: relative; height: 30px; gap: 6px; padding: 0 4px 0 calc(4px + var(--d, 0) * 16px); cursor: pointer; user-select: none; -webkit-user-select: none; }
.nk-tree.lib-tree li.lib-row:hover { background: rgba(47, 90, 154, 0.06); }
.nk-tree.lib-tree li.lib-row.is-sel { background: var(--nk-sel); color: var(--nk-ink); box-shadow: inset 3px 0 0 var(--nk-lapis); }
.nk-tree.lib-tree li.lib-row.is-multi { background: rgba(47, 90, 154, 0.2); color: var(--nk-ink); }
.nk-tree.lib-tree li.lib-row.is-leaving, .lib-frow.is-leaving, .sh-scroll.is-leaving, .sh-tome.is-leaving { opacity: 0.3; pointer-events: none; }
.nk-tree.lib-tree li.lib-row.is-drop, .lib-frow.is-drop { background: rgba(184, 149, 90, 0.26); box-shadow: inset 0 0 0 2px #b8955a; }
.nk-tree.lib-tree li.lib-row.k-view.is-drop { background: rgba(90, 95, 110, 0.22); box-shadow: inset 0 0 0 2px #5a5f6e; }
.nk-tree.lib-tree li.lib-row:focus-visible { outline: 2px solid var(--nk-lapis); outline-offset: -2px; }
.nk-tree.lib-tree li.is-top { font-weight: 500; }
.nk-tree.lib-tree li.is-top .t b { color: var(--nk-ink); font-weight: 700; }
.nk-tree.lib-tree li.lib-gap { height: 8px; padding: 0; }
.nk-tree.lib-tree li.k-more { height: 26px; cursor: pointer; }
.lib-car { flex: none; display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 3px; background: none; color: var(--nk-meta); cursor: pointer; }
.lib-car svg { width: 11px; height: 11px; transition: transform 0.14s ease; }
.lib-car.is-open svg { transform: rotate(90deg); }
.lib-car:hover { background: rgba(47, 90, 154, 0.12); color: var(--nk-lapis); }
.lib-car.is-none { visibility: hidden; pointer-events: none; }
.lib-row .t { flex: 1; }
.lib-row .lib-sub { color: var(--nk-meta); font-weight: 500; }
.lib-row .lib-due { color: var(--nk-ember); font-weight: 600; }
.lib-dots { flex: none; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 3px; background: none; color: var(--nk-ink-2); font: 700 15px/1 var(--nk-ui); cursor: pointer; opacity: 0; }
.lib-row:hover .lib-dots, .lib-row:focus-within .lib-dots, .lib-row.is-sel .lib-dots, .lib-frow:hover .lib-dots, .lib-erow:hover .lib-dots, .lib-drow:hover .lib-dots { opacity: 1; }
.lib-dots:hover { background: rgba(47, 90, 154, 0.12); color: var(--nk-lapis); }
.lib-seal { display: inline-block; flex: none; width: 13px; height: 13px; margin-left: 7px; vertical-align: -2px; border-radius: 50%;
  background: radial-gradient(circle at 36% 34%, #fff0b8, #dcaa3a 46%, #8a5d0c); box-shadow: 0 0 0 1px #8a6414, 0 1px 1px rgba(0, 0, 0, 0.3); }
.lib-rename { width: 100%; height: 24px; padding: 0 6px; border: 1px solid var(--nk-lapis); border-radius: 3px; background: #fffdf6; color: var(--nk-ink); font: 500 14px/1 var(--nk-ui); }
.lib-newbtns { flex-wrap: wrap; }
/* the row menu (right-click or ⋯) */
.lib-menu { position: fixed; z-index: 9000; min-width: 236px; max-width: 330px; padding: 6px 0; background: #fffaf0; border: 1px solid #c9b994; border-radius: 6px;
  box-shadow: 0 14px 30px rgba(40, 30, 10, 0.32); font-family: var(--nk-ui); }
.lib-mi { display: grid; width: 100%; padding: 6px 14px; border: 0; background: none; text-align: left; cursor: pointer; }
.lib-mi .l { font: 600 13.5px/1.25 var(--nk-ui); color: var(--nk-ink); }
.lib-mi .w { font: 500 11.5px/1.3 var(--nk-ui); color: var(--nk-meta); }
.lib-mi:hover, .lib-mi:focus { background: var(--nk-sel); outline: none; }
.lib-mi.is-danger .l { color: #8f2d1f; }
.lib-msep { height: 1px; margin: 5px 12px; background: var(--nk-rule); }
/* a drag */
.lib-ghost { position: fixed; z-index: 9500; pointer-events: none; max-width: 260px; padding: 5px 10px; border-radius: 4px; background: #1b2740; color: #e2c48a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font: 600 13px/1.2 "Avenir Next", Avenir, system-ui, sans-serif; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4); opacity: 0.94; }
.lib-ghost.is-ok { background: #2f5a9a; color: #fff; }
.lib-ghost.is-del { background: #5a5f6e; color: #eef1f7; }
body.lib-dragging, body.lib-dragging * { cursor: grabbing !important; user-select: none !important; -webkit-user-select: none !important; }
/* ---- the breadcrumbs (one helper, every page) */
.lib-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 5px; }
.lib-cr { max-width: 230px; padding: 1px 3px; border: 0; border-radius: 3px; background: none; color: var(--nk-lapis); font: inherit; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-cr:hover, .lib-cr:focus-visible { background: rgba(47, 90, 154, 0.09); text-decoration: underline; outline: none; }
.lib-cr-sep { color: var(--nk-meta); }
.lib-cr-now { color: var(--nk-ink-2); font-weight: 600; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-head .lib-crumb { margin-bottom: 6px; }
/* ---- the right page: what you picked */
.lib-fhead { align-items: flex-start; }
.lib-fhead .nk-h2 svg { width: 24px; height: 24px; vertical-align: -3px; }
.lib-fhead .nk-head__r { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.lib-seg { display: inline-flex; }
.lib-seg .nk-btn { border-radius: 0; }
.lib-seg .nk-btn:first-child { border-radius: 4px 0 0 4px; }
.lib-seg .nk-btn:last-child { border-radius: 0 4px 4px 0; margin-left: -1px; }
.lib-seg .nk-btn.is-on { background: var(--nk-lapis); border-color: var(--nk-lapis); color: #f4ecdb; }
.lib-dots2 { width: 32px; justify-content: center; padding: 0; }
.lib-subtabs { margin-top: 2px; }
.lib-gh { margin: 14px 0 4px; }
.lib-frows, .lib-erows, .lib-exams { list-style: none; margin: 0 0 4px; padding: 0; }
.lib-frow { display: grid; grid-template-columns: 22px minmax(0, 1fr) 40px 124px 30px 24px; gap: 10px; align-items: center; min-height: 42px; padding: 2px 6px; border-bottom: 1px solid rgba(216, 200, 166, 0.6);
  cursor: pointer; font: 600 15px/1.2 var(--nk-ui); color: var(--nk-ink); user-select: none; -webkit-user-select: none; }
.lib-frow:hover, .lib-erow:hover { background: rgba(47, 90, 154, 0.06); }
.lib-frow .t, .lib-erow .t { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-frow .t small, .lib-erow .t small, .lib-exams .t small { display: block; font: 500 12px/1.3 var(--nk-ui); color: var(--nk-meta); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lib-frow .due { font: 600 12.5px/1 var(--nk-ui); color: var(--nk-ember); text-align: right; font-variant-numeric: tabular-nums; }
.lib-frow .due.zero { color: var(--nk-meta); font-weight: 500; }
.lib-frow .kn { display: grid; grid-template-columns: 1fr 34px; gap: 8px; align-items: center; font: 600 12px/1 var(--nk-ui); color: var(--nk-ink-2); text-align: right; }
.lib-erow { display: grid; grid-template-columns: 22px minmax(0, 1fr) 24px; gap: 10px; align-items: center; min-height: 42px; padding: 2px 6px; border-bottom: 1px solid rgba(216, 200, 166, 0.6);
  cursor: pointer; font: 600 15px/1.2 var(--nk-ui); color: var(--nk-ink); user-select: none; -webkit-user-select: none; }
.lib-erow .nk-ico, .lib-frow .nk-ico { width: 19px; height: 19px; }
.crs-row.lib-drow .crs-pillbox .lib-dots { opacity: 1; width: 28px; height: 28px; border-left: 1px solid var(--nk-rule); border-radius: 0; font-size: 14px; }
.lib-exams li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 44px; border-bottom: 1px solid var(--nk-rule); }
.lib-exams .t b { font: 600 15px/1.2 var(--nk-ui); color: var(--nk-ink); }
.lib-exnote { margin: 6px 0 2px; }
.lib-empty { margin-top: 10px; }
.lib-word, .zb-toast .ot { border-bottom: 1px dotted currentColor; cursor: help; }

/* ---- the Shelf view: the Library as a bookcase (our own look: walnut, brass plates, vellum scrolls, leather spines) */
.sh-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.sh-case { position: relative; margin: 6px 0 14px; padding: 10px 12px 12px; border-radius: 7px 7px 3px 3px;
  background: linear-gradient(90deg, #321e10, #57381f 5%, #4a2e18 50%, #57381f 95%, #321e10);
  box-shadow: inset 0 0 0 2px #24140a, inset 0 0 0 4px rgba(255, 210, 150, 0.08), 0 8px 16px rgba(40, 25, 10, 0.32); }
.sh-crown { margin: -2px -4px 10px; padding: 7px 0 8px; text-align: center; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, #74502d, #4c2f18);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 220, 160, 0.28); }
.sh-crown span { font: 700 13px/1 var(--cx-font-title, Georgia, serif); letter-spacing: 0.2em; text-transform: uppercase; color: #e2c48a; text-shadow: 0 1px 0 #1c0f06; }
.sh-shelf { position: relative; margin-bottom: 12px; }
.sh-back { min-height: 128px; padding: 12px 10px 0; border-radius: 3px 3px 0 0; overflow: hidden;
  background: repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.06) 0 2px, rgba(255, 255, 255, 0.025) 2px 11px), linear-gradient(180deg, #24150a, #3a2311 60%, #2c1a0c);
  box-shadow: inset 0 12px 18px rgba(0, 0, 0, 0.55), inset 0 -3px 6px rgba(0, 0, 0, 0.35); }
.sh-items { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; min-height: 116px; }
.sh-items.is-empty { align-items: center; justify-content: center; }
.sh-items.is-empty span { font: italic 500 13px/1 var(--nk-read); color: rgba(226, 196, 138, 0.45); }
.sh-board { position: relative; display: flex; justify-content: center; height: 22px; border-radius: 0 0 3px 3px;
  background: linear-gradient(180deg, #93613a, #6f4626 55%, #523219); box-shadow: 0 4px 6px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 214, 160, 0.38); }
.sh-plate { position: relative; top: 2px; height: 18px; max-width: 76%; padding: 0 16px; border: 0; border-radius: 3px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: linear-gradient(180deg, #eed59a, #caa65c 52%, #a6823c); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), inset 0 -1px 0 rgba(0, 0, 0, 0.28), 0 1px 2px rgba(0, 0, 0, 0.55);
  font: 700 10.5px/18px var(--nk-ui); letter-spacing: 0.13em; text-transform: uppercase; color: #3b2711; text-shadow: 0 1px 0 rgba(255, 244, 210, 0.65); }
.sh-plate::before, .sh-plate::after { content: ''; position: absolute; top: 7px; width: 4px; height: 4px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff2c2, #8a6414); }
.sh-plate::before { left: 5px; } .sh-plate::after { right: 5px; }
.sh-plate:hover, .sh-plate:focus-visible { filter: brightness(1.08); outline: none; }
.sh-shelf.is-drop .sh-back { box-shadow: inset 0 0 0 3px #e2c48a, inset 0 12px 18px rgba(0, 0, 0, 0.45); }
.sh-plate.is-drop { box-shadow: 0 0 0 2px #fff2c2, 0 0 12px rgba(233, 195, 90, 0.8); }
/* the rack: pigeonholes, a scroll lying in each */
.sh-rack { display: grid; grid-template-columns: repeat(var(--cols, 2), 100px); padding: 4px; border-radius: 3px; background: #5d3c21;
  box-shadow: inset 0 0 0 2px #3a2414, inset 0 1px 0 rgba(255, 214, 160, 0.25), 0 3px 5px rgba(0, 0, 0, 0.5); }
.sh-cell { display: grid; place-items: center; width: 100px; height: 38px; background: linear-gradient(180deg, #170d06, #2a180c);
  box-shadow: inset 0 0 0 2px #5d3c21, inset 0 7px 8px rgba(0, 0, 0, 0.65); }
.sh-rack.is-wide { flex: 1 1 100%; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
.sh-rack.is-wide .sh-cell { width: auto; }
.sh-scroll { display: block; padding: 0; border: 0; background: none; line-height: 0; cursor: pointer; }
.sh-scroll-svg { display: block; transition: transform 0.15s ease, filter 0.15s ease; filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 0.55)); }
.sh-scroll:hover .sh-scroll-svg, .sh-scroll:focus-visible .sh-scroll-svg { transform: translateX(-4px); filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.6)) brightness(1.06); }
.sh-scroll:focus-visible { outline: none; }
.sh-scroll-t { font: 700 8.6px/1 "Avenir Next", Avenir, system-ui, sans-serif; fill: #4b3820; letter-spacing: 0.02em; }
/* the tomes: spines standing */
.sh-tomes { display: flex; align-items: flex-end; gap: 2px; padding: 0 2px; }
.sh-tome { position: relative; flex: none; display: flex; align-items: center; justify-content: center; padding: 0; border: 0; cursor: pointer; transition: transform 0.15s ease; }
.sh-tome:hover, .sh-tome:focus-visible { transform: translateY(-5px); outline: none; }
.sh-tome--plain { border-radius: 3px 3px 1px 1px; box-shadow: 0 2px 3px rgba(0, 0, 0, 0.55);
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.38), rgba(255, 255, 255, 0.09) 30%, rgba(0, 0, 0, 0.12) 70%, rgba(0, 0, 0, 0.42)), var(--c, #24406b); }
.sh-tome--plain::before, .sh-tome--plain::after { content: ''; position: absolute; left: 0; right: 0; height: 3px; background: rgba(0, 0, 0, 0.35); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12); }
.sh-tome--plain::before { top: 14px; } .sh-tome--plain::after { bottom: 14px; }
.sh-tome-t { writing-mode: vertical-rl; transform: rotate(180deg); max-height: calc(100% - 34px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 600 10.5px/1 var(--nk-read); color: #f1e4c8; letter-spacing: 0.03em; }
.sh-tome.tome-spine { width: auto; }
.sh-tome.tome-spine .tome-spine__title { font-size: 10.5px; padding: 4px 2px; }
.sh-gilded { box-shadow: 0 0 0 1px #d9b14a, 0 2px 4px rgba(0, 0, 0, 0.55), 0 0 12px rgba(233, 195, 90, 0.42); }
.sh-gilded .tome-spine__title { color: #f7e3a2 !important; text-shadow: 0 0 5px rgba(233, 195, 90, 0.55); }
.sh-gilded::selection { background: none; }
/* a bound deck (Zapis) and a bound scroll (Konspekt) */
.sh-deck { position: relative; display: flex; align-items: flex-end; justify-content: center; width: 50px; height: 40px; border-radius: 3px; cursor: default;
  background: linear-gradient(180deg, #7a4a28, #5a3419); box-shadow: inset 0 0 0 1px #2e1a0c, inset 0 8px 0 rgba(255, 220, 160, 0.14), 0 2px 3px rgba(0, 0, 0, 0.5); }
.sh-deck i { position: absolute; left: 7px; right: 7px; top: -6px; height: 10px; border-radius: 2px 2px 0 0; background: repeating-linear-gradient(90deg, #f4ecdb 0 2px, #d9c9a4 2px 3px); box-shadow: 0 -1px 0 #a89470; }
.sh-deck b { margin-bottom: 4px; font: 700 8.5px/1 var(--nk-ui); color: #f0dcb0; letter-spacing: 0.04em; }
.sh-deck--zlato, .sh-deck--serebro { box-shadow: inset 0 0 0 1px #d9b14a, 0 2px 3px rgba(0, 0, 0, 0.5), 0 0 8px rgba(233, 195, 90, 0.35); }
.sh-bundle { position: relative; display: block; width: 96px; height: 50px; cursor: default; }
.sh-bundle .sh-scroll-svg { position: absolute; left: 0; }
.sh-bundle .sh-scroll-svg.b1 { top: 0; } .sh-bundle .sh-scroll-svg.b2 { top: 17px; left: 3px; }
.sh-bundle b { position: absolute; left: 18px; top: 40px; font: 700 8.5px/1 var(--nk-ui); color: #e2c48a; }
.sh-more { color: #e2c48a; text-align: center; margin: 4px 0 8px; }
.sh-foot { height: 4px; }

/* ---- the Zaborav: its page and the corner toast */
.zb-h2 .nk-ico { width: 24px; height: 24px; vertical-align: -4px; }
.zb-list { list-style: none; margin: 8px 0 0; padding: 0; }
.zb-row { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto auto; gap: 10px; align-items: center; min-height: 48px; padding: 4px 6px; border-bottom: 1px solid rgba(216, 200, 166, 0.6); }
.zb-row .nk-ico { width: 19px; height: 19px; }
.zb-row .zb-t { min-width: 0; }
.zb-row .zb-t b { display: block; font: 600 14.5px/1.25 var(--nk-ui); color: var(--nk-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zb-row .zb-t small { display: block; font: 500 12px/1.3 var(--nk-ui); color: var(--nk-meta); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.zb-row.is-sending { opacity: 0.6; }
.zb-days { font: 600 12px/1 var(--nk-ui); color: var(--nk-meta); white-space: nowrap; font-variant-numeric: tabular-nums; }
.zb-days.is-low { color: var(--nk-ember); }
.zb-back, .zb-forget { height: 28px; }
.zb-forget.is-sure { background: #8f2d1f; border-color: #8f2d1f; color: #fff; }
.zb-empty { margin-top: 12px; }
.zb-toast { position: fixed; right: 18px; bottom: 104px; z-index: 9800; display: flex; align-items: center; gap: 10px; max-width: min(470px, calc(100vw - 36px)); padding: 10px 12px 13px;
  overflow: hidden; border-radius: 6px; background: #1b2740; color: #e6ecf7; font: 500 14px/1.3 "Avenir Next", Avenir, system-ui, sans-serif;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45), inset 0 0 0 1px #b8955a; opacity: 0; transform: translateY(14px); pointer-events: none; transition: opacity 0.18s ease, transform 0.18s ease; }
.zb-toast.is-on { opacity: 1; transform: none; pointer-events: auto; }
.zb-toast b { color: #f4ecdb; font-weight: 600; }
.zb-toast .zb-ico { flex: none; display: grid; place-items: center; }
.zb-toast .zb-ico svg { width: 22px; height: 22px; }
.zb-toast .zb-txt { min-width: 0; }
.zb-toast .ot, .zb-toast .lib-word { color: #e2c48a; }
.zb-undo { flex: none; height: 28px; padding: 0 13px; border: 1px solid #e2c48a; border-radius: 4px; background: transparent; color: #e2c48a; font: 700 13px/1 "Avenir Next", Avenir, system-ui, sans-serif; cursor: pointer; }
.zb-undo:hover, .zb-undo:focus-visible { background: rgba(226, 196, 138, 0.16); outline: none; }
.zb-undo[disabled] { opacity: 0.7; cursor: default; }
/* V7.3 fixer B: the toast's door to the Zaborav, and the tree head's */
.zb-open { flex: none; height: 28px; padding: 0 8px; border: 0; background: transparent; color: #cdb98e; font: 600 12px/1 "Avenir Next", Avenir, system-ui, sans-serif; text-decoration: underline; cursor: pointer; }
.zb-open:hover, .zb-open:focus-visible { color: #f0dcae; outline: none; }
.lib-zbtop { margin-left: auto; flex: none; border: 0; background: transparent; padding: 0 2px; color: inherit; opacity: 0.85; font: 600 12px/1.2 "Avenir Next", Avenir, system-ui, sans-serif; text-decoration: underline dotted; cursor: pointer; }
.lib-zbtop:hover, .lib-zbtop:focus-visible { opacity: 1; outline: none; }
.zb-time { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #e2c48a; transform-origin: left center; }
.zb-toast.is-on .zb-time { animation: zb-time var(--zb-ms, 8s) linear forwards; }
.zb-toast.is-held .zb-time { animation-play-state: paused; }
@keyframes zb-time { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .zb-toast { transition: none; } .zb-toast.is-on .zb-time { animation: none; } .sh-scroll-svg, .sh-tome, .lib-car svg { transition: none; } }

/* ---- one page (a small window, 480 x 360) */
.nk-layer.is-small .nk-tree.lib-tree li.lib-row { height: 24px; font-size: 12.5px; padding-left: calc(2px + var(--d, 0) * 12px); }
.nk-layer.is-small .lib-dots { opacity: 1; width: 18px; height: 18px; }
.nk-layer.is-small .lib-frow { grid-template-columns: 18px minmax(0, 1fr) 30px 26px 20px; gap: 6px; min-height: 30px; font-size: 12.5px; }
.nk-layer.is-small .lib-frow .kn { display: none; }
.nk-layer.is-small .lib-erow { min-height: 30px; font-size: 12.5px; }
.nk-layer.is-small .lib-fhead .nk-head__r { gap: 4px; }
.nk-layer.is-small .lib-fhead .nk-btn { height: 24px; padding: 0 7px; font-size: 11.5px; }
.nk-layer.is-small .sh-case { padding: 6px 6px 8px; }
.nk-layer.is-small .sh-rack { grid-template-columns: repeat(min(var(--cols, 2), 2), 100px); }
.nk-layer.is-small .sh-rack.is-wide { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
.nk-layer.is-small .sh-back { min-height: 96px; padding: 8px 6px 0; }
.nk-layer.is-small .sh-items { min-height: 86px; gap: 8px; }
.nk-layer.is-small .zb-row { grid-template-columns: 18px minmax(0, 1fr) auto auto; }
.nk-layer.is-small .zb-days { display: none; }
.nk-layer.is-small .zb-back, .nk-layer.is-small .zb-forget { height: 24px; padding: 0 7px; font-size: 11.5px; }
.lib-fhead { margin-bottom: 8px; }
.lib-fhead .nk-h2 .nk-ico { width: 24px; height: 24px; vertical-align: -3px; }
.lib-fbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 12px; }
.lib-fbar .nk-btn { height: 28px; }
.lib-fbar-gap { flex: 1; }
.nk-layer.is-small .lib-fbar .nk-btn { height: 22px; padding: 0 6px; font-size: 11px; }
@media (max-height: 600px) { .zb-toast { right: 12px; bottom: 12px; } }

/* ---------------------------------------------------------------------------------------------- V7.3 lane L (v73-scrolls): one writing system
 * A plain note page (items 16-17): rows are plain (no bullet) unless you make a list ("- " a bullet, "1. " a number); a card line
 * and its answer lines share ONE soft background (RemNote's look); the Notes view lays the scroll across the open book. */
.ed-tx { padding-left: calc(6px + var(--in, 0) * 22px); }
.ed-tx::before { display: none; }
.ed-row.is-li .ed-tx { padding-left: calc(24px + var(--in, 0) * 22px); }
.ed-row.is-li .ed-tx::before { display: block; left: calc(10px + var(--in, 0) * 22px); top: 12px; width: 5px; height: 5px; background: var(--nk-ink-2, #5b4a33); }
.ed-row.k-heading .ed-tx { padding-left: calc(6px + var(--in, 0) * 22px); }
.ed-row.k-child .ed-tx::after { left: calc(var(--in, 0) * 22px - 4px); }
.ed-row.cb .ed-tx { background: rgba(198, 160, 92, 0.15); }
.ed-row.cb.cb-a .ed-tx { border-radius: 6px 6px 0 0; margin-top: 3px; }
.ed-row.cb.cb-z .ed-tx { border-radius: 0 0 6px 6px; margin-bottom: 3px; }
.ed-row.cb.cb-a.cb-z .ed-tx { border-radius: 6px; }
.ed-row.cb.cb-off .ed-tx { background: rgba(120, 112, 100, 0.10); }
.ed-row.cb.is-caret .ed-tx { background: rgba(198, 160, 92, 0.24); }
.ed-row.cb.is-sel .ed-tx { background: rgba(47, 90, 154, 0.14); }
.ed-row.cb .ed-tx::after { display: none; }
.ed-tx u { text-decoration-thickness: 1px; text-underline-offset: 2px; }
.nk-layer.is-small .ed-tx { padding-left: calc(4px + var(--in, 0) * 14px); }
.nk-layer.is-small .ed-row.is-li .ed-tx { padding-left: calc(14px + var(--in, 0) * 14px); }
.nk-layer.is-small .ed-row.is-li .ed-tx::before { left: calc(5px + var(--in, 0) * 14px); top: 8px; width: 4px; height: 4px; }
/* the head: the look and the Notes · Cards switch; B I U in the tools row */
.lib-look { font: 700 10px/1 var(--st-ui, sans-serif); letter-spacing: 0.08em; text-transform: uppercase; color: #8a6a32; border: 1px solid #d9c08a;
  border-radius: 10px; padding: 3px 8px; background: rgba(226, 196, 138, 0.18); align-self: center; cursor: help; }
.lib-viewseg { margin-left: auto; align-self: center; }
.lib-viewseg .nk-btn { height: 24px; padding: 0 10px; font-size: 12px; }
.lib-tools .nk-btn.lib-fmt { font-family: Georgia, serif; font-size: 14px; }
.lib-tools .nk-btn.lib-fmt-b { font-weight: 700; }
.lib-tools .nk-btn.lib-fmt-i { font-style: italic; }
.lib-tools .nk-btn.lib-fmt-u { text-decoration: underline; }
/* Notes: the scroll across the open book (the card table's one sheet, .lib-wide, which the Nauka takes away when it draws
 * anything else; .lib-scroll only adds the comfortable text column, so a class left behind changes nothing) */
.nk-layer.lib-wide.lib-scroll .lib-edhost { max-width: 980px; margin: 0 auto; }
.nk-layer.lib-wide.lib-scroll .lib-head .lib-ttl, .nk-layer.lib-wide.lib-scroll .lib-head .lib-bar, .nk-layer.lib-wide.lib-scroll .lib-head .lib-tools { max-width: 1060px; margin-left: auto; margin-right: auto; }
.nk-layer.is-small.lib-wide.lib-scroll .lib-edhost { max-width: none; }
/* the Shelf: a scroll bound by "Finish work" (Konspekt) wears a gold cord and a soft gold glow */
.sh-scroll.is-bound .sh-scroll-svg { filter: drop-shadow(0 0 3px rgba(233, 195, 90, 0.55)); }
/* a forged tome in a light binding (unbound manuscript, Lipa): its label keeps dark ink (gold on a light label could not be read), framed in gold */
.sh-gilded.tome-spine--unbound .tome-spine__title, .sh-gilded.tome-spine--lyko .tome-spine__title { color: #4a3008 !important; text-shadow: none; box-shadow: inset 0 0 0 1px #d9b14a; }
/* ===== V7.7 (v77-pictures): picture cards as a normal card type, the "!" on unfinished documents ===== */
.ed-row.is-fold { display: none; }
.ed-chip.ed-chip-pic { background: #e2d6ee; border-color: #b9a6cf; color: #3a2a52; }
.ed-row.k-pic:not(.is-caret) .ed-tx { cursor: pointer; }
.ed-pic { display: inline-flex; align-items: center; gap: 8px; margin: 2px 0 0 10px; vertical-align: middle; cursor: pointer; font: 600 12px/1.2 var(--nk-ui); color: var(--nk-ink-2); }
.ed-row.is-caret .ed-pic { margin: 4px 0 2px 0; }
.ed-pic-th { position: relative; display: inline-block; height: 44px; max-width: 120px; overflow: hidden; border: 1px solid #b9a681; border-radius: 3px; background: #fff; line-height: 0; }
.ed-pic-th img { height: 44px; width: auto; display: block; }
.ed-pic-box { position: absolute; box-sizing: border-box; background: #c8551e; border: 1px solid #8a3510; }
.ed-pic-box.is-empty { background: #fff6ee; border: 1px dashed #a8321e; }
.ed-pic:hover .ed-pic-th { border-color: var(--nk-lapis); }
.ed-pic:hover .ed-pic-n { color: var(--nk-lapis); text-decoration: underline; }
.ed-pic.is-need .ed-pic-n { color: #8a2e10; }
.ed-unfin { display: inline-grid; place-items: center; flex: none; width: 16px; height: 16px; border-radius: 3px; background: #a8321e; color: #fff; font: 700 11px/1 var(--nk-ui); vertical-align: middle; }
.ed-gut .ed-unfin { margin-left: 4px; }
.ed-row.r-box .ed-role { color: #5a3f7a; }
.ed-noans { color: #8a2e10; font-style: italic; font-family: var(--nk-ui); font-size: 13px; }
.lib-unfin { display: inline-grid; place-items: center; width: 16px; height: 16px; margin: 0 0 0 6px; padding: 0; border: 0; border-radius: 3px; background: #a8321e; color: #fff;
  font: 700 11px/1 var(--nk-ui); vertical-align: 1px; cursor: pointer; }
.lib-unfin:hover, .lib-unfin:focus-visible { background: #7e2212; outline: 2px solid rgba(168, 50, 30, 0.35); outline-offset: 1px; }
.lib-unfslot:empty { display: none; }
.lib-ttl .lib-unfin { width: 20px; height: 20px; font-size: 13px; margin-left: 0; }
/* the picture page: each box's answer next to its box */
.oc-tag { position: absolute; display: inline-flex; align-items: center; gap: 4px; max-width: 46%; padding: 2px 6px 2px 2px; border: 1px solid #8a7656; border-radius: 3px;
  background: #fffaf0; color: #211a12; font: 600 12px/1.25 var(--nk-ui, sans-serif); white-space: nowrap; pointer-events: none; z-index: 2; }
.oc-tag b { flex: none; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 2px; background: #c8551e; color: #fff; font-size: 10.5px; }
.oc-tag .oc-tag-t { overflow: hidden; text-overflow: ellipsis; }
.oc-tag.is-empty { border-style: dashed; border-color: #a8321e; color: #8a2e10; font-style: italic; }
.oc-tag.is-sel { box-shadow: 0 0 0 2px var(--nk-lapis, #2f5a9a); }
.oc-list .oc-label.is-empty { border-color: #c98a6e; background: #fff6ee; }
.oc-sugs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; }
.oc-sugs .oc-sugb { padding: 3px 8px; font-size: 12.5px; }
.oc-saved { margin: 4px 0 0; }
.ed-pop.is-compact { max-height: 470px; }
.ed-pop.is-compact .ed-pop-it { padding: 4px 12px; }
