/* Personal annotations: loaded only on lesson pages. Independent of the compiled site sheet. */
.notes-ui, .notes-key { font-family: var(--ui); font-size: 15px; line-height: 1.5; }
.notes-ui { --notes-bg: #fffdf9; --notes-ink: #151515; --notes-edge: #575757; color: var(--notes-ink); }
[data-theme="dark"] .notes-ui { --notes-bg: #101310; --notes-ink: #fafbf8; --notes-edge: #b1b7b1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .notes-ui { --notes-bg: #101310; --notes-ink: #fafbf8; --notes-edge: #b1b7b1; }
}
.notes-ui [hidden], .notes-ui[hidden] { display: none !important; }
.notes-ui button { font: 600 15px/1.3 var(--ui); color: var(--notes-ink); background: var(--notes-bg); border: 1px solid var(--notes-edge); border-radius: 6px; min-height: 44px; padding: 8px 12px; cursor: pointer; white-space: nowrap; flex: none; box-shadow: none; }
.notes-ui button:hover { text-decoration: underline; text-underline-offset: 4px; }
.notes-ui button:disabled { cursor: default; border-style: dashed; }
.notes-ui :focus-visible, .notes-key:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }
.top-tools .notes-key { width: 44px; min-width: 44px; padding: 0; color: var(--ink); border: 1px solid currentColor; background: transparent; border-radius: 6px; }
.notes-row { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; max-width: 100%; min-width: 0; overflow-x: auto; padding: 4px; scrollbar-width: thin; }
.notes-row:focus-within { scroll-padding-inline: 8px; }
.notes-selection, .notes-palette { position: fixed; z-index: 150; width: max-content; max-width: calc(100vw - 16px); box-sizing: border-box; padding: 6px; border: 1px solid var(--notes-edge); border-radius: 8px; background: var(--notes-bg); box-shadow: 0 4px 18px #0002; }
.notes-selection { gap: 4px; }
.notes-selection button { border-color: transparent; }
.notes-explain:empty { display: none; }
.notes-explain { display: flex; flex: none; }
.notes-palette button, .notes-colours button { width: 44px; min-width: 44px; padding: 0; color: #151515; border: 1px solid #575757; text-decoration: underline; text-underline-offset: 4px; }
.notes-ui [data-colour="yellow"] { background: #fff1b8; }
.notes-ui [data-colour="green"] { background: #d8f1dc; }
.notes-ui [data-colour="blue"] { background: #dcecff; }
.notes-ui [data-colour="pink"] { background: #f9dfeb; }
.notes-ui [data-colour="orange"] { background: #ffe3c7; }
.notes-palette button[aria-pressed="true"], .notes-colours button[aria-pressed="true"] { outline: 2px solid var(--notes-ink); outline-offset: 2px; }
.notes-dialog { box-sizing: border-box; width: min(480px, calc(100vw - 24px)); max-width: calc(100vw - 24px); max-height: calc(100dvh - 32px); margin: 16px 16px 16px auto; padding: 22px; border: 1px solid var(--notes-edge); border-radius: 12px; background: var(--notes-bg); overflow: auto; box-shadow: 0 12px 48px #0003; }
.notes-dialog::backdrop { background: #0004; }
.notes-heading { padding: 0; justify-content: space-between; overflow: visible; }
.notes-heading h2 { margin: 0; border: 0; padding: 0; font: 700 28px/1.2 var(--ui); color: inherit; }
.notes-dialog h3 { font: 600 18px/1.4 var(--ui); color: inherit; }
.notes-intro, .notes-hint, .notes-empty { font: 400 18px/1.6 var(--ui); margin: 16px 0; color: inherit; }
.notes-dialog .notes-row button[aria-pressed="true"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 5px; }
.notes-item { padding: 18px 0; border-bottom: 1px solid var(--notes-edge); }
.notes-item .notes-title { margin: 0 0 12px; }
.notes-quote { margin: 0 0 14px; border: 0; border-left: 3px solid #575757; border-radius: 4px; padding: 12px 14px; font: 400 18px/1.6 var(--ui); color: #151515; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; white-space: pre-wrap; }
.notes-body { font: 400 18px/1.6 var(--ui); color: inherit; white-space: pre-wrap; overflow-wrap: anywhere; margin: 12px 0; }
.notes-input { box-sizing: border-box; display: block; width: 100%; font: 400 18px/1.6 var(--ui); color: var(--notes-ink); background: var(--notes-bg); border: 1px solid var(--notes-edge); border-radius: 6px; padding: 10px; margin: 8px 0 12px; resize: vertical; }
.notes-exports { margin-top: 18px; }
.notes-status { position: fixed; bottom: 16px; left: 16px; z-index: 151; max-width: min(420px, calc(100vw - 64px)); padding: 10px 14px; border: 1px solid var(--notes-edge); background: var(--notes-bg); border-radius: 6px; }
.notes-status:empty, .notes-dialog-status:empty { display: none; }
.notes-dialog-status { font: 400 15px/1.5 var(--ui); color: inherit; }
::highlight(notes-yellow) { background-color: #fff1b8; color: #151515; text-decoration: underline #151515 1px; }
::highlight(notes-green) { background-color: #d8f1dc; color: #151515; text-decoration: underline #151515 1px; }
::highlight(notes-blue) { background-color: #dcecff; color: #151515; text-decoration: underline #151515 1px; }
::highlight(notes-pink) { background-color: #f9dfeb; color: #151515; text-decoration: underline #151515 1px; }
::highlight(notes-orange) { background-color: #ffe3c7; color: #151515; text-decoration: underline #151515 1px; }
@media (max-width: 480px) {
  .notes-dialog { margin: 12px auto; padding: 16px; }
  .notes-dialog .notes-row { gap: 4px; }
  .notes-dialog .notes-row button { padding-inline: 10px; }
}
@media (prefers-reduced-motion: reduce) { .notes-ui, .notes-ui * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media (forced-colors: active) {
  .notes-ui button, .notes-quote, .notes-input { border: 1px solid ButtonText; }
  .notes-quote { color: CanvasText; background: Canvas; text-decoration: underline; }
  ::highlight(notes-yellow), ::highlight(notes-green), ::highlight(notes-blue), ::highlight(notes-pink), ::highlight(notes-orange) { color: HighlightText; background-color: Highlight; text-decoration: underline; }
}

/* A soft edge signals the horizontal action row on small screens without wrapping it. */
@media (max-width: 390px) {
  .notes-actions::after { content: ""; position: sticky; right: -4px; align-self: stretch; width: 6px; min-width: 6px; margin-left: -6px; background: var(--notes-bg); box-shadow: -4px 0 6px 2px var(--notes-bg); pointer-events: none; }
}
