/* Open Library Theme — 2026-08-29 v60
 * Unified logged-in header capsule and identical auth card styling
 * for publisher portal + every journal context.
 */
:root{
  --ol60-red:#dc2635;
  --ol60-red-dark:#ba1e2b;
  --ol60-red-soft:#fff4f5;
  --ol60-line:#e4e7ec;
  --ol60-text:#182233;
  --ol60-muted:#667085;
  --ol60-shadow:0 10px 28px rgba(24,34,51,.07);
}

/* =========================================================
   LOGGED-IN HEADER — SAME VISUAL SYSTEM AS GUEST CAPSULE
   ========================================================= */
html body .openlib_account_cluster:not(.openlib_account_cluster--guest){
  position:relative!important;
  display:inline-flex!important;
  align-items:center!important;
  gap:6px!important;
  min-height:44px!important;
  margin:0!important;
  padding:5px!important;
  overflow:visible!important;
  border:1px solid rgba(255,255,255,.86)!important;
  border-radius:15px!important;
  background:#fff!important;
  box-shadow:0 8px 20px rgba(104,9,17,.16)!important;
}
html body .openlib_account_cluster:not(.openlib_account_cluster--guest) > .openlib_color_mode_toggle{
  position:relative!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex:0 0 34px!important;
  width:34px!important;
  min-width:34px!important;
  height:34px!important;
  min-height:34px!important;
  margin:0!important;
  padding:0!important;
  border:1px solid var(--ol60-red)!important;
  border-radius:10px!important;
  background:var(--ol60-red)!important;
  background-image:none!important;
  color:#fff!important;
  box-shadow:none!important;
  filter:none!important;
  opacity:1!important;
}
html body .openlib_account_cluster:not(.openlib_account_cluster--guest) > .openlib_color_mode_toggle:hover,
html body .openlib_account_cluster:not(.openlib_account_cluster--guest) > .openlib_color_mode_toggle:focus,
html body .openlib_account_cluster:not(.openlib_account_cluster--guest) > .openlib_color_mode_toggle:active,
html[data-openlib-color-mode="dark"] body .openlib_account_cluster:not(.openlib_account_cluster--guest) > .openlib_color_mode_toggle,
html[data-openlib-color-mode="dark"] body .openlib_account_cluster:not(.openlib_account_cluster--guest) > .openlib_color_mode_toggle:hover,
html[data-openlib-color-mode="dark"] body .openlib_account_cluster:not(.openlib_account_cluster--guest) > .openlib_color_mode_toggle:focus,
html[data-openlib-color-mode="dark"] body .openlib_account_cluster:not(.openlib_account_cluster--guest) > .openlib_color_mode_toggle:active{
  border-color:var(--ol60-red)!important;
  background:var(--ol60-red)!important;
  background-image:none!important;
  color:#fff!important;
  filter:none!important;
  opacity:1!important;
  outline:0!important;
}
html body .openlib_account_cluster:not(.openlib_account_cluster--guest) > .openlib_color_mode_toggle .fa{
  margin:0!important;
  color:#fff!important;
  font-size:14px!important;
  line-height:1!important;
}

html body .openlib_account_cluster:not(.openlib_account_cluster--guest) #navigationUserWrapper{
  position:relative!important;
  display:flex!important;
  align-items:center!important;
  min-width:0!important;
  margin:0!important;
  padding:0!important;
  overflow:visible!important;
}
html body .openlib_account_cluster:not(.openlib_account_cluster--guest) #navigationUserWrapper .pkp_navigation_user{
  display:flex!important;
  align-items:center!important;
  width:auto!important;
  min-width:0!important;
  margin:0!important;
  padding:0!important;
  list-style:none!important;
}
html body .openlib_account_cluster:not(.openlib_account_cluster--guest) #navigationUserWrapper .pkp_navigation_user > li{
  position:relative!important;
  display:block!important;
  width:auto!important;
  margin:0!important;
  padding:0!important;
  list-style:none!important;
}
html body .openlib_account_cluster:not(.openlib_account_cluster--guest) #navigationUserWrapper .pkp_navigation_user > li > a{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-width:68px!important;
  height:34px!important;
  min-height:34px!important;
  margin:0!important;
  padding:0 15px!important;
  border:0!important;
  border-radius:10px!important;
  background:#fff!important;
  color:var(--ol60-red)!important;
  font-size:13px!important;
  font-weight:800!important;
  line-height:1!important;
  text-decoration:none!important;
  box-shadow:none!important;
  white-space:nowrap!important;
}
html body .openlib_account_cluster:not(.openlib_account_cluster--guest) #navigationUserWrapper .pkp_navigation_user > li > a:hover,
html body .openlib_account_cluster:not(.openlib_account_cluster--guest) #navigationUserWrapper .pkp_navigation_user > li > a:focus-visible{
  background:var(--ol60-red-soft)!important;
  color:var(--ol60-red-dark)!important;
  outline:0!important;
}
html body .openlib_account_cluster:not(.openlib_account_cluster--guest) #navigationUserWrapper .pkp_navigation_user > li.openlib-account-open > a{
  background:var(--ol60-red)!important;
  color:#fff!important;
}

/* Account submenu remains click-only and floats below the unified capsule. */
html body #navigationUserWrapper .pkp_navigation_user > li > ul,
html body #navigationUserWrapper .pkp_navigation_user > li > .dropdown-menu,
html body #navigationUserWrapper .openlib-account-dropdown,
html body #navigationUserWrapper .dropdown-menu,
html body #navigationUserWrapper .dropdown-menu.show{
  display:none!important;
  visibility:hidden!important;
  opacity:0!important;
  pointer-events:none!important;
}
html body #navigationUserWrapper .pkp_navigation_user > li.openlib-account-open > ul,
html body #navigationUserWrapper .pkp_navigation_user > li.openlib-account-open > .dropdown-menu,
html body #navigationUserWrapper .openlib-account-item.openlib-account-open > .openlib-account-dropdown{
  position:absolute!important;
  top:calc(100% + 9px)!important;
  right:0!important;
  left:auto!important;
  z-index:2600!important;
  display:block!important;
  visibility:visible!important;
  opacity:1!important;
  pointer-events:auto!important;
  width:220px!important;
  min-width:220px!important;
  margin:0!important;
  padding:7px!important;
  list-style:none!important;
  border:1px solid var(--ol60-line)!important;
  border-radius:13px!important;
  background:#fff!important;
  box-shadow:0 18px 42px rgba(20,27,38,.18)!important;
}
html body #navigationUserWrapper .pkp_navigation_user > li.openlib-account-open > ul > li,
html body #navigationUserWrapper .openlib-account-open > .dropdown-menu > li,
html body #navigationUserWrapper .openlib-account-open > .openlib-account-dropdown > li{
  display:block!important;
  width:100%!important;
  margin:0!important;
  padding:0!important;
  list-style:none!important;
}
html body #navigationUserWrapper .pkp_navigation_user > li.openlib-account-open > ul a,
html body #navigationUserWrapper .openlib-account-open > .dropdown-menu a,
html body #navigationUserWrapper .openlib-account-open > .openlib-account-dropdown a{
  display:flex!important;
  align-items:center!important;
  min-height:39px!important;
  width:100%!important;
  margin:0!important;
  padding:8px 10px!important;
  border:0!important;
  border-radius:9px!important;
  background:transparent!important;
  color:var(--ol60-text)!important;
  font-size:13px!important;
  font-weight:650!important;
  line-height:1.3!important;
  text-decoration:none!important;
}
html body #navigationUserWrapper .pkp_navigation_user > li.openlib-account-open > ul a:hover,
html body #navigationUserWrapper .openlib-account-open > .dropdown-menu a:hover,
html body #navigationUserWrapper .openlib-account-open > .openlib-account-dropdown a:hover{
  background:var(--ol60-red-soft)!important;
  color:var(--ol60-red-dark)!important;
}

/* =========================================================
   LOGIN — SAME CARD IN PORTAL AND JOURNAL
   ========================================================= */
html body.pkp_page_login .page_login,
html body.openlib-site-page.pkp_page_login .page_login,
html body.openlib-journal-page.pkp_page_login .page_login{
  position:relative!important;
  box-sizing:border-box!important;
  width:100%!important;
  max-width:none!important;
  margin:0!important;
  padding:30px 28px 32px!important;
  overflow:hidden!important;
  border:1px solid var(--ol60-line)!important;
  border-top:4px solid var(--ol60-red)!important;
  border-radius:16px!important;
  background:#fff!important;
  box-shadow:var(--ol60-shadow)!important;
}
html body.pkp_page_login .page_login > h1{
  margin:0 0 9px!important;
  color:var(--ol60-text)!important;
  font-size:29px!important;
  line-height:1.2!important;
  font-weight:850!important;
}
html body.pkp_page_login .page_login > p{
  margin:0 0 24px!important;
  color:var(--ol60-muted)!important;
  font-size:13px!important;
  line-height:1.55!important;
}
html body.pkp_page_login form#login fieldset.fields{
  display:grid!important;
  grid-template-columns:minmax(0,1fr)!important;
  gap:18px!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
}
html body.pkp_page_login form#login .username,
html body.pkp_page_login form#login .password,
html body.pkp_page_login form#login .remember,
html body.pkp_page_login form#login .buttons{
  width:100%!important;
  margin:0!important;
  padding:0!important;
}
html body.pkp_page_login form#login label,
html body.pkp_page_login form#login label > .label{
  color:#344054!important;
  font-size:13px!important;
  font-weight:750!important;
}
html body.pkp_page_login form#login label > .label{
  display:block!important;
  margin:0 0 7px!important;
}
html body.pkp_page_login form#login input[type="text"],
html body.pkp_page_login form#login input[type="email"],
html body.pkp_page_login form#login input[type="password"]{
  box-sizing:border-box!important;
  display:block!important;
  width:100%!important;
  height:46px!important;
  margin:0!important;
  padding:0 14px!important;
  border:1px solid #d5dbe4!important;
  border-radius:10px!important;
  background:#fff!important;
  color:#243044!important;
  box-shadow:none!important;
}
html body.pkp_page_login form#login input:focus{
  border-color:var(--ol60-red)!important;
  outline:0!important;
  box-shadow:0 0 0 3px rgba(220,38,53,.10)!important;
}

/* Forgot password always sits immediately below Password, never at the side. */
html body.pkp_page_login form#login .password label{
  display:flex!important;
  flex-direction:column!important;
  align-items:stretch!important;
  gap:0!important;
}
html body.pkp_page_login form#login .password label > .label{order:1!important;}
html body.pkp_page_login form#login .password input{order:2!important;}
html body.pkp_page_login form#login .password a{
  order:3!important;
  align-self:flex-start!important;
  margin:8px 0 0!important;
  padding:0!important;
  color:var(--ol60-red-dark)!important;
  font-size:12.5px!important;
  font-weight:700!important;
  line-height:1.35!important;
  white-space:normal!important;
  text-decoration:none!important;
}
html body.pkp_page_login form#login .password a:hover{
  color:var(--ol60-red)!important;
  text-decoration:underline!important;
}
html body.pkp_page_login form#login .remember label{
  display:inline-flex!important;
  align-items:center!important;
  gap:8px!important;
  font-weight:600!important;
}
html body.pkp_page_login form#login .remember input{
  width:16px!important;
  height:16px!important;
  margin:0!important;
}
html body.pkp_page_login form#login .remember .label{
  display:inline!important;
  margin:0!important;
  font-weight:600!important;
}
html body.pkp_page_login form#login .buttons{
  display:flex!important;
  align-items:center!important;
  flex-wrap:wrap!important;
  gap:10px!important;
  padding-top:2px!important;
}
html body.pkp_page_login form#login .buttons .submit,
html body.pkp_page_login form#login .buttons .register{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-height:40px!important;
  margin:0!important;
  padding:0 17px!important;
  border-radius:9px!important;
  font-size:13px!important;
  font-weight:800!important;
  text-decoration:none!important;
}
html body.pkp_page_login form#login .buttons .submit{
  border:1px solid var(--ol60-red)!important;
  background:var(--ol60-red)!important;
  color:#fff!important;
}
html body.pkp_page_login form#login .buttons .register{
  border:1px solid #f1b8bd!important;
  background:#fff!important;
  color:var(--ol60-red-dark)!important;
}

/* =========================================================
   REGISTER — SAME CARD IN PORTAL AND JOURNAL
   ========================================================= */
html body.pkp_page_user.pkp_op_register .page_register,
html body.openlib-site-page.pkp_page_user.pkp_op_register .page_register,
html body.openlib-journal-page.pkp_page_user.pkp_op_register .page_register{
  position:relative!important;
  box-sizing:border-box!important;
  width:100%!important;
  max-width:none!important;
  margin:0!important;
  padding:30px 28px 34px!important;
  overflow:hidden!important;
  border:1px solid var(--ol60-line)!important;
  border-top:4px solid var(--ol60-red)!important;
  border-radius:16px!important;
  background:#fff!important;
  box-shadow:var(--ol60-shadow)!important;
}
html body.pkp_page_user.pkp_op_register .page_register > h1{
  margin:0 0 9px!important;
  color:var(--ol60-text)!important;
  font-size:29px!important;
  line-height:1.2!important;
  font-weight:850!important;
}
html body.pkp_page_user.pkp_op_register .page_register > p{
  margin:0 0 24px!important;
  color:var(--ol60-muted)!important;
  font-size:13px!important;
  line-height:1.55!important;
}
html body.pkp_page_user.pkp_op_register form#register > fieldset,
html body.pkp_page_user.pkp_op_register form#register fieldset.identity,
html body.pkp_page_user.pkp_op_register form#register fieldset.login,
html body.pkp_page_user.pkp_op_register form#register fieldset.consent,
html body.pkp_page_user.pkp_op_register form#register fieldset.reviewer,
html body.pkp_page_user.pkp_op_register form#register fieldset[name="contexts"]{
  box-sizing:border-box!important;
  margin:0 0 18px!important;
  padding:20px!important;
  border:1px solid var(--ol60-line)!important;
  border-radius:14px!important;
  background:#fcfcfd!important;
}
html body.pkp_page_user.pkp_op_register form#register > fieldset > legend,
html body.pkp_page_user.pkp_op_register form#register fieldset.identity > legend,
html body.pkp_page_user.pkp_op_register form#register fieldset.login > legend,
html body.pkp_page_user.pkp_op_register form#register fieldset[name="contexts"] > legend{
  padding:5px 10px!important;
  border:1px solid #f2c4c8!important;
  border-radius:999px!important;
  background:#fff!important;
  color:var(--ol60-red-dark)!important;
  font-size:12.5px!important;
  font-weight:800!important;
}
html body.pkp_page_user.pkp_op_register form#register input:not([type="checkbox"]):not([type="radio"]),
html body.pkp_page_user.pkp_op_register form#register select,
html body.pkp_page_user.pkp_op_register form#register textarea{
  box-sizing:border-box!important;
  min-height:44px!important;
  border:1px solid #d5dbe4!important;
  border-radius:10px!important;
  background:#fff!important;
  color:#243044!important;
  box-shadow:none!important;
}
html body.pkp_page_user.pkp_op_register form#register input:focus,
html body.pkp_page_user.pkp_op_register form#register select:focus,
html body.pkp_page_user.pkp_op_register form#register textarea:focus{
  border-color:var(--ol60-red)!important;
  outline:0!important;
  box-shadow:0 0 0 3px rgba(220,38,53,.10)!important;
}

/* =========================================================
   DARK MODE — SAME GEOMETRY, DARK SURFACES
   ========================================================= */
html[data-openlib-color-mode="dark"] body .openlib_account_cluster:not(.openlib_account_cluster--guest){
  border-color:rgba(255,255,255,.82)!important;
  background:#fff!important;
}
html[data-openlib-color-mode="dark"] body .openlib_account_cluster:not(.openlib_account_cluster--guest) #navigationUserWrapper .pkp_navigation_user > li > a{
  background:#fff!important;
  color:var(--ol60-red)!important;
}
html[data-openlib-color-mode="dark"] body #navigationUserWrapper .pkp_navigation_user > li.openlib-account-open > ul,
html[data-openlib-color-mode="dark"] body #navigationUserWrapper .openlib-account-open > .dropdown-menu,
html[data-openlib-color-mode="dark"] body #navigationUserWrapper .openlib-account-open > .openlib-account-dropdown{
  border-color:#354050!important;
  background:#171e28!important;
}
html[data-openlib-color-mode="dark"] body #navigationUserWrapper .pkp_navigation_user > li.openlib-account-open > ul a,
html[data-openlib-color-mode="dark"] body #navigationUserWrapper .openlib-account-open > .dropdown-menu a,
html[data-openlib-color-mode="dark"] body #navigationUserWrapper .openlib-account-open > .openlib-account-dropdown a{
  color:#eef2f7!important;
}
html[data-openlib-color-mode="dark"] body.pkp_page_login .page_login,
html[data-openlib-color-mode="dark"] body.pkp_page_user.pkp_op_register .page_register{
  border-color:#354050!important;
  border-top-color:#ef4450!important;
  background:#171e28!important;
  box-shadow:0 12px 34px rgba(0,0,0,.28)!important;
}
html[data-openlib-color-mode="dark"] body.pkp_page_login .page_login > h1,
html[data-openlib-color-mode="dark"] body.pkp_page_user.pkp_op_register .page_register > h1,
html[data-openlib-color-mode="dark"] body.pkp_page_login form#login label,
html[data-openlib-color-mode="dark"] body.pkp_page_login form#login label > .label{
  color:#f5f7fa!important;
}
html[data-openlib-color-mode="dark"] body.pkp_page_login .page_login > p,
html[data-openlib-color-mode="dark"] body.pkp_page_user.pkp_op_register .page_register > p{
  color:#aab4c2!important;
}
html[data-openlib-color-mode="dark"] body.pkp_page_login form#login input[type="text"],
html[data-openlib-color-mode="dark"] body.pkp_page_login form#login input[type="email"],
html[data-openlib-color-mode="dark"] body.pkp_page_login form#login input[type="password"],
html[data-openlib-color-mode="dark"] body.pkp_page_user.pkp_op_register form#register input:not([type="checkbox"]):not([type="radio"]),
html[data-openlib-color-mode="dark"] body.pkp_page_user.pkp_op_register form#register select,
html[data-openlib-color-mode="dark"] body.pkp_page_user.pkp_op_register form#register textarea{
  border-color:#3b4655!important;
  background:#101720!important;
  color:#f5f7fa!important;
}
html[data-openlib-color-mode="dark"] body.pkp_page_user.pkp_op_register form#register > fieldset,
html[data-openlib-color-mode="dark"] body.pkp_page_user.pkp_op_register form#register fieldset.identity,
html[data-openlib-color-mode="dark"] body.pkp_page_user.pkp_op_register form#register fieldset.login,
html[data-openlib-color-mode="dark"] body.pkp_page_user.pkp_op_register form#register fieldset.consent,
html[data-openlib-color-mode="dark"] body.pkp_page_user.pkp_op_register form#register fieldset.reviewer,
html[data-openlib-color-mode="dark"] body.pkp_page_user.pkp_op_register form#register fieldset[name="contexts"]{
  border-color:#354050!important;
  background:#131a24!important;
}

@media (max-width:767px){
  html body.pkp_page_login .page_login,
  html body.pkp_page_user.pkp_op_register .page_register{
    padding:24px 18px 26px!important;
    border-radius:14px!important;
  }
  html body .openlib_account_cluster:not(.openlib_account_cluster--guest){
    max-width:calc(100vw - 24px)!important;
  }
  html body .openlib_account_cluster:not(.openlib_account_cluster--guest) #navigationUserWrapper .pkp_navigation_user > li > a{
    max-width:150px!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
  }
  html body #navigationUserWrapper .pkp_navigation_user > li.openlib-account-open > ul,
  html body #navigationUserWrapper .openlib-account-open > .dropdown-menu,
  html body #navigationUserWrapper .openlib-account-open > .openlib-account-dropdown{
    width:min(230px,calc(100vw - 28px))!important;
    min-width:0!important;
  }
}
