/* ResearchHUB — highlighted mentor comments and the Word export preview. */

/* ---------- Highlighted comments ---------- */
::highlight(rh-comment) { background-color: #ffe58f; color: inherit; }
::highlight(rh-comment-active) { background-color: #ffbf47; color: inherit; }
.rc-over { cursor: pointer; }
.rc-has-comments { scroll-margin-top: 90px; }

.rc-bubble { position: absolute; z-index: 2000; background: #fff; color: #1d2b3a; border: 1px solid #dbe2ec; border-left: 4px solid #f2b705;
  border-radius: 12px; box-shadow: 0 14px 34px rgba(15, 42, 64, .18); padding: 14px 16px; font-size: 14px; line-height: 1.5; }
.rc-bubble h4 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: #8a6a00; }
.rc-bubble .rc-q { margin: 0 0 10px; padding: 6px 10px; background: #fff7d6; border-radius: 8px; font-style: italic; max-height: 110px; overflow: auto; }
.rc-bubble .rc-c { margin: 0 0 10px; white-space: pre-wrap; }
.rc-bubble textarea { width: 100%; min-height: 90px; box-sizing: border-box; margin-top: 4px; }
.rc-bubble .flex { gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.rc-bubble button { padding: 6px 12px; font-size: 13px; }
.rc-bubble .rc-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: #5b6b7c; }

.rc-fab { position: absolute; z-index: 1900; padding: 6px 12px; border-radius: 999px; font-size: 13px; box-shadow: 0 6px 18px rgba(15, 42, 64, .22); }

.rc-list:empty { display: none; }
.rc-list { margin: 4px 0 16px; padding: 12px 14px; border: 1px solid #f0dd9a; background: #fffbea; border-radius: 12px; }
.rc-list h3 { margin: 0 0 4px; font-size: 16px; }
.rc-item { display: block; width: 100%; text-align: left; margin: 8px 0 0; padding: 10px 12px; background: #fff; border: 1px solid #eadfb8;
  border-radius: 10px; color: inherit; font: inherit; }
button.rc-item { cursor: pointer; }
button.rc-item:hover, button.rc-item:focus-visible { border-color: #f2b705; box-shadow: 0 0 0 2px #ffe58f; }
.rc-item .rc-quote { display: block; font-style: italic; color: #6b5300; margin-bottom: 4px; background: #fff3c4; padding: 2px 6px; border-radius: 6px; }
.rc-item .rc-text { display: block; white-space: pre-wrap; }
.rc-item .rc-tools { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.rc-item .rc-tools button { padding: 4px 10px; font-size: 12px; }
.rc-item .rc-lost { display: block; margin-top: 4px; font-size: 12px; color: #9a4a00; }
.rc-sent { margin-top: 10px; }
.rc-sent > p { margin: 6px 0 0; }

html[data-platform-theme="dark"] .rc-bubble { background: #1b2431; color: #e8eef8; border-color: #34425a; border-left-color: #f2b705; }
html[data-platform-theme="dark"] .rc-bubble .rc-q { background: #3a3315; }
html[data-platform-theme="dark"] .rc-bubble h4 { color: #ffd76a; }
html[data-platform-theme="dark"] .rc-list { background: #2a2714; border-color: #5b4f1e; }
html[data-platform-theme="dark"] .rc-item { background: #1b2431; border-color: #4a4422; }
html[data-platform-theme="dark"] .rc-item .rc-quote { background: #3a3315; color: #ffe39a; }
html[data-platform-theme="dark"] ::highlight(rh-comment) { background-color: #7a6210; color: #fff; }
html[data-platform-theme="dark"] ::highlight(rh-comment-active) { background-color: #b07a00; color: #fff; }

/* ---------- Dark mode: calm writing areas ----------
   Text pasted from Word or the web often carries inline white backgrounds, black text and bright highlighter
   colours. In dark mode these showed as glaring white bars and neon yellow inside the writing box. These rules
   only change how the text is displayed; the saved text and the Word export keep their original formatting. */
html[data-platform-theme="dark"] :is(.editor, #content, #reviewWriting, .final-preview, .doc-sheet, #assembled) {
  background: #16233a !important; color: #e6edf7 !important; border-color: #3a4c68 !important;
  line-height: 1.7; caret-color: #fff;
}
html[data-platform-theme="dark"] :is(.editor, #content, #reviewWriting, .final-preview, .doc-sheet, #assembled) :is([style*="background"], [bgcolor], p, span, div, td, th, li, font, h1, h2, h3, h4, h5, h6):not(.cite):not(mark) {
  background-color: transparent !important; background-image: none !important;
}
html[data-platform-theme="dark"] :is(.editor, #content, #reviewWriting, .final-preview, .doc-sheet, #assembled) :is([style*="color"], font[color]):not(.cite):not(a) {
  color: inherit !important;
}
html[data-platform-theme="dark"] :is(.editor, #content, #reviewWriting, .final-preview, .doc-sheet, #assembled) :is(mark, [style*="background-color: yellow"], [style*="background:yellow"], [style*="background: yellow"], [style*="#ffff00"], [style*="#ff0"], [style*="rgb(255, 255, 0)"]):not(.cite):not(.rc-none):not(.rc-none2) {
  background-color: rgba(214, 170, 40, .28) !important; color: #fff3c9 !important; border-radius: 3px;
}
html[data-platform-theme="dark"] :is(.editor, #content, #reviewWriting, .final-preview) :is(td, th) { border-color: #3a4c68 !important; }
html[data-platform-theme="dark"] :is(.editor, #content, #reviewWriting, .final-preview) a:not(.cite) { color: #8ec8ff !important; }
html[data-platform-theme="dark"] :is(.editor, #content, #reviewWriting, .final-preview) img { filter: brightness(.9); }
html[data-platform-theme="dark"] :is(.editor, #content, #reviewWriting)::selection,
html[data-platform-theme="dark"] :is(.editor, #content, #reviewWriting) *::selection { background: #2f5d94; color: #fff; }
/* Softer comment highlights in dark mode. */
html[data-platform-theme="dark"] ::highlight(rh-comment) { background-color: rgba(214, 170, 40, .32); color: #fff3c9; }
html[data-platform-theme="dark"] ::highlight(rh-comment-active) { background-color: rgba(240, 180, 40, .55); color: #fff; }
/* Light boxes around the editor. */
html[data-platform-theme="dark"] .ref-results { background: #142036 !important; color: #dbe5f3 !important; border-color: #3a4c68 !important; }
html[data-platform-theme="dark"] #app .notice:not(.ok) { background: #2a2a1e !important; color: #f1e3bd !important; border-color: #5a5030 !important; }
