#reading-settings.rs{
  position:fixed;
  z-index:2147483647;
  font-family:inherit;
  line-height:1;
  /* JS moves the control beside the chapter title when possible. */
  top:50%;
  right:24px;
}

/* Gear-only button — no SETTINGS label. */
#reading-settings .rs-toggle{
  width:42px;
  height:42px;
  min-width:42px;
  border:0;
  border-radius:50%;
  background:transparent;
  color:#222;
  box-shadow:none;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
  transition:transform .18s ease, filter .18s ease;
}

#reading-settings .rs-gear{
  display:block;
  font-family:"Arial Unicode MS","Segoe UI Symbol","Noto Sans Symbols 2",sans-serif;
  font-size:36px;
  line-height:1;
  filter:drop-shadow(0 1px 1px rgba(0,0,0,.25));
}

#reading-settings .rs-toggle:hover{
  transform:rotate(12deg) scale(1.05);
}

#reading-settings .rs-toggle:focus-visible{
  outline:2px solid currentColor;
  outline-offset:3px;
}

/* Compact font-size-only panel. */
#reading-settings .rs-panel{
  position:absolute;
  top:48px;
  right:0;
  width:225px;
  background:#fff;
  color:#222;
  border-radius:12px;
  padding:12px;
  box-shadow:0 8px 30px rgba(0,0,0,.25);
  border:1px solid rgba(0,0,0,.1);
  box-sizing:border-box;
}

#reading-settings .rs-panel[hidden]{display:none!important}

#reading-settings .rs-title{
  font-weight:700;
  font-size:14px;
  margin:2px 2px 10px;
  line-height:1.3;
}

#reading-settings .rs-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:9px 2px;
  border-top:1px solid #eee;
  font-size:13px;
  line-height:1.3;
}

#reading-settings .rs-controls{
  display:flex;
  gap:5px;
}

#reading-settings .rs-controls button,
#reading-settings .rs-reset{
  border:1px solid #ddd;
  background:#f7f7f7;
  color:#222;
  border-radius:7px;
  cursor:pointer;
}

#reading-settings .rs-controls button{
  min-width:30px;
  height:29px;
  font-size:12px;
  padding:0 5px;
}

#reading-settings .rs-controls button:hover,
#reading-settings .rs-reset:hover{
  background:#eee;
}

#reading-settings .rs-reset{
  width:100%;
  padding:8px;
  margin-top:4px;
  font-size:12px;
}

/* When JS anchors the gear to the Chapter title row. */
#reading-settings.rs.rs-chapter-anchored{
  position:absolute;
  top:50%;
  right:10px;
  transform:translateY(-50%);
}

@media(max-width:600px){
  #reading-settings.rs{
    right:10px;
  }

  #reading-settings.rs.rs-chapter-anchored{
    right:4px;
  }

  #reading-settings .rs-panel{
    width:210px;
  }

  #reading-settings .rs-gear{
    font-size:34px;
  }
}
