.research-dialog, .research-page { --research-surface: #fff; --research-ink: #11273d; --research-muted: #475569; --research-border: #cbd5e1; --research-action: #0c6277; color: var(--research-ink); }
.research-dialog { width: min(620px, calc(100% - 24px)); max-height: calc(100dvh - 32px); padding: 24px; margin: auto; border: 1px solid var(--research-border); border-radius: 16px; background: var(--research-surface); overflow-y: auto; font-family: inherit; }
.research-dialog::backdrop { background: rgba(0, 24, 34, .75); }
.research-dialog:not([open]) { display: none; }
.research-dialog [hidden] { display: none !important; }
.research-dialog h2, .research-page h1 { color: var(--research-ink); font-size: 26px; line-height: 1.4; margin: 0; }
.research-dialog h3, .research-page h2 { color: var(--research-ink); font-size: 20px; line-height: 1.5; margin: 0 0 14px; }
.research-dialog-header, .research-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.research-section + .research-section { border-top: 1px solid var(--research-border); padding-top: 22px; margin-top: 22px; }
.research-dialog p, .research-page p { color: var(--research-muted); line-height: 1.7; overflow-wrap: anywhere; }
.research-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.research-button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px; padding: 10px 16px; border: 1px solid var(--research-action); border-radius: 8px; color: #fff; background: var(--research-action); font: inherit; font-weight: 700; line-height: 1.4; text-decoration: none; cursor: pointer; }
.research-button:hover { background: #074758; border-color: #074758; color: #fff; }
.research-button.secondary { color: var(--research-action); background: #fff; }
.research-button.secondary:hover { background: #edf7f9; }
.research-button.danger { background: #a31919; border-color: #a31919; color: #fff; }
.research-button:disabled { opacity: .55; cursor: wait; }
.research-close { min-width: 44px; min-height: 44px; padding: 6px; color: var(--research-ink); border: 1px solid var(--research-border); border-radius: 8px; background: #fff; font: inherit; cursor: pointer; }
.research-dialog :is(button, a, select):focus-visible, .research-page :is(button, a, input, textarea, select, summary):focus-visible { outline: 3px solid #0c6277; outline-offset: 3px; }
.research-field { display: block; margin-bottom: 18px; }
.research-field > span { display: block; font-weight: 700; margin-bottom: 8px; }
.research-dialog select, .research-page input, .research-page textarea, .research-page select { width: 100%; min-height: 44px; border: 1px solid #64748b; border-radius: 8px; background: #fff; color: var(--research-ink); padding: 10px 12px; font: inherit; font-size: 16px; }
.research-citation { white-space: pre-wrap; overflow-wrap: anywhere; padding: 18px; border: 1px solid var(--research-border); background: #f8fafc; border-radius: 8px; line-height: 1.9; margin-bottom: 14px; user-select: text; }
.research-status { min-height: 24px; margin: 12px 0; }
.research-warning { padding: 12px; border-inline-start: 4px solid #b77913; background: #fff7e6; color: #713f12 !important; }
.research-page { background: #fff; max-width: 1160px; margin: 36px auto; padding: 28px; border-radius: 16px; }
.research-page h1, .research-page h2, .research-page h3, .research-page a { overflow-wrap: anywhere; }
.research-page a:not(.research-button) { color: var(--research-action); text-decoration: underline; text-underline-offset: 3px; }
.research-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 320px); gap: 28px; align-items: start; }
.research-card { border: 1px solid var(--research-border); border-radius: 12px; padding: 20px; margin-bottom: 16px; }
.research-card h2 { margin-bottom: 8px; }
.research-card p { white-space: pre-line; }
.research-card form { margin-top: 12px; }
.research-empty { padding: 28px 0; }
.research-alert { padding: 14px; border: 1px solid #a7c2cc; border-radius: 8px; margin-bottom: 20px; color: var(--research-ink); background: #eef8fa; }
.research-book-row { display: flex; align-items: start; gap: 18px; padding: 20px 0; border-bottom: 1px solid var(--research-border); }
.research-book-row img { width: 80px; height: 110px; object-fit: cover; border-radius: 6px; }
.research-book-row > div { min-width: 0; flex: 1; }
.research-book-row h2 { margin: 0 0 8px; font-size: 20px; }
.research-page details { margin: 22px 0; }
.research-page summary { cursor: pointer; padding: 12px 0; font-weight: 700; }
.research-profile-link { display: inline-flex; color: #fff; gap: 8px; margin-bottom: 22px; padding: 12px 16px; border: 1px solid rgba(255,255,255,.4); border-radius: 8px; }
.research-profile-link:hover { color: #e6a530; }
.research-profile-link:focus-visible { outline: 3px solid #e6a530; outline-offset: 3px; }
.reading-form { max-width: 680px; }
.reading-check { display: flex; align-items: start; gap: 12px; margin: 16px 0; cursor: pointer; line-height: 1.7; }
.research-page .reading-check input[type="checkbox"] { display: inline-block; visibility: visible; opacity: 1; position: static; appearance: auto; width: 24px; min-height: 24px; height: 24px; flex-shrink: 0; margin-top: 2px; accent-color: var(--research-action); }
.reading-criteria { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.reading-criteria span { padding: 8px 12px; background: #f1f5f9; border-radius: 6px; overflow-wrap: anywhere; max-width: 100%; }
.reading-status { font-weight: 700; color: var(--research-ink); }
.reading-goal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.reading-goal-total { font-size: 40px; font-weight: 800; color: var(--research-ink) !important; margin: 12px 0; }
.reading-goal-grid progress { width: 100%; height: 16px; accent-color: var(--research-action); }
.reading-catalog-actions { margin: 12px 0 20px; padding: 0; background: transparent; }
.reading-table-wrap { overflow-x: auto; }
.reading-table { width: 100%; min-width: 640px; border-collapse: collapse; }
.reading-table th, .reading-table td { padding: 16px; text-align: start; border-bottom: 1px solid var(--research-border); vertical-align: top; }
.reading-table th { background: #f1f5f9; }
.reading-details dt { font-weight: 700; margin-top: 12px; }
.reading-details dd { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; }
@media (max-width: 640px) { .reading-goal-grid { grid-template-columns: minmax(0, 1fr); } .reading-catalog-actions { margin: 12px 0 20px; padding: 0; } }
@media (max-width: 640px) { .research-dialog { padding: 18px; } .research-page { margin: 16px 12px; padding: 18px; } .research-layout { grid-template-columns: minmax(0, 1fr); } .research-layout > aside { grid-row: 1; } .research-heading { flex-direction: column; } .research-actions .research-button { flex-grow: 1; } }

.research-profile-link { max-width: 100%; white-space: normal; }

/* Book suggestions use the library's dark navy canvas in both locales. */
.research-page-dark { --research-surface: #102b40; --research-ink: #f1f5f9; --research-muted: #bdcbd8; --research-border: #496174; --research-action: #e6a530; background: #081e30; color-scheme: dark; }
.research-page-dark .research-field { color: var(--research-ink); }
.research-page-dark .research-card { background: var(--research-surface); }
.research-page-dark :is(input, textarea, select) { background: #081e30; border-color: #71879a; }
.research-page-dark .research-button { background: var(--research-action); border-color: var(--research-action); color: #081e30; }
.research-page-dark .research-button:hover { background: #f3bc57; border-color: #f3bc57; }
.research-page-dark .research-button.secondary { background: transparent; color: var(--research-action); }
.research-page-dark .research-button.secondary:hover { background: #203b50; }
.research-page-dark .research-alert { background: #17394c; border-color: #71879a; color: var(--research-ink); }
.research-page-dark :is(button, a, input, textarea, select):focus-visible { outline-color: #f3bc57; }
.research-page-dark .pagination { flex-wrap: wrap; gap: 4px; }
.research-page-dark .page-link { background: var(--research-surface); border-color: var(--research-border); color: var(--research-action); }
.research-page-dark .active > .page-link { background: var(--research-action); color: #081e30; }
.research-page-dark .disabled > .page-link { background: #081e30; color: var(--research-muted); }

.suggestion-timeline { list-style: none; padding-inline-start: 16px; border-inline-start: 2px solid var(--research-border); }
.suggestion-timeline li { margin-block: 0 20px; }
.suggestion-timeline time { display: block; color: var(--research-muted); font-size: 14px; }
#suggestion-matches { padding: 16px; border: 1px solid var(--research-border); border-radius: 8px; margin-bottom: 20px; }
#suggestion-matches h3 { color: var(--research-ink); font-size: 18px; }
#suggestion-matches ul { padding-inline-start: 20px; }
#suggestion-matches li + li { margin-top: 12px; }
#suggestion-matches small { display: block; color: var(--research-muted); }
