/*
 * Open Library Publications — Elegant Light UI 2026-08-28 v1
 * Final visual override. Intentionally loaded last.
 * Concept: quiet editorial surface, restrained Tel-U red, light footer,
 * cleaner filters, strong typography and compact authentication pages.
 */

:root {
  --ole-red: #dc2626;
  --ole-red-hover: #b91c1c;
  --ole-red-soft: #fff5f5;
  --ole-red-line: #f3a2a8;
  --ole-ink: #0f172a;
  --ole-text: #334155;
  --ole-muted: #64748b;
  --ole-line: #e2e8f0;
  --ole-line-soft: #edf1f5;
  --ole-canvas: #f7f8fa;
  --ole-surface: #ffffff;
  --ole-footer: #fff8f8;
  --ole-shell: 1240px;
  --ole-radius: 16px;
  --ole-shadow: 0 10px 30px rgba(15, 23, 42, .055);
}

/* ===== Global frame ===== */
html body {
  background: var(--ole-canvas) !important;
  color: var(--ole-text) !important;
  font-size: 15px !important;
  line-height: 1.65 !important;
}

html body .pkp_structure_page {
  background: var(--ole-canvas) !important;
}

html body .pkp_structure_content,
html body .openlib_site_shell,
html body .openlib_journal_shell {
  width: min(var(--ole-shell), calc(100% - 64px)) !important;
  max-width: var(--ole-shell) !important;
}

html body .pkp_structure_content {
  padding-top: 34px !important;
  padding-bottom: 52px !important;
}

html body .pkp_structure_main,
html body .pkp_structure_main > * {
  min-width: 0 !important;
}

html body .pkp_structure_main h1,
html body .pkp_structure_main h2,
html body .pkp_structure_main h3,
html body .pkp_structure_main h4 {
  color: var(--ole-ink) !important;
}

/* ===== Header: one quiet white bar ===== */
html body.openlib-site-page .openlib_site_header,
html body.openlib-site-index .openlib_site_header {
  border-top: 3px solid var(--ole-red) !important;
  border-bottom: 1px solid var(--ole-line) !important;
  background: rgba(255,255,255,.97) !important;
  box-shadow: none !important;
}

html body .openlib_site_header__utility {
  min-height: 32px !important;
  height: 32px !important;
  border-bottom: 1px solid var(--ole-line-soft) !important;
  background: #fbfcfd !important;
}

html body .openlib_site_header__utility_inner {
  height: 32px !important;
}

html body .openlib_site_header__main_inner {
  min-height: 68px !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

html body .openlib_site_brand__mark {
  width: 40px !important;
  height: 40px !important;
  border-radius: 12px !important;
  background: var(--ole-red) !important;
  box-shadow: 0 5px 14px rgba(220,38,38,.18) !important;
}

html body .openlib_site_brand__text strong {
  color: var(--ole-ink) !important;
  font-size: 17px !important;
}

html body .openlib_site_brand__text small {
  color: #7c8aa0 !important;
  font-size: 10px !important;
}

html body .openlib_color_mode_toggle {
  width: 31px !important;
  min-width: 31px !important;
  height: 31px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 9px !important;
  background: #fff !important;
  color: #334155 !important;
}

html body .openlib_color_mode_toggle:hover,
html body .openlib_color_mode_toggle:focus {
  border-color: var(--ole-red-line) !important;
  background: var(--ole-red-soft) !important;
  color: var(--ole-red) !important;
}

html body .openlib_site_header__account .pkp_navigation_user > li > a {
  color: #334155 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

/* ===== Homepage masthead: compact editorial panel ===== */
html body.openlib-site-index .openlib_portal_intro {
  position: relative !important;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: 28px !important;
  align-items: center !important;
  margin: 0 0 18px !important;
  padding: 26px 28px 26px 30px !important;
  overflow: hidden !important;
  border: 1px solid var(--ole-line) !important;
  border-radius: 18px !important;
  background: #fff !important;
  box-shadow: 0 6px 20px rgba(15,23,42,.035) !important;
}

html body.openlib-site-index .openlib_portal_intro:before {
  position: absolute !important;
  top: 0 !important;
  bottom: 0 !important;
  left: 0 !important;
  width: 5px !important;
  background: linear-gradient(180deg, #b91c1c 0%, #ef4444 100%) !important;
  content: "" !important;
}

html body.openlib-site-index .openlib_portal_intro__eyebrow,
html body.openlib-site-index .openlib_journal_tools__eyebrow,
html body.openlib-site-page .openlib_search_page__eyebrow,
html body.openlib-journal-page .openlib_section_heading__eyebrow {
  color: var(--ole-red) !important;
  font-size: 11px !important;
  letter-spacing: .09em !important;
}

html body.openlib-site-index .openlib_portal_intro h1 {
  max-width: 820px !important;
  font-size: clamp(29px, 3vw, 40px) !important;
  line-height: 1.12 !important;
  letter-spacing: -.038em !important;
}

html body.openlib-site-index .openlib_portal_intro p {
  max-width: 760px !important;
  margin-top: 10px !important;
  color: #475569 !important;
  font-size: 14px !important;
}

html body.openlib-site-index .openlib_portal_intro__badge {
  min-width: 112px !important;
  padding: 14px 18px !important;
  border: 1px solid #fecaca !important;
  border-radius: 14px !important;
  background: #fff8f8 !important;
  box-shadow: none !important;
}

html body.openlib-site-index .openlib_portal_intro__badge strong {
  color: var(--ole-ink) !important;
  font-size: 24px !important;
}

/* ===== Homepage search: clear red boundary, no heavy card ===== */
html body.openlib-site-index .openlib_search_panel {
  margin: 0 0 34px !important;
  padding: 11px 12px 10px !important;
  overflow: visible !important;
  border: 1.5px solid var(--ole-red-line) !important;
  border-radius: 16px !important;
  background: #fff !important;
  box-shadow: 0 8px 24px rgba(220,38,38,.045) !important;
}

html body.openlib-site-index .openlib_search_panel:before {
  display: none !important;
}

html body.openlib-site-index .openlib_discovery__form {
  display: grid !important;
  grid-template-columns: minmax(0,1fr) 230px 158px !important;
  gap: 10px !important;
  align-items: stretch !important;
}

html body.openlib-site-index .openlib_discovery__query,
html body.openlib-site-page .openlib_search_form__query,
html body.openlib-site-page .openlib_search_form__journal {
  min-width: 0 !important;
}

html body.openlib-site-index .openlib_discovery__form input[type="search"],
html body.openlib-site-index .openlib_discovery__form select,
html body.openlib-site-page .openlib_search_form__primary input,
html body.openlib-site-page .openlib_search_form__primary select {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 48px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 11px !important;
  background: #fff !important;
  color: var(--ole-ink) !important;
  font-size: 13.5px !important;
  box-shadow: none !important;
}

html body.openlib-site-index .openlib_discovery__query input,
html body.openlib-site-page .openlib_search_form__query input {
  padding-left: 43px !important;
}

html body.openlib-site-index .openlib_discovery__form input:focus,
html body.openlib-site-index .openlib_discovery__form select:focus,
html body.openlib-site-page .openlib_search_form input:focus,
html body.openlib-site-page .openlib_search_form select:focus {
  border-color: #ef7b82 !important;
  outline: 3px solid rgba(220,38,38,.07) !important;
}

html body.openlib-site-index .openlib_discovery__form button,
html body.openlib-site-page .openlib_search_form__submit {
  box-sizing: border-box !important;
  height: 48px !important;
  border: 1px solid var(--ole-red) !important;
  border-radius: 11px !important;
  background: var(--ole-red) !important;
  color: #fff !important;
  font-size: 12.5px !important;
  font-weight: 800 !important;
  box-shadow: none !important;
}

html body.openlib-site-index .openlib_discovery__form button:hover,
html body.openlib-site-page .openlib_search_form__submit:hover {
  background: var(--ole-red-hover) !important;
  border-color: var(--ole-red-hover) !important;
  transform: none !important;
}

html body.openlib-site-index .openlib_discovery__meta {
  margin: 9px 3px 0 !important;
  color: #718096 !important;
  font-size: 11px !important;
}

/* ===== Browse heading + filter: icon and field no longer collide ===== */
html body.openlib-site-index .openlib_journal_tools {
  display: flex !important;
  gap: 20px !important;
  align-items: flex-end !important;
  justify-content: space-between !important;
  margin-bottom: 18px !important;
  padding: 0 0 14px !important;
  border-bottom: 1px solid #d8dee8 !important;
}

html body.openlib-site-index .openlib_journal_tools h2 {
  font-size: 27px !important;
  letter-spacing: -.035em !important;
}

html body.openlib-site-index .openlib_journal_count {
  color: #64748b !important;
  font-size: 12px !important;
}

html body.openlib-site-index .openlib_journal_filter {
  position: relative !important;
  display: flex !important;
  width: 270px !important;
  min-width: 270px !important;
  height: 44px !important;
  align-items: center !important;
  padding: 0 !important;
  overflow: hidden !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 11px !important;
  background: #fff !important;
  box-shadow: none !important;
}

html body.openlib-site-index .openlib_journal_filter > .fa {
  position: static !important;
  display: inline-flex !important;
  width: 42px !important;
  height: 100% !important;
  flex: 0 0 42px !important;
  align-items: center !important;
  justify-content: center !important;
  border-right: 1px solid #edf1f5 !important;
  background: #fafbfc !important;
  color: #94a3b8 !important;
  transform: none !important;
}

html body.openlib-site-index .openlib_journal_filter input {
  box-sizing: border-box !important;
  width: calc(100% - 42px) !important;
  height: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 13px !important;
  border: 0 !important;
  border-radius: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  color: var(--ole-ink) !important;
  font-size: 12.5px !important;
  box-shadow: none !important;
}

html body.openlib-site-index .openlib_journal_filter:focus-within {
  border-color: #ef7b82 !important;
  box-shadow: 0 0 0 3px rgba(220,38,38,.07) !important;
}

/* ===== Publication cards: lighter and less button-heavy ===== */
html body.openlib-site-index .openlib_journal_grid,
html body.openlib-site-index .openlib_journal_grid.openlib_journal_grid--two {
  gap: 18px !important;
}

html body.openlib-site-index .openlib_journal_card {
  min-height: 286px !important;
  border: 1px solid #dde3eb !important;
  border-radius: 16px !important;
  background: #fff !important;
  box-shadow: 0 5px 18px rgba(15,23,42,.035) !important;
}

html body.openlib-site-index .openlib_journal_card:before {
  top: 16px !important;
  bottom: auto !important;
  left: 0 !important;
  width: 3px !important;
  height: 46px !important;
  border-radius: 0 4px 4px 0 !important;
  background: var(--ole-red) !important;
}

html body.openlib-site-index .openlib_journal_card:hover {
  border-color: #f0a1a6 !important;
  box-shadow: 0 12px 28px rgba(15,23,42,.07) !important;
  transform: translateY(-2px) !important;
}

html body.openlib-site-index .openlib_journal_main {
  grid-template-columns: 108px minmax(0,1fr) !important;
  gap: 18px !important;
  padding: 18px 18px 15px !important;
}

html body.openlib-site-index .openlib_journal_media,
html body.openlib-site-index .openlib_journal_media a,
html body.openlib-site-index .openlib_journal_media img {
  width: 108px !important;
  max-width: 108px !important;
  height: 152px !important;
  max-height: 152px !important;
  border-radius: 9px !important;
}

html body.openlib-site-index .openlib_journal_content h3 {
  margin-bottom: 6px !important;
  font-size: 15.5px !important;
  line-height: 1.4 !important;
}

html body.openlib-site-index .openlib_journal_content h3 a {
  color: var(--ole-ink) !important;
}

html body.openlib-site-index .openlib_journal_slug {
  border-color: #fecaca !important;
  background: #fff7f7 !important;
  color: #c81e2a !important;
}

html body.openlib-site-index .openlib_journal_content .description {
  color: #526176 !important;
  font-size: 12.5px !important;
  line-height: 1.7 !important;
}

html body.openlib-site-index .openlib_journal_footer {
  padding: 11px 16px !important;
  border-top: 1px solid #edf1f5 !important;
  background: #fbfcfd !important;
}

html body.openlib-site-index .openlib_journal_actions {
  gap: 8px !important;
}

html body.openlib-site-index .openlib_journal_actions li a {
  height: 38px !important;
  border-radius: 9px !important;
  font-size: 11.5px !important;
  box-shadow: none !important;
}

html body.openlib-site-index .openlib_journal_actions .home a {
  border: 1px solid #fecaca !important;
  background: #fff5f5 !important;
  color: #c81e2a !important;
}

html body.openlib-site-index .openlib_journal_actions .home a:hover {
  border-color: #fca5a5 !important;
  background: #fee2e2 !important;
  color: #991b1b !important;
}

html body.openlib-site-index .openlib_journal_actions .current a {
  border: 1px solid #d8dee8 !important;
  background: #fff !important;
  color: #334155 !important;
}

/* ===== Search page ===== */
html body.openlib-site-page .openlib_search_page {
  max-width: var(--ole-shell) !important;
}

html body.openlib-site-page .openlib_search_page__heading {
  max-width: 780px !important;
  margin-bottom: 19px !important;
}

html body.openlib-site-page .openlib_search_page__heading h1 {
  font-size: 34px !important;
  letter-spacing: -.04em !important;
}

html body.openlib-site-page .openlib_search_page__heading p {
  color: #526176 !important;
  font-size: 14px !important;
}

html body.openlib-site-page .openlib_search_form {
  margin-bottom: 32px !important;
  padding: 12px !important;
  border: 1.5px solid var(--ole-red-line) !important;
  border-radius: 16px !important;
  background: #fff !important;
  box-shadow: 0 7px 22px rgba(220,38,38,.035) !important;
}

html body.openlib-site-page .openlib_search_form__primary.has_journal_filter {
  display: grid !important;
  grid-template-columns: minmax(0,1fr) 230px 138px !important;
  gap: 10px !important;
  align-items: stretch !important;
}

html body.openlib-site-page .openlib_search_advanced {
  margin-top: 11px !important;
  padding: 9px 1px 1px !important;
  border-top: 1px solid #edf1f5 !important;
}

html body.openlib-site-page .openlib_search_advanced summary {
  display: inline-flex !important;
  gap: 8px !important;
  align-items: center !important;
  padding: 6px 8px !important;
  border-radius: 8px !important;
  color: #475569 !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

html body.openlib-site-page .openlib_search_advanced summary:hover {
  background: #f8fafc !important;
  color: var(--ole-red) !important;
}

html body.openlib-site-page .openlib_search_results_header {
  border-bottom: 1px solid #d8dee8 !important;
}

html body.openlib-site-page .openlib_search_results_count {
  border-color: #fecaca !important;
  background: #fff7f7 !important;
  color: #c81e2a !important;
}

html body.openlib-site-page .openlib_search_results .obj_article_summary {
  border: 1px solid #dde3eb !important;
  border-radius: 13px !important;
  background: #fff !important;
  box-shadow: 0 4px 14px rgba(15,23,42,.028) !important;
}

html body.openlib-site-page .openlib_search_results .obj_article_summary:before {
  width: 3px !important;
  background: #ef4444 !important;
}

/* ===== Login: compact single-panel, no clipped right side ===== */
html body.openlib-site-page.pkp_page_login .pkp_structure_content {
  display: flex !important;
  width: min(960px, calc(100% - 64px)) !important;
  align-items: center !important;
  justify-content: center !important;
  padding-top: 50px !important;
  padding-bottom: 64px !important;
}

html body.openlib-site-page .page_login {
  position: relative !important;
  display: block !important;
  box-sizing: border-box !important;
  width: min(620px, 100%) !important;
  max-width: 620px !important;
  min-width: 0 !important;
  margin: 0 auto !important;
  padding: 38px 42px 40px !important;
  overflow: visible !important;
  border: 1px solid #dce2ea !important;
  border-radius: 18px !important;
  background: #fff !important;
  box-shadow: 0 14px 40px rgba(15,23,42,.075) !important;
}

html body.openlib-site-page .page_login:before {
  position: absolute !important;
  top: 0 !important;
  right: 30px !important;
  left: 30px !important;
  display: block !important;
  min-height: 0 !important;
  height: 4px !important;
  padding: 0 !important;
  border-radius: 0 0 999px 999px !important;
  background: linear-gradient(90deg, #b91c1c 0%, #ef4444 100%) !important;
  color: transparent !important;
  content: "" !important;
}

html body.openlib-site-page .page_login > h1 {
  margin: 0 !important;
  padding: 0 !important;
  text-align: center !important;
  font-size: 31px !important;
}

html body.openlib-site-page .page_login > p {
  margin: 8px 0 0 !important;
  padding: 0 !important;
  color: #64748b !important;
  text-align: center !important;
  font-size: 12px !important;
}

html body.openlib-site-page .page_login .login {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 26px 0 0 !important;
  padding: 0 !important;
}

html body.openlib-site-page .page_login .fields,
html body.openlib-site-page .page_login .fields > div,
html body.openlib-site-page .page_login label,
html body.openlib-site-page .page_login .openlib_password_control {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

html body.openlib-site-page .page_login input[type="text"],
html body.openlib-site-page .page_login input[type="password"],
html body.openlib-site-page .page_login .openlib_password_control input[type="text"],
html body.openlib-site-page .page_login .openlib_password_control input[type="password"] {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  height: 48px !important;
  padding-right: 82px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 10px !important;
  background: #fff !important;
  color: var(--ole-ink) !important;
}

html body.openlib-site-page .page_login .openlib_password_toggle {
  right: 8px !important;
  max-width: 72px !important;
  height: 31px !important;
  padding: 0 8px !important;
  border-radius: 7px !important;
}

html body.openlib-site-page .page_login .buttons {
  grid-template-columns: 1fr 1fr !important;
  gap: 10px !important;
  width: 100% !important;
}

html body.openlib-site-page .page_login .buttons button,
html body.openlib-site-page .page_login .buttons a {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 44px !important;
  border-radius: 10px !important;
}

/* ===== Register ===== */
html body.openlib-site-page .page_register {
  max-width: 980px !important;
  padding: 34px 36px !important;
  border: 1px solid #dce2ea !important;
  border-radius: 18px !important;
  background: #fff !important;
  box-shadow: 0 10px 30px rgba(15,23,42,.045) !important;
}

html body.openlib-site-page .page_register fieldset {
  border-color: #dde3eb !important;
  background: #fbfcfd !important;
}

/* ===== Journal header/content: restrained white paper style ===== */
html body.openlib-journal-page .openlib_journal_header,
html body.openlib-journal-page .openlib_journal_header__identity {
  background: #fff !important;
  box-shadow: none !important;
}

html body.openlib-journal-page .openlib_journal_header__utility {
  background: #fbfcfd !important;
}

html body.openlib-journal-page .openlib_journal_header__navrow {
  border-top: 1px solid #edf1f5 !important;
  border-bottom: 1px solid #dde3eb !important;
  background: #fff !important;
}

html body.openlib-journal-page .openlib_back_publications {
  border-color: #fecaca !important;
  background: #fff7f7 !important;
  color: #c81e2a !important;
}

html body.openlib-journal-page .openlib_current_issue_panel,
html body.openlib-journal-page .openlib_additional_content_panel {
  border-color: #dde3eb !important;
  border-radius: 16px !important;
  box-shadow: 0 5px 18px rgba(15,23,42,.035) !important;
}

/* ===== Light footer: no black block ===== */
html body .openlib_site_footer,
html body .openlib_journal_footer_global {
  position: relative !important;
  border-top: 1px solid #fecaca !important;
  background: linear-gradient(180deg, #fff 0%, var(--ole-footer) 100%) !important;
  color: #475569 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85) !important;
}

html body .openlib_site_footer:before,
html body .openlib_journal_footer_global:before {
  height: 3px !important;
  background: linear-gradient(90deg, #b91c1c 0%, #ef4444 50%, #fda4af 100%) !important;
}

html body .openlib_site_footer__inner,
html body .openlib_site_footer__bottom,
html body .openlib_journal_footer_global .pkp_structure_footer {
  width: min(var(--ole-shell), calc(100% - 64px)) !important;
  max-width: var(--ole-shell) !important;
}

html body .openlib_site_footer__inner {
  display: flex !important;
  gap: 28px !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding-top: 26px !important;
  padding-bottom: 20px !important;
}

html body .openlib_site_footer__brand_text strong {
  color: var(--ole-ink) !important;
  font-size: 14px !important;
}

html body .openlib_site_footer__brand_text span {
  color: #64748b !important;
  font-size: 11px !important;
}

html body .openlib_site_footer__links {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px 18px !important;
  justify-content: flex-end !important;
}

html body .openlib_site_footer__links a,
html body .openlib_journal_footer_global__meta a {
  color: #475569 !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
}

html body .openlib_site_footer__links a:hover,
html body .openlib_journal_footer_global__meta a:hover {
  color: var(--ole-red) !important;
}

html body .openlib_site_footer__bottom {
  padding-top: 12px !important;
  padding-bottom: 18px !important;
  border-top: 1px solid #f2d8da !important;
  color: #7c8799 !important;
  font-size: 10.5px !important;
}

html body .openlib_journal_footer_global .pkp_structure_footer {
  padding-top: 23px !important;
  padding-bottom: 23px !important;
}

html body .openlib_journal_footer_global__meta {
  color: #94a3b8 !important;
}

/* ===== Native selects ===== */
html body select option {
  background: #fff !important;
  color: #0f172a !important;
}

/* ===== Dark mode: same structure, readable controls ===== */
html[data-openlib-color-mode="dark"] body {
  --ole-ink: #f8fafc;
  --ole-text: #d5dbe5;
  --ole-muted: #9aa6b8;
  --ole-line: #2b3648;
  --ole-line-soft: #222d3d;
  --ole-canvas: #0c1422;
  --ole-surface: #111b2b;
  --ole-footer: #151f30;
  background: #0c1422 !important;
}

html[data-openlib-color-mode="dark"] body .pkp_structure_page {
  background: #0c1422 !important;
}

html[data-openlib-color-mode="dark"] body.openlib-site-page .openlib_site_header,
html[data-openlib-color-mode="dark"] body.openlib-site-index .openlib_site_header,
html[data-openlib-color-mode="dark"] body.openlib-journal-page .openlib_journal_header,
html[data-openlib-color-mode="dark"] body.openlib-journal-page .openlib_journal_header__identity,
html[data-openlib-color-mode="dark"] body.openlib-journal-page .openlib_journal_header__navrow {
  border-color: #2b3648 !important;
  background: #101a2a !important;
}

html[data-openlib-color-mode="dark"] body .openlib_site_header__utility,
html[data-openlib-color-mode="dark"] body.openlib-journal-page .openlib_journal_header__utility {
  border-color: #263244 !important;
  background: #0e1726 !important;
}

html[data-openlib-color-mode="dark"] body.openlib-site-index .openlib_portal_intro,
html[data-openlib-color-mode="dark"] body.openlib-site-index .openlib_search_panel,
html[data-openlib-color-mode="dark"] body.openlib-site-index .openlib_journal_card,
html[data-openlib-color-mode="dark"] body.openlib-site-page .openlib_search_form,
html[data-openlib-color-mode="dark"] body.openlib-site-page .openlib_search_results .obj_article_summary,
html[data-openlib-color-mode="dark"] body.openlib-site-page .page_login,
html[data-openlib-color-mode="dark"] body.openlib-site-page .page_register,
html[data-openlib-color-mode="dark"] body.openlib-journal-page .openlib_current_issue_panel,
html[data-openlib-color-mode="dark"] body.openlib-journal-page .openlib_additional_content_panel {
  border-color: #344154 !important;
  background: #111b2b !important;
  color: #d5dbe5 !important;
}

html[data-openlib-color-mode="dark"] body.openlib-site-index .openlib_search_panel,
html[data-openlib-color-mode="dark"] body.openlib-site-page .openlib_search_form {
  border-color: #7f3f46 !important;
}

html[data-openlib-color-mode="dark"] body.openlib-site-index .openlib_portal_intro__badge,
html[data-openlib-color-mode="dark"] body.openlib-site-index .openlib_journal_footer,
html[data-openlib-color-mode="dark"] body.openlib-site-index .openlib_journal_filter,
html[data-openlib-color-mode="dark"] body.openlib-site-index .openlib_journal_filter > .fa {
  border-color: #344154 !important;
  background: #0f1928 !important;
}

html[data-openlib-color-mode="dark"] body.openlib-site-index .openlib_discovery__form input[type="search"],
html[data-openlib-color-mode="dark"] body.openlib-site-index .openlib_discovery__form select,
html[data-openlib-color-mode="dark"] body.openlib-site-page .openlib_search_form__primary input,
html[data-openlib-color-mode="dark"] body.openlib-site-page .openlib_search_form__primary select,
html[data-openlib-color-mode="dark"] body.openlib-site-index .openlib_journal_filter input,
html[data-openlib-color-mode="dark"] body.openlib-site-page .page_login input[type="text"],
html[data-openlib-color-mode="dark"] body.openlib-site-page .page_login input[type="password"],
html[data-openlib-color-mode="dark"] body.openlib-site-page .page_login .openlib_password_control input[type="text"],
html[data-openlib-color-mode="dark"] body.openlib-site-page .page_login .openlib_password_control input[type="password"] {
  border-color: #435066 !important;
  background: #0d1726 !important;
  color: #f8fafc !important;
}

html[data-openlib-color-mode="dark"] body select,
html[data-openlib-color-mode="dark"] body select option {
  background: #111b2b !important;
  color: #f8fafc !important;
}

html[data-openlib-color-mode="dark"] body .openlib_site_footer,
html[data-openlib-color-mode="dark"] body .openlib_journal_footer_global {
  border-color: #4c2f35 !important;
  background: linear-gradient(180deg, #111b2b 0%, #151f30 100%) !important;
  color: #cbd5e1 !important;
}

html[data-openlib-color-mode="dark"] body .openlib_site_footer__brand_text strong,
html[data-openlib-color-mode="dark"] body .openlib_site_footer__links a,
html[data-openlib-color-mode="dark"] body .openlib_journal_footer_global__meta a {
  color: #e5e7eb !important;
}

html[data-openlib-color-mode="dark"] body .openlib_site_footer__brand_text span,
html[data-openlib-color-mode="dark"] body .openlib_site_footer__bottom {
  color: #9aa6b8 !important;
}

/* ===== Responsive ===== */
@media (max-width: 980px) {
  html body .pkp_structure_content,
  html body .openlib_site_shell,
  html body .openlib_journal_shell,
  html body .openlib_site_footer__inner,
  html body .openlib_site_footer__bottom,
  html body .openlib_journal_footer_global .pkp_structure_footer {
    width: min(100% - 36px, var(--ole-shell)) !important;
  }

  html body.openlib-site-index .openlib_discovery__form,
  html body.openlib-site-page .openlib_search_form__primary.has_journal_filter {
    grid-template-columns: minmax(0,1fr) 210px !important;
  }

  html body.openlib-site-index .openlib_discovery__form button,
  html body.openlib-site-page .openlib_search_form__submit {
    grid-column: 1 / -1 !important;
  }
}

@media (max-width: 760px) {
  html body .pkp_structure_content,
  html body .openlib_site_shell,
  html body .openlib_journal_shell,
  html body .openlib_site_footer__inner,
  html body .openlib_site_footer__bottom,
  html body .openlib_journal_footer_global .pkp_structure_footer {
    width: calc(100% - 28px) !important;
  }

  html body.openlib-site-index .openlib_portal_intro {
    grid-template-columns: 1fr !important;
    padding: 22px 22px 22px 25px !important;
  }

  html body.openlib-site-index .openlib_portal_intro__badge {
    display: inline-grid !important;
    width: max-content !important;
    min-width: 106px !important;
  }

  html body.openlib-site-index .openlib_discovery__form,
  html body.openlib-site-page .openlib_search_form__primary.has_journal_filter {
    grid-template-columns: 1fr !important;
  }

  html body.openlib-site-index .openlib_discovery__form button,
  html body.openlib-site-page .openlib_search_form__submit {
    grid-column: auto !important;
  }

  html body.openlib-site-index .openlib_journal_tools {
    align-items: stretch !important;
    flex-direction: column !important;
  }

  html body.openlib-site-index .openlib_journal_filter {
    width: 100% !important;
    min-width: 0 !important;
  }

  html body.openlib-site-index .openlib_journal_grid,
  html body.openlib-site-index .openlib_journal_grid.openlib_journal_grid--two {
    grid-template-columns: 1fr !important;
  }

  html body.openlib-site-page.pkp_page_login .pkp_structure_content {
    width: calc(100% - 28px) !important;
    padding-top: 32px !important;
    padding-bottom: 44px !important;
  }

  html body.openlib-site-page .page_login {
    width: 100% !important;
    padding: 30px 22px 32px !important;
    border-radius: 15px !important;
  }

  html body.openlib-site-page .page_login .buttons {
    grid-template-columns: 1fr !important;
  }

  html body .openlib_site_footer__inner {
    align-items: flex-start !important;
    flex-direction: column !important;
  }

  html body .openlib_site_footer__links {
    justify-content: flex-start !important;
  }
}

@media (max-width: 520px) {
  html body.openlib-site-index .openlib_journal_main {
    grid-template-columns: 86px minmax(0,1fr) !important;
    gap: 13px !important;
    padding: 15px !important;
  }

  html body.openlib-site-index .openlib_journal_media,
  html body.openlib-site-index .openlib_journal_media a,
  html body.openlib-site-index .openlib_journal_media img {
    width: 86px !important;
    max-width: 86px !important;
    height: 122px !important;
    max-height: 122px !important;
  }
}
