/* margin-notes.css — shared styling for the anchored-note system used by the
 * Academy and Library readers (assets/margin-notes.js + margin-notes-ui.js).
 *
 * Both readers are dark surfaces, so the palette is fixed rather than themed —
 * the marks must sit on lesson prose with enough contrast to be findable but not
 * so much that they fight the text they are meant to make readable.
 *
 * "Carries a note" is signalled by a ✎ affordance, never by colour alone: the
 * five colours are user categories, and colour-only meaning is lost to
 * colour-blind readers and to grayscale.
 */

/* ---------- the mark ------------------------------------------------------ */
mark.mn {
  background: transparent;
  color: inherit;
  border-radius: 2px;
  padding: .05em 0;
  cursor: pointer;
  position: relative;
  transition: filter .13s ease;
}
mark.mn:hover,
mark.mn.is-open { filter: brightness(1.25); }
mark.mn:focus-visible { outline: 2px solid #d4b483; outline-offset: 2px; }

mark.mn--yellow { background: linear-gradient(180deg, rgba(232,210,164,.16), rgba(232,210,164,.30)); box-shadow: inset 0 -2px 0 rgba(232,210,164,.80); }
mark.mn--green  { background: linear-gradient(180deg, rgba(63,183,159,.14),  rgba(63,183,159,.27));  box-shadow: inset 0 -2px 0 rgba(63,183,159,.75); }
mark.mn--blue   { background: linear-gradient(180deg, rgba(105,194,255,.13), rgba(105,194,255,.26)); box-shadow: inset 0 -2px 0 rgba(105,194,255,.75); }
mark.mn--pink   { background: linear-gradient(180deg, rgba(239,107,102,.13), rgba(239,107,102,.25)); box-shadow: inset 0 -2px 0 rgba(239,107,102,.75); }
mark.mn--orange { background: linear-gradient(180deg, rgba(224,160,90,.14),  rgba(224,160,90,.27));  box-shadow: inset 0 -2px 0 rgba(224,160,90,.75); }

/* A passage can be split across several <mark> elements (it may cross block
 * boundaries), so the ✎ must appear once — on the LAST piece only. */
mark.mn[data-mn-note]:last-of-type::after,
mark.mn[data-mn-note]:only-of-type::after {
  content: "\270E";
  font-size: .62em;
  line-height: 1;
  vertical-align: super;
  margin-left: 2px;
  color: #d4b483;
  opacity: .95;
}
mark.mn[data-mn-shared]::before {
  content: "";
  display: inline-block;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #69c2ff;
  vertical-align: super;
  margin-right: 2px;
}

/* ---------- the bubble ---------------------------------------------------- */
.mnb {
  position: absolute;
  z-index: 1200;
  width: min(300px, calc(100vw - 32px));
  background: #1c1916;
  border: 1px solid rgba(212,180,131,.34);
  border-radius: 11px;
  box-shadow: 0 16px 40px -14px rgba(0,0,0,.75);
  padding: 12px 13px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .14s ease, transform .14s ease;
  color: #ece7dc;
  font-size: 14px;
  line-height: 1.5;
}
.mnb.is-on { opacity: 1; transform: translateY(0); }
.mnb::before {
  content: "";
  position: absolute;
  width: 9px; height: 9px;
  background: #1c1916;
  border-left: 1px solid rgba(212,180,131,.34);
  border-top: 1px solid rgba(212,180,131,.34);
  transform: rotate(45deg);
  left: calc(var(--mnb-ax, 50%) - 4px);
  top: -5px;
}
.mnb.mnb--below::before { top: auto; bottom: -5px; transform: rotate(225deg); }

.mnb__h {
  display: flex; align-items: center; gap: 7px;
  margin-bottom: 8px;
  font-family: var(--mono, 'JetBrains Mono', ui-monospace, monospace);
  font-size: 9.5px; letter-spacing: .11em; text-transform: uppercase;
  color: #8f8779;
}
.mnb__sw { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.mnb__pill {
  margin-left: auto;
  font-size: 8.5px; letter-spacing: .1em;
  border: 1px solid rgba(105,194,255,.45);
  color: #69c2ff;
  border-radius: 20px;
  padding: 2px 7px;
}
.mnb__b { margin: 0 0 10px; white-space: pre-wrap; color: #ece7dc; }
.mnb__empty { margin: 0 0 10px; color: #8f8779; font-style: italic; font-size: 12.5px; }

.mnb__ta {
  width: 100%;
  min-height: 84px;
  resize: vertical;
  background: rgba(0,0,0,.28);
  border: 1px solid rgba(236,231,220,.16);
  border-radius: 8px;
  color: #ece7dc;
  font: inherit;
  padding: 8px 9px;
  margin-bottom: 9px;
}
.mnb__ta:focus { outline: none; border-color: rgba(212,180,131,.6); }

.mnb__share {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: #b8b0a0;
  margin-bottom: 10px; cursor: pointer;
}
.mnb__share input { width: auto; flex: none; margin: 0; }

.mnb__f {
  display: flex; align-items: center; gap: 6px;
  border-top: 1px solid rgba(236,231,220,.12);
  padding-top: 9px;
}
.mnb__btn {
  font: inherit; font-size: 11.5px;
  padding: 4px 9px; border-radius: 6px;
  background: rgba(236,231,220,.06);
  border: 1px solid rgba(236,231,220,.13);
  color: #b8b0a0; cursor: pointer;
}
.mnb__btn:hover { background: rgba(236,231,220,.12); color: #ece7dc; }
.mnb__btn--go { border-color: rgba(212,180,131,.45); color: #e0c79a; }
.mnb__btn--del { margin-left: auto; color: #ef6b66; border-color: rgba(239,107,102,.28); }
.mnb__btn--del:hover { background: rgba(239,107,102,.14); }
/* Armed state of the two-step delete — visibly different, not just re-labelled. */
.mnb__btn--del.is-armed {
  background: rgba(239,107,102,.20);
  border-color: rgba(239,107,102,.75);
  color: #ffd9d7;
  font-weight: 600;
}

.mnb__cols { display: flex; gap: 4px; margin-left: 4px; }
.mnb__col {
  width: 15px; height: 15px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,.35);
  cursor: pointer; padding: 0;
  opacity: .55;
}
.mnb__col:hover { opacity: 1; transform: scale(1.12); }
.mnb__col.is-on { opacity: 1; box-shadow: 0 0 0 2px rgba(236,231,220,.55); }

/* ---------- lesson-list pips --------------------------------------------- */
/* "Where did I leave something?" answered without opening a lesson. */
.mn-pips {
  display: inline-flex; align-items: center; gap: 2px;
  margin-left: auto; padding-left: 6px; flex: none;
}
.mn-pip { width: 5px; height: 5px; border-radius: 50%; flex: none; }
.mn-pip--yellow { background: #e8d2a4; }
.mn-pip--green  { background: #3fb79f; }
.mn-pip--blue   { background: #69c2ff; }
.mn-pip--pink   { background: #ef6b66; }
.mn-pip--orange { background: #e0a05a; }
.mn-quill { font-size: 9.5px; line-height: 1; color: #d4b483; }

/* ---------- orphaned annotations ------------------------------------------ */
/* The passage this note was on no longer resolves. We say so instead of hiding
 * the note or painting it onto whatever text happens to match now. */
.mn-orphan {
  border-left: 2px solid rgba(224,176,98,.7);
  padding-left: 10px;
  margin: 8px 0;
}
.mn-orphan__why {
  font-size: 11.5px; color: #e0b062; margin: 0 0 4px;
}
.mn-orphan__body { margin: 0; color: #b8b0a0; font-size: 13px; white-space: pre-wrap; }

@media (prefers-reduced-motion: reduce) {
  .mnb { transition: none; }
  mark.mn { transition: none; }
  .mnb__col:hover { transform: none; }
}

/* ===== GEX THEMES (GENERATED - do not edit, run scripts/gen-themes.py) ===== */
/* -- theme dark -- */
html[data-theme="dark"] .mnb { background: #121316; }
html[data-theme="dark"] .mnb::before { background: #121316; }
html[data-theme="dark"] .mnb__ta { background: rgba(4, 4, 4, .28); }
html[data-theme="dark"] .mnb__col { border-color: rgba(4, 4, 4, .35); }
/* -- theme white -- */
html[data-theme="white"] mark.mn:focus-visible { outline-color: #a5803c; }
html[data-theme="white"] mark.mn--yellow { background: linear-gradient(180deg, rgba(195, 160, 95, .16), rgba(195, 160, 95, .30)); }
html[data-theme="white"] mark.mn--green { background: linear-gradient(180deg, rgba(29, 138, 116, .14),  rgba(29, 138, 116, .27)); }
html[data-theme="white"] mark.mn--blue { background: linear-gradient(180deg, rgba(31, 120, 192, .13), rgba(31, 120, 192, .26)); }
html[data-theme="white"] mark.mn--pink { background: linear-gradient(180deg, rgba(194, 58, 52, .13), rgba(194, 58, 52, .25)); }
html[data-theme="white"] mark.mn[data-mn-note]:last-of-type::after, html[data-theme="white"] mark.mn[data-mn-note]:only-of-type::after { color: #a5803c; }
html[data-theme="white"] mark.mn[data-mn-shared]::before { background: #1f78c0; }
html[data-theme="white"] .mnb { background: #ece8e0; }
html[data-theme="white"] .mnb { color: #3a352b; }
html[data-theme="white"] .mnb { border-color: rgba(165, 128, 60, .34); }
html[data-theme="white"] .mnb::before { background: #ece8e0; }
html[data-theme="white"] .mnb::before { border-left-color: rgba(165, 128, 60, .34); }
html[data-theme="white"] .mnb::before { border-top-color: rgba(165, 128, 60, .34); }
html[data-theme="white"] .mnb__pill { color: #1f78c0; }
html[data-theme="white"] .mnb__pill { border-color: rgba(31, 120, 192, .45); }
html[data-theme="white"] .mnb__b { color: #3a352b; }
html[data-theme="white"] .mnb__ta { background: rgba(244, 244, 244, .28); }
html[data-theme="white"] .mnb__ta { color: #3a352b; }
html[data-theme="white"] .mnb__ta { border-color: rgba(58, 53, 43, .16); }
html[data-theme="white"] .mnb__ta:focus { border-color: rgba(165, 128, 60, .6); }
html[data-theme="white"] .mnb__share { color: #746c5c; }
html[data-theme="white"] .mnb__f { border-top-color: rgba(58, 53, 43, .12); }
html[data-theme="white"] .mnb__btn { background: rgba(58, 53, 43, .06); }
html[data-theme="white"] .mnb__btn { color: #746c5c; }
html[data-theme="white"] .mnb__btn { border-color: rgba(58, 53, 43, .13); }
html[data-theme="white"] .mnb__btn:hover { background: rgba(58, 53, 43, .12); }
html[data-theme="white"] .mnb__btn:hover { color: #3a352b; }
html[data-theme="white"] .mnb__btn--go { border-color: rgba(165, 128, 60, .45); }
html[data-theme="white"] .mnb__btn--go { color: #b08a45; }
html[data-theme="white"] .mnb__btn--del { color: #c23a34; }
html[data-theme="white"] .mnb__btn--del { border-color: rgba(194, 58, 52, .28); }
html[data-theme="white"] .mnb__btn--del:hover { background: rgba(194, 58, 52, .14); }
html[data-theme="white"] .mnb__btn--del.is-armed { background: rgba(194, 58, 52, .20); }
html[data-theme="white"] .mnb__btn--del.is-armed { border-color: rgba(194, 58, 52, .75); }
html[data-theme="white"] .mnb__btn--del.is-armed { color: #371c1b; }
html[data-theme="white"] .mnb__col { border-color: rgba(244, 244, 244, .35); }
html[data-theme="white"] .mn-pip--yellow { background: #c3a05f; }
html[data-theme="white"] .mn-pip--green { background: #1d8a74; }
html[data-theme="white"] .mn-pip--blue { background: #1f78c0; }
html[data-theme="white"] .mn-pip--pink { background: #c23a34; }
html[data-theme="white"] .mn-quill { color: #a5803c; }
html[data-theme="white"] .mn-orphan__why { color: #372c1b; }
html[data-theme="white"] .mn-orphan__body { color: #746c5c; }
/* ===== END GEX THEMES ===== */















