html body .course-library-sheet{position:fixed;inset:64px 0 0 auto;width:var(--formula-width,400px);max-width:calc(100vw - 16px);height:calc(100dvh - 64px);z-index:var(--z-drawer,1000);box-sizing:border-box;color:var(--ink);pointer-events:auto}
html body .course-library-sheet[hidden]{display:none}
html body .course-library-card{display:flex;flex-direction:column;width:100%;height:100%;padding:var(--space-5);gap:var(--space-3);overflow:hidden;box-sizing:border-box;border:1px solid var(--line);border-right:0;border-bottom:0;border-radius:12px 0 0;background:var(--surface);box-shadow:var(--shadow-panel);font:var(--text-base)/1.5 var(--font-ui)}
html body .course-library-sheet-handle{display:none}
html body .course-library-header{display:flex;align-items:center;justify-content:space-between;gap:var(--space-2);flex-shrink:0;margin:0}
html body .course-library-header h2{margin:0;font-size:18px;line-height:1.2;font-weight:700}
html body .course-library-close{width:36px;min-width:36px;height:36px;min-height:36px;padding:0;border:1px solid var(--line);border-radius:var(--radius-md);background:transparent;color:var(--ink);font:inherit;font-size:20px;line-height:1;cursor:pointer}
html body .course-library-close:hover{background:var(--surface-hover)}
html body .course-library-close:focus-visible,html body .course-library-search:focus-visible,html body .course-library-tree-item:focus-visible,html body .course-library-point-card:focus-visible{outline:2px solid var(--focus-ring);outline-offset:2px}
html body .course-library-search{width:100%;min-height:42px;flex-shrink:0;box-sizing:border-box;padding:0 var(--space-3);border:1px solid var(--line);border-radius:var(--radius-md);background:var(--surface-soft);color:var(--ink);font:inherit}
html body .course-library-search::placeholder{color:var(--muted)}
html body .course-library-body{display:grid;grid-template-columns:minmax(108px,38%) minmax(0,1fr);gap:var(--space-3);min-height:0;flex:1}
html body .course-library-tree,html body .course-library-points-pane{min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain}
html body .course-library-tree{padding-right:var(--space-2);border-right:1px solid var(--line)}
html body .course-library-tree-group{display:grid;gap:var(--space-1);margin:var(--space-1) 0 var(--space-1);padding-left:var(--space-2);border-left:1px solid var(--line)}
html body .course-library-tree-group.is-deeper{margin-left:var(--space-2);padding-left:var(--space-2)}
html body .course-library-tree-item{display:block;width:100%;min-height:32px;padding:var(--space-2) var(--space-2);border:0;border-radius:var(--radius-sm);background:transparent;color:var(--ink);font:inherit;font-size:12px;line-height:1.35;text-align:left;white-space:normal;cursor:pointer}
html body .course-library-tree-item:hover{background:var(--surface-hover)}
html body .course-library-tree-item[aria-current=true]{background:var(--n-100);color:var(--n-900);font-weight:650}
html body .course-library-tree-item.is-nested{font-size:11px}
html body .course-library-points-pane{padding-right:var(--space-1)}
html body .course-library-points{display:grid;gap:var(--space-2)}
html body .course-library-point-card{display:grid;gap:var(--space-2);width:100%;box-sizing:border-box;padding:var(--space-3) var(--space-3) var(--space-2);border:1px solid var(--line);border-radius:var(--radius-card);background:var(--surface);color:var(--ink);text-align:left;cursor:pointer}
html body .course-library-point-card:hover,html body .course-library-point-card:focus-visible{border-color:var(--n-600);box-shadow:var(--shadow-panel)}
html body .course-library-point-card[aria-busy=true]{opacity:.62;pointer-events:none}
html body .course-library-point-head{display:flex;align-items:flex-start;gap:var(--space-2);justify-content:space-between}
html body .course-library-point-head h4{min-width:0;margin:0;font-size:13px;line-height:1.35;font-weight:650}
html body .course-library-difficulty{flex:none;padding:var(--space-1) var(--space-2);border:1px solid var(--line);border-radius:var(--radius-tag);background:var(--surface-hover);color:var(--muted);font-size:11px;line-height:1.2}
html body .course-library-breadcrumb,html body .course-library-point-hint,html body .course-library-empty,html body .course-library-status{margin:0;color:var(--muted);font-size:11px;line-height:1.45}
html body .course-library-point-hint{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
html body .course-library-formulas{display:grid;align-items:stretch;gap:var(--space-2);min-height:0;overflow:visible}
html body .course-library-formula-label{display:block;color:var(--muted);font-size:12px;line-height:1.3;font-weight:650;writing-mode:horizontal-tb;letter-spacing:0}
html body .course-library-formula-list{display:grid;gap:var(--space-1);min-width:0;max-height:132px;overflow:auto}
html body .course-library-formula-entry{display:flex;align-items:center;gap:var(--space-2);min-width:0;min-height:36px;padding:var(--space-1) var(--space-2);border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface-soft)}
html body .course-library-formula-name{min-width:0;flex:1 1 auto;color:var(--ink);font-size:12px;line-height:1.35;font-weight:600;overflow-wrap:anywhere}
html body .course-library-formula-thumb{display:inline-flex;align-items:center;justify-content:center;flex:0 0 56px;width:56px;height:28px;overflow:hidden;padding:var(--space-1) var(--space-1);border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface);color:var(--muted)}
html body .course-library-formula-thumb svg{width:auto;max-width:100%;height:22px;fill:currentColor;color:var(--ink)}
html body .course-library-thumb-loading,html body .course-library-thumb-fallback{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10px}
html body .course-library-point-action{justify-self:end;padding:var(--space-1) var(--space-2);border-radius:var(--radius-sm);background:var(--n-900);color:var(--n-0);font-size:11px;line-height:1.25}
html body .course-library-status{flex-shrink:0;min-height:18px;padding-top:var(--space-1)}
@media(max-width:640px){
  html body .course-library-sheet{inset:auto 0 0;width:100%;max-width:100%;height:85dvh;max-height:85dvh}
  html body .course-library-card{padding:var(--space-3) var(--space-4) var(--space-4);gap:var(--space-3);border-radius:16px 16px 0 0;border:1px solid var(--line)}
  html body .course-library-sheet-handle{display:block;width:36px;height:4px;margin:0 auto;border-radius:999px;background:var(--n-400);flex:0 0 auto}
  html body .course-library-body{grid-template-columns:minmax(112px,34%) minmax(0,1fr);gap:var(--space-2)}
  html body .course-library-tree{padding-right:var(--space-2)}
  html body .course-library-tree-group{padding-left:var(--space-2)}
  html body .course-library-point-card{padding:var(--space-2) var(--space-2)}
}
/* UILibrary owns the drawer; preserve the existing subject tree and placement. */
html body .course-library-sheet.ui-library .course-library-card{border:0;border-radius:0;background:transparent;box-shadow:none;color:inherit;padding:16px 20px;gap:14px;min-height:0;overflow:auto}
html body .course-library-sheet.ui-library .course-library-header h2{font-size:26px}
html body .course-library-sheet.ui-library .course-library-tabs{display:flex;gap:4px;flex-wrap:wrap}
html body .course-library-sheet.ui-library .course-library-tabs [aria-pressed=true]{background:var(--lib-ink)!important;color:#fff!important}
html body .course-library-sheet.ui-library .course-library-body{grid-template-columns:100px minmax(0,1fr);min-height:220px}
html body .course-library-sheet.ui-library .course-library-point-card{border-radius:16px;background:var(--lib-card);box-shadow:0 1px 2px rgb(0 0 0/.06);color:var(--lib-ink)}
html body .course-library-sheet.ui-library .course-library-sheet-handle{display:none}
html body .course-library-sheet.ui-library .course-library-tree-item{font-size:13px!important;min-height:48px!important;padding:8px!important;text-align:left}
html body .course-library-sheet.ui-library .course-library-status{font-size:13px;color:var(--lib-muted)}
