/* Notes + Library (kept separate from app.css so small features ship as small files) */
.abil-name { letter-spacing: .01em; }

/* slide-out notepad + its tab on the right edge */
.notes-tab { position: fixed; right: 0; top: 45%; z-index: 40; writing-mode: vertical-rl; font: inherit; font-weight: 600; font-size: .85rem;
  padding: .8rem .4rem; border: 1px solid var(--line); border-right: 0; border-radius: var(--radius) 0 0 var(--radius);
  background: var(--panel); color: var(--ink); cursor: pointer; box-shadow: var(--shadow); }
.notes-tab:hover, .notes-tab.on { color: var(--accent); border-color: var(--accent); box-shadow: var(--glow), var(--shadow); }
.notes-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 92vw); z-index: 60; background: var(--panel); border-left: 1px solid var(--line);
  box-shadow: -10px 0 30px #0004; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; transform: translateX(105%); transition: transform .2s ease; }
.notes-drawer.open { transform: none; }
.notes-drawer textarea { flex: 1; resize: none; line-height: 1.5; }
.notes-drawer h2 { margin: 0; }

/* notes page */
.notes-grid { display: grid; grid-template-columns: 280px 1fr; gap: 1rem; align-items: start; }
.notes-list { position: sticky; top: 4.4rem; max-height: calc(100vh - 6rem); overflow: auto; }
.notes-list .list { margin-top: .6rem; }
.note-li { font: inherit; color: inherit; width: 100%; text-align: left; background: none; border: 0; border-radius: var(--radius); padding: .5rem .55rem; cursor: pointer; display: flex; flex-direction: column; gap: .1rem; }
.note-li:hover { background: var(--panel2); }
.note-li.on { background: var(--panel2); box-shadow: inset 3px 0 0 var(--accent); }
.note-li strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notes-editor { display: flex; flex-direction: column; gap: .6rem; min-height: 60vh; }
.note-title { font-family: var(--head); font-size: 1.3rem; font-weight: 700; border: 0; border-bottom: 2px solid var(--line); border-radius: 0; background: transparent; padding: .2rem 0; flex: 1; min-width: 12rem; }
#n-body { flex: 1; min-height: 55vh; line-height: 1.55; }

/* library */
.drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 1.1rem; text-align: center; color: var(--muted); cursor: pointer; margin-bottom: 1rem; background: var(--panel); transition: border-color .15s, background .15s; }
.drop:hover, .drop:focus-visible, .drop.over { border-color: var(--accent); color: var(--ink); }
.drop.over { background: var(--panel2); box-shadow: var(--glow); }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1rem; }
.lib-card { display: flex; flex-direction: column; gap: .5rem; margin: 0; padding: .6rem; }
.lib-thumb { display: grid; place-items: center; aspect-ratio: 4 / 3; width: 100%; border: 1px solid var(--line2); border-radius: calc(var(--radius) * .7); background: var(--panel2); overflow: hidden; cursor: zoom-in; padding: 0; }
.lib-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-icon { font-size: 2.6rem; }
.lib-meta { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.lib-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* picture viewer */
.modal.viewer-modal { width: min(1400px, 100%); height: 92vh; display: flex; flex-direction: column; gap: .5rem; padding: .7rem; }
.viewer-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer { flex: 1; position: relative; overflow: hidden; background: #0b0b0d; border-radius: calc(var(--radius) * .7); touch-action: none; cursor: grab; }
.viewer:active { cursor: grabbing; }
.viewer img { position: absolute; top: 0; left: 0; transform-origin: 0 0; max-width: none; user-select: none; }

@media (max-width: 820px) {
  .notes-grid { grid-template-columns: 1fr; }
  .notes-list { position: static; max-height: 14rem; }
}
@media print { .notes-tab, .notes-drawer { display: none !important; } }
