/* ===== V1.3: modular question annotations + notes drawer ===== */
:root {
  --annotation-highlight: #ffe56a;
  --annotation-note: #c94b55;
  --annotation-note-text: #ffffff;
  --notes-drawer-w: 340px;
}
.workspace-row { min-height:0; display:flex; overflow:hidden; position:relative; }
.workspace-row > .workspace { flex:1 1 auto; min-width:0; }
.notes-toggle { position:relative; width:40px; height:38px; border:1px solid #d0d0d0; background:#fff; border-radius:4px; cursor:pointer; display:grid; place-items:center; font-size:20px; }
.notes-toggle:hover,.notes-toggle.is-open { background:#f2f7fb; border-color:var(--blue); }
.notes-toggle b { position:absolute; right:-5px; top:-6px; min-width:17px; height:17px; border-radius:999px; padding:0 4px; background:#111; color:#fff; font:700 10px/17px var(--font-ui); }
.selection-menu { position:fixed; z-index:100; display:flex; overflow:hidden; background:#111; color:#fff; border-radius:5px; box-shadow:0 8px 28px rgba(0,0,0,.28); }
.selection-menu button { border:0; background:transparent; color:#fff; min-width:92px; padding:9px 12px; cursor:pointer; }
.selection-menu button + button { border-left:1px solid rgba(255,255,255,.2); }
.selection-menu button:hover { background:#2d2d2d; }
.annotation-segment { border-radius:2px; padding:0 1px; }
.annotation-highlight { background:var(--annotation-highlight); color:inherit; }
.annotation-note { background:var(--annotation-note); color:var(--annotation-note-text); cursor:pointer; }
.annotation-note:hover { outline:2px solid rgba(198,61,77,.25); outline-offset:1px; }
.notes-drawer { width:var(--notes-drawer-w); flex:0 0 var(--notes-drawer-w); min-width:0; height:100%; border-left:1px solid #cfcfcf; background:#fff; display:flex; flex-direction:column; }
.notes-drawer-head { min-height:58px; border-bottom:1px solid #d6d6d6; padding:9px 10px 9px 14px; display:flex; align-items:center; justify-content:space-between; gap:10px; }
.notes-drawer-head > div { display:flex; flex-direction:column; }
.notes-drawer-head strong { font-size:15px; }
.notes-drawer-head span { font-size:11px; color:#777; }
.notes-close { width:34px; height:34px; border:0; background:transparent; cursor:pointer; font-size:26px; border-radius:4px; }
.notes-close:hover { background:#f1f1f1; }
.notes-drawer-scroll { min-height:0; flex:1; overflow:auto; padding:12px; }
.drawer-empty { padding:12px; background:#f7f7f7; color:#666; font-size:13px; line-height:1.45; border-radius:4px; }
.note-card { border:1px solid #d6d6d6; border-radius:5px; overflow:hidden; margin-bottom:12px; }
.note-card.is-active { border-color:var(--blue); box-shadow:0 0 0 2px rgba(65,142,200,.12); }
.note-anchor { width:100%; border:0; background:#f7f8fb; padding:8px 10px; text-align:left; cursor:pointer; display:flex; flex-direction:column; gap:2px; }
.note-anchor:hover { background:#eef1fb; }
.note-anchor strong { font-size:11px; color:#536bd6; }
.note-anchor span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; width:100%; font-size:13px; }
.note-editor { display:block; width:calc(100% - 16px); min-height:88px; margin:8px; resize:vertical; border:1px solid #bdbdbd; border-radius:3px; padding:8px; font:14px/1.45 var(--font-ui); outline:none; }
.note-editor:focus { border-color:var(--blue); box-shadow:0 0 0 2px rgba(65,142,200,.12); }
.annotation-delete { display:block; margin:0 8px 8px auto; border:0; background:transparent; font-size:12px; cursor:pointer; text-decoration:underline; }

@media (max-width: 980px) {
  .notes-drawer { width:300px; flex-basis:300px; }
}
@media (max-width: 768px) {
  .workspace-row { display:block; overflow:visible; }
  .notes-drawer { position:fixed; inset:0 0 0 auto; z-index:25; width:min(360px,92vw); height:100vh; box-shadow:-12px 0 34px rgba(0,0,0,.2); }
}
